From 81c33a343ffce5eab897d0a5a7d228bfcb08aaf4 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 1 Feb 2016 23:32:03 +0100 Subject: Timing models for LP and HX devices --- icetime/icetime.cc | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) (limited to 'icetime/icetime.cc') 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> config_tile_type; std::vector>>> config_bits; std::map, 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 \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 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(); -- cgit v1.2.3