From 9ab00ea131c4d3c064962b9d1789ee04325a46a4 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 2 Oct 2016 15:18:48 +0200 Subject: Added "icetime -C " --- icetime/icetime.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'icetime') diff --git a/icetime/icetime.cc b/icetime/icetime.cc index 252d820..84ee8cc 100644 --- a/icetime/icetime.cc +++ b/icetime/icetime.cc @@ -42,7 +42,7 @@ bool verbose = false; bool max_span_hack = false; bool json_firstentry = true; -std::string config_device, device_type, selected_package; +std::string config_device, device_type, selected_package, chipdbfile; std::vector> config_tile_type; std::vector>>> config_bits; std::map, std::string> pin_pos; @@ -276,6 +276,9 @@ void read_chipdb() { char buffer[1024]; + if (!chipdbfile.empty()) { + snprintf(buffer, 1024, "%s", chipdbfile.c_str()); + } else if (PREFIX[0] == '~' && PREFIX[1] == '/') { std::string homedir; #ifdef _WIN32 @@ -293,8 +296,7 @@ void read_chipdb() homedir += getenv("HOME"); #endif snprintf(buffer, 1024, "%s%s/share/icebox/chipdb-%s.txt", homedir.c_str(), PREFIX+1, config_device.c_str()); - } - else + } else snprintf(buffer, 1024, "%s/share/icebox/chipdb-%s.txt", PREFIX, config_device.c_str()); FILE *fdb = fopen(buffer, "r"); @@ -1874,6 +1876,9 @@ void help(const char *cmd) printf(" -d lp1k|hx1k|lp8k|hx8k\n"); printf(" select the device type (default = lp variant)\n"); printf("\n"); + printf(" -C \n"); + printf(" read chip description from the specified file\n"); + printf("\n"); printf(" -m\n"); printf(" enable max_span_hack for conservative timing estimates\n"); printf("\n"); @@ -1904,7 +1909,7 @@ int main(int argc, char **argv) std::vector print_timing_nets; int opt; - while ((opt = getopt(argc, argv, "p:P:g:o:r:j:d:mitT:vc:")) != -1) + while ((opt = getopt(argc, argv, "p:P:g:o:r:j:d:mitT:vc:C:")) != -1) { switch (opt) { @@ -1962,6 +1967,9 @@ int main(int argc, char **argv) case 'c': clock_constr = strtod(optarg, NULL); break; + case 'C': + chipdbfile = optarg; + break; case 'v': verbose = true; break; -- cgit v1.2.3