aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Wygle <awygle@gmail.com>2018-05-06 11:10:36 -0700
committerAndrew Wygle <awygle@gmail.com>2018-05-06 11:10:36 -0700
commit56a0d3f8eaf202027f077bfb98b3e9c00452d08e (patch)
treec5aa8262babec7c6f1000b38ad5b3eab27ba19d5
parenta39b35ac2f134460f9ed31cddff7ccdec1c17469 (diff)
downloadicestorm-56a0d3f8eaf202027f077bfb98b3e9c00452d08e.tar.gz
icestorm-56a0d3f8eaf202027f077bfb98b3e9c00452d08e.tar.bz2
icestorm-56a0d3f8eaf202027f077bfb98b3e9c00452d08e.zip
Add lm4k detection support to icepack.
-rw-r--r--icepack/icepack.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/icepack/icepack.cc b/icepack/icepack.cc
index 3029c25..325c853 100644
--- a/icepack/icepack.cc
+++ b/icepack/icepack.cc
@@ -420,6 +420,8 @@ void FpgaConfig::read_bits(std::istream &ifs)
this->device = "5k";
else if (this->cram_width == 692 && this->cram_height == 176)
this->device = "u4k";
+ else if (this->cram_width == 656 && this->cram_height == 176)
+ this->device = "lm4k";
else
error("Failed to detect chip type.\n");
@@ -693,6 +695,12 @@ void FpgaConfig::read_ascii(std::istream &ifs, bool nosleep)
this->bram_width = 80;
this->bram_height = 2 * 128;
} else
+ if (this->device == "lm4k") {
+ this->cram_width = 656;
+ this->cram_height = 176;
+ this->bram_width = 80;
+ this->bram_height = 2 * 128;
+ } else
error("Unsupported chip type '%s'.\n", this->device.c_str());
this->cram.resize(4);
@@ -1048,6 +1056,7 @@ int FpgaConfig::chip_width() const
if (this->device == "1k") return 12;
if (this->device == "5k") return 24;
if (this->device == "u4k") return 24;
+ if (this->device == "lm4k") return 24;
if (this->device == "8k") return 32;
panic("Unknown chip type '%s'.\n", this->device.c_str());
}
@@ -1058,6 +1067,7 @@ int FpgaConfig::chip_height() const
if (this->device == "1k") return 16;
if (this->device == "5k") return 30;
if (this->device == "u4k") return 20;
+ if (this->device == "lm4k") return 20;
if (this->device == "8k") return 32;
panic("Unknown chip type '%s'.\n", this->device.c_str());
}
@@ -1067,6 +1077,7 @@ vector<int> FpgaConfig::chip_cols() const
if (this->device == "384") return vector<int>({18, 54, 54, 54, 54});
if (this->device == "1k") return vector<int>({18, 54, 54, 42, 54, 54, 54});
if (this->device == "u4k") return vector<int>({54, 54, 54, 54, 54, 54, 42, 54, 54, 54, 54, 54, 54});
+ if (this->device == "lm4k") return vector<int>({18, 54, 54, 54, 54, 54, 42, 54, 54, 54, 54, 54, 54});
// Its IPConnect or Mutiplier block, five logic, ram, six logic.
if (this->device == "5k") return vector<int>({54, 54, 54, 54, 54, 54, 42, 54, 54, 54, 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});
@@ -1110,7 +1121,7 @@ string FpgaConfig::tile_type(int x, int y) const
return "logic";
}
- if (this->device == "5k" || this->device == "u4k") {
+ if (this->device == "5k" || this->device == "u4k" || this->device == "lm4k") {
if (x == 6 || x == 19) return y % 2 == 1 ? "ramb" : "ramt";
return "logic";
}