aboutsummaryrefslogtreecommitdiffstats
path: root/icetime
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2016-02-01 23:32:03 +0100
committerClifford Wolf <clifford@clifford.at>2016-02-01 23:32:03 +0100
commit81c33a343ffce5eab897d0a5a7d228bfcb08aaf4 (patch)
treef1a95089b3c441b3895fc55612b5efc730b087bd /icetime
parent8b6116523bdd12b9376b4ed023fee6c62bb7a714 (diff)
downloadicestorm-81c33a343ffce5eab897d0a5a7d228bfcb08aaf4.tar.gz
icestorm-81c33a343ffce5eab897d0a5a7d228bfcb08aaf4.tar.bz2
icestorm-81c33a343ffce5eab897d0a5a7d228bfcb08aaf4.zip
Timing models for LP and HX devices
Diffstat (limited to 'icetime')
-rw-r--r--icetime/Makefile6
-rw-r--r--icetime/icetime.cc49
-rw-r--r--icetime/timings.py8
3 files changed, 48 insertions, 15 deletions
diff --git a/icetime/Makefile b/icetime/Makefile
index 9f8d047..15e635f 100644
--- a/icetime/Makefile
+++ b/icetime/Makefile
@@ -8,7 +8,7 @@ icetime: icetime.o
icetime.o: icetime.cc timings.inc
-timings.inc: timings.py
+timings.inc: timings.py ../icefuzz/timings_*.txt
python3 timings.py > timings.inc.new
mv timings.inc.new timings.inc
@@ -26,11 +26,11 @@ uninstall:
test0 test1 test2 test3 test4 test5 test6 test7 test8 test9: icetime
test -f $@_ref.v || python3 mktest.py $@
- ./icetime -m -P tq144 -p $@.pcf -o $@_out.v $@.asc
+ ./icetime -m -d hx1k -P tq144 -p $@.pcf -o $@_out.v $@.asc
yosys $@.ys
run0 run1 run2 run3 run4 run5 run6 run7 run8 run9: icetime
- ./icetime -t -P tq144 -p $(subst run,test,$@).pcf $(subst run,test,$@).asc
+ ./icetime -t -d hx1k -P tq144 -p $(subst run,test,$@).pcf $(subst run,test,$@).asc
show0 show1 show2 show3 show4 show5 show6 show7 show8 show9: icetime
bash show.sh $(subst show,test,$@)
diff --git a/icetime/icetime.cc b/icetime/icetime.cc
index a6325f0..15cea2c 100644
--- a/icetime/icetime.cc
+++ b/icetime/icetime.cc
@@ -35,7 +35,7 @@ FILE *fin = nullptr, *fout = nullptr, *frpt = nullptr;
bool verbose = false;
bool max_span_hack = false;
-std::string config_device, selected_package;
+std::string config_device, device_type, selected_package;
std::vector<std::vector<std::string>> config_tile_type;
std::vector<std::vector<std::vector<std::vector<bool>>>> config_bits;
std::map<std::tuple<int, int, int>, std::string> pin_pos;
@@ -613,13 +613,19 @@ double get_delay(std::string cell_type, std::string in_port, std::string out_por
if (cell_type == "INTERCONN")
return 0;
- if (config_device == "1k")
- return get_delay_1k(cell_type, in_port, out_port);
+ if (device_type == "lp1k")
+ return get_delay_lp1k(cell_type, in_port, out_port);
- if (config_device == "8k")
- return get_delay_8k(cell_type, in_port, out_port);
+ if (device_type == "lp8k")
+ return get_delay_lp8k(cell_type, in_port, out_port);
- fprintf(stderr, "No built-in timing database for '%s' devices!\n", config_device.c_str());
+ if (device_type == "hx1k")
+ return get_delay_hx1k(cell_type, in_port, out_port);
+
+ if (device_type == "hx8k")
+ return get_delay_hx8k(cell_type, in_port, out_port);
+
+ fprintf(stderr, "No built-in timing database for '%s' devices!\n", device_type.c_str());
exit(1);
}
@@ -1777,6 +1783,9 @@ void help(const char *cmd)
printf(" -r <output_file>\n");
printf(" write timing report to the file (instead of stdout)\n");
printf("\n");
+ printf(" -d lp1k|hx1k|lp8k|hx8k\n");
+ printf(" select the device type (default = lp variant)\n");
+ printf("\n");
printf(" -m\n");
printf(" enable max_span_hack for conservative timing estimates\n");
printf("\n");
@@ -1803,7 +1812,7 @@ int main(int argc, char **argv)
std::vector<std::string> print_timing_nets;
int opt;
- while ((opt = getopt(argc, argv, "p:P:g:o:r:mitT:v")) != -1)
+ while ((opt = getopt(argc, argv, "p:P:g:o:r:d:mitT:v")) != -1)
{
switch (opt)
{
@@ -1836,6 +1845,9 @@ int main(int argc, char **argv)
exit(1);
}
break;
+ case 'd':
+ device_type = optarg;
+ break;
case 'm':
max_span_hack = true;
break;
@@ -1869,6 +1881,29 @@ int main(int argc, char **argv)
fflush(stdout);
read_config();
+ if (device_type.empty()) {
+ device_type = "lp" + config_device;
+ printf("// Warning: Missing -d paramter. Assuming '%s' device.\n", device_type.c_str());
+ }
+
+ if (device_type == "lp1k" || device_type == "hx1k") {
+ if (config_device != "1k")
+ goto device_chip_mismatch;
+ } else
+ if (device_type == "lp8k" || device_type == "hx8k") {
+ if (config_device != "8k")
+ goto device_chip_mismatch;
+ } else {
+ fprintf(stderr, "Error: Invalid device type '%s'.\n", device_type.c_str());
+ exit(1);
+ }
+
+ if (0) {
+device_chip_mismatch:
+ printf("// Warning: Device type '%s' and chip '%s' do not match.\n", device_type.c_str(), config_device.c_str());
+ fflush(stdout);
+ }
+
printf("// Reading %s chipdb file..\n", config_device.c_str());
fflush(stdout);
read_chipdb();
diff --git a/icetime/timings.py b/icetime/timings.py
index e559338..5da87d3 100644
--- a/icetime/timings.py
+++ b/icetime/timings.py
@@ -41,9 +41,7 @@ def timings_to_c(chip, f):
print(" exit(1);")
print("}")
-with open("../icefuzz/timings_1k.txt", "r") as f:
- timings_to_c("1k", f);
-
-with open("../icefuzz/timings_8k.txt", "r") as f:
- timings_to_c("8k", f);
+for db in "lp1k lp8k hx1k hx8k".split():
+ with open("../icefuzz/timings_%s.txt" % db, "r") as f:
+ timings_to_c(db, f);