diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-07-18 13:10:40 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-07-18 13:10:40 +0200 |
commit | 48154cb6f452d3bdb4da36cc267b4b6c45588dc9 (patch) | |
tree | 3ec3be9ef7e8db1fb7c764ed8202e0215a8eb7c7 /icepack/icepack.cc | |
parent | 13e63e6b65e044e348356731b55610d02cb308b9 (diff) | |
download | icestorm-48154cb6f452d3bdb4da36cc267b4b6c45588dc9.tar.gz icestorm-48154cb6f452d3bdb4da36cc267b4b6c45588dc9.tar.bz2 icestorm-48154cb6f452d3bdb4da36cc267b4b6c45588dc9.zip |
Imported full dev sources
Diffstat (limited to 'icepack/icepack.cc')
-rw-r--r-- | icepack/icepack.cc | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/icepack/icepack.cc b/icepack/icepack.cc index 85531b1..3e0f109 100644 --- a/icepack/icepack.cc +++ b/icepack/icepack.cc @@ -379,12 +379,10 @@ void FpgaConfig::read_bits(std::istream &ifs) } } - if (this->cram_width == 182 && this->cram_height == 80) - this->device = "384"; - else if (this->cram_width == 332 && this->cram_height == 144) + if (this->cram_width == 332 && this->cram_height == 144) this->device = "1k"; else if (this->cram_width == 872 && this->cram_height == 272) - this->device = "4k8k"; + this->device = "8k"; else error("Failed to detect chip type.\n"); @@ -595,6 +593,12 @@ void FpgaConfig::read_ascii(std::istream &ifs) this->bram_width = 64; this->bram_height = 2 * 128; } else + if (this->device == "8k") { + this->cram_width = 872; + this->cram_height = 272; + this->bram_width = 128; + this->bram_height = 2 * 128; + } else error("Unsupported chip type '%s'.\n", this->device.c_str()); this->cram.resize(4); @@ -842,36 +846,40 @@ void FpgaConfig::write_bram_pbm(std::ostream &ofs, int bank_num) const int FpgaConfig::chip_width() const { - if (this->device == "384") return 6; - if (this->device == "1k") return 12; - if (this->device == "4k8k") return 32; + if (this->device == "1k") return 12; + if (this->device == "8k") return 32; panic("Unkown chip type '%s'.\n", this->device.c_str()); } int FpgaConfig::chip_height() const { - if (this->device == "384") return 8; - if (this->device == "1k") return 16; - if (this->device == "4k8k") return 32; + if (this->device == "1k") return 16; + if (this->device == "8k") return 32; panic("Unkown chip type '%s'.\n", this->device.c_str()); } vector<int> FpgaConfig::chip_cols() const { - if (this->device == "384") return vector<int>({18, 54, 54, 54}); - if (this->device == "1k") return vector<int>({18, 54, 54, 42, 54, 54, 54}); - if (this->device == "4k8k") return vector<int>({18, 2, 54, 54, 54, 54, 54, 54, 54, 42, 54, 54, 54, 54, 54, 54, 54, 54}); + if (this->device == "1k") return vector<int>({18, 54, 54, 42, 54, 54, 54}); + if (this->device == "8k") return vector<int>({18, 54, 54, 54, 54, 54, 54, 54, 42, 54, 54, 54, 54, 54, 54, 54, 54}); panic("Unkown chip type '%s'.\n", this->device.c_str()); } string FpgaConfig::tile_type(int x, int y) const { + if ((x == 0 || x == this->chip_width()+1) && (y == 0 || y == this->chip_height()+1)) return "corner"; + if ((x == 0 || x == this->chip_width()+1) || (y == 0 || y == this->chip_height()+1)) return "io"; + if (this->device == "1k") { - if ((x == 0 || x == this->chip_width()+1) && (y == 0 || y == this->chip_height()+1)) return "corner"; - if ((x == 0 || x == this->chip_width()+1) || (y == 0 || y == this->chip_height()+1)) return "io"; if (x == 3 || x == 10) return y % 2 == 1 ? "ramb" : "ramt"; return "logic"; } + + if (this->device == "8k") { + if (x == 8 || x == 25) return y % 2 == 1 ? "ramb" : "ramt"; + return "logic"; + } + panic("Unkown chip type '%s'.\n", this->device.c_str()); } |