diff options
Diffstat (limited to 'icetime')
-rw-r--r-- | icetime/Makefile | 20 | ||||
-rw-r--r-- | icetime/icetime.cc | 31 | ||||
-rw-r--r-- | icetime/iceutil.cc | 2 |
3 files changed, 32 insertions, 21 deletions
diff --git a/icetime/Makefile b/icetime/Makefile index acf5b8f..4834709 100644 --- a/icetime/Makefile +++ b/icetime/Makefile @@ -6,12 +6,12 @@ ifeq ($(STATIC),1) LDFLAGS += -static endif -all: icetime$(EXE) +all: $(PROGRAM_PREFIX)icetime$(EXE) -CHIPS=lp384 lp1k lp8k hx1k hx8k up5k +CHIPS=lp384 lp1k lp8k hx1k hx8k up5k u4k ifeq ($(EXE),.js) -icetime$(EXE): | share/$(CHIPDB_SUBDIR)/chipdb-384.txt share/$(CHIPDB_SUBDIR)/chipdb-1k.txt share/$(CHIPDB_SUBDIR)/chipdb-8k.txt share/$(CHIPDB_SUBDIR)/chipdb-5k.txt +$(PROGRAM_PREFIX)icetime$(EXE): | share/$(CHIPDB_SUBDIR)/chipdb-384.txt share/$(CHIPDB_SUBDIR)/chipdb-1k.txt share/$(CHIPDB_SUBDIR)/chipdb-8k.txt share/$(CHIPDB_SUBDIR)/chipdb-5k.txt share/$(CHIPDB_SUBDIR)/chipdb-384.txt: ../icebox/chipdb-384.txt mkdir -p share/$(CHIPDB_SUBDIR) @@ -28,20 +28,22 @@ share/$(CHIPDB_SUBDIR)/chipdb-5k.txt: ../icebox/chipdb-5k.txt override LDFLAGS += --embed-file share endif -icetime$(EXE): icetime.o iceutil.o $(addsuffix .o, $(addprefix timings-, $(CHIPS))) +$(PROGRAM_PREFIX)icetime$(EXE): icetime.o iceutil.o $(addsuffix .o, $(addprefix timings-, $(CHIPS))) $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) timings-%.cc: timings.py ../icefuzz/timings_%.txt $(PYTHON) timings.py $* > $@ +.PRECIOUS: timings-%.cc + install: all mkdir -p $(DESTDIR)$(PREFIX)/bin - mkdir -p $(DESTDIR)$(PREFIX)/share/icebox - cp icetime$(EXE) $(DESTDIR)$(PREFIX)/bin/icetime$(EXE) - cp ../icefuzz/timings_*.txt $(DESTDIR)$(PREFIX)/share/icebox/ + mkdir -p $(DESTDIR)$(PREFIX)/share/$(PROGRAM_PREFIX)icebox + cp $(PROGRAM_PREFIX)icetime$(EXE) $(DESTDIR)$(PREFIX)/bin/$(PROGRAM_PREFIX)icetime$(EXE) + cp ../icefuzz/timings_*.txt $(DESTDIR)$(PREFIX)/share/$(PROGRAM_PREFIX)icebox/ uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/icetime$(EXE) + rm -f $(DESTDIR)$(PREFIX)/bin/$(PROGRAM_PREFIX)icetime$(EXE) # View timing netlist: @@ -65,7 +67,7 @@ test: test0 test1 test2 test3 test4 test5 test6 test7 test8 test9 show: show0 show1 show2 show3 show4 show5 show6 show7 show8 show9 clean: - rm -f icetime$(EXE) icetime.exe *.o *.d timings-*.cc + rm -f $(PROGRAM_PREFIX)icetime$(EXE) $(PROGRAM_PREFIX)icetime.exe *.o *.d timings-*.cc rm -rf test[0-9]* -include *.d diff --git a/icetime/icetime.cc b/icetime/icetime.cc index cc37625..d730fc6 100644 --- a/icetime/icetime.cc +++ b/icetime/icetime.cc @@ -30,6 +30,7 @@ #include <functional> #include <map> #include <set> +#include <stdexcept> #include <string> #include <tuple> #include <vector> @@ -61,16 +62,16 @@ std::map<int, std::string> net_symbols; bool get_config_bit(int tile_x, int tile_y, int bit_row, int bit_col) { - if (int(config_bits.size()) < tile_x) + if (int(config_bits.size()) <= tile_x) return false; - if (int(config_bits[tile_x].size()) < tile_y) + if (int(config_bits[tile_x].size()) <= tile_y) return false; - if (int(config_bits[tile_x][tile_y].size()) < bit_row) + if (int(config_bits[tile_x][tile_y].size()) <= bit_row) return false; - if (int(config_bits[tile_x][tile_y][bit_row].size()) < bit_col) + if (int(config_bits[tile_x][tile_y][bit_row].size()) <= bit_col) return false; return config_bits[tile_x][tile_y][bit_row][bit_col]; @@ -752,6 +753,7 @@ double get_delay_lp8k(std::string cell_type, std::string in_port, std::string ou double get_delay_hx1k(std::string cell_type, std::string in_port, std::string out_port); double get_delay_hx8k(std::string cell_type, std::string in_port, std::string out_port); double get_delay_up5k(std::string cell_type, std::string in_port, std::string out_port); +double get_delay_u4k(std::string cell_type, std::string in_port, std::string out_port); double get_delay(std::string cell_type, std::string in_port, std::string out_port) { @@ -764,17 +766,20 @@ double get_delay(std::string cell_type, std::string in_port, std::string out_por if (device_type == "lp1k") return get_delay_lp1k(cell_type, in_port, out_port); - if (device_type == "lp8k") + if (device_type == "lp8k" || device_type == "lp4k") return get_delay_lp8k(cell_type, in_port, out_port); if (device_type == "hx1k") return get_delay_hx1k(cell_type, in_port, out_port); - if (device_type == "hx8k") + if (device_type == "hx8k" || device_type == "hx4k") return get_delay_hx8k(cell_type, in_port, out_port); - if (device_type == "up5k") + if (device_type == "up5k" || device_type == "up3k") return get_delay_up5k(cell_type, in_port, out_port); + + if (device_type == "u4k" || device_type == "u1k" || device_type == "u2k") + return get_delay_u4k(cell_type, in_port, out_port); fprintf(stderr, "No built-in timing database for '%s' devices!\n", device_type.c_str()); exit(1); } @@ -1593,7 +1598,7 @@ void make_seg_cell(int net, const net_segment_t &seg) if (sscanf(seg.name.c_str(), "lutff_%d/in_%d", &a, &b) == 2) { //"logic" wires at the side of the device are actually IP or DSP - if(device_type == "up5k" && ((seg.x == 0) || (seg.x == int(config_tile_type.size()) - 1))) { + if((device_type == "up5k" || device_type == "up3k") && ((seg.x == 0) || (seg.x == int(config_tile_type.size()) - 1))) { std::string primnet; auto cell = make_dsp_ip(seg.x, seg.y, seg.name, primnet); if(cell != "") { @@ -2209,7 +2214,7 @@ void help(const char *cmd) printf(" -j <output_file>\n"); printf(" write timing report in json format to the file\n"); printf("\n"); - printf(" -d lp384|lp1k|hx1k|lp8k|hx8k|up5k\n"); + printf(" -d lp384|lp1k|hx1k|lp4k|hx4k|lp8k|hx8k|up3k|up5k|u1k|u2k|u4k\n"); printf(" select the device type (default = lp variant)\n"); printf("\n"); printf(" -C <chipdb-file>\n"); @@ -2366,13 +2371,17 @@ int main(int argc, char **argv) if (config_device != "1k") goto device_chip_mismatch; } else - if (device_type == "lp8k" || device_type == "hx8k") { + if (device_type == "lp8k" || device_type == "hx8k" || device_type == "lp4k" || device_type == "hx4k") { if (config_device != "8k") goto device_chip_mismatch; } else - if (device_type == "up5k") { + if (device_type == "up5k" || device_type == "up3k") { if (config_device != "5k") goto device_chip_mismatch; + } else + if (device_type == "u4k" || device_type == "u1k" || device_type == "u2k") { + if (config_device != "u4k") + goto device_chip_mismatch; } else { fprintf(stderr, "Error: Invalid device type '%s'.\n", device_type.c_str()); exit(1); diff --git a/icetime/iceutil.cc b/icetime/iceutil.cc index ad8d662..440b9a8 100644 --- a/icetime/iceutil.cc +++ b/icetime/iceutil.cc @@ -155,7 +155,7 @@ std::string find_chipdb(std::string config_device) #else homepath += getenv("HOME"); #endif - homepath += std::string(PREFIX + 1) + "/" CHIPDB_SUBDIR "/chipdb-" + config_device + ".txt"; + homepath += std::string(&PREFIX[1]) + "/" CHIPDB_SUBDIR "/chipdb-" + config_device + ".txt"; if (verbose) fprintf(stderr, "Looking for chipdb '%s' at %s\n", config_device.c_str(), homepath.c_str()); if (file_test_open(homepath)) |