mirror of https://github.com/YosysHQ/icestorm.git
Merge pull request #206 from smunaut/icetime
icetime: Split timing 'get_delay' functions per device
This commit is contained in:
commit
d9ea2e15fc
|
|
@ -8,6 +8,8 @@ endif
|
||||||
|
|
||||||
all: icetime$(EXE)
|
all: icetime$(EXE)
|
||||||
|
|
||||||
|
CHIPS=lp384 lp1k lp8k hx1k hx8k up5k
|
||||||
|
|
||||||
ifeq ($(EXE),.js)
|
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
|
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
|
||||||
|
|
||||||
|
|
@ -26,15 +28,11 @@ share/$(CHIPDB_SUBDIR)/chipdb-5k.txt: ../icebox/chipdb-5k.txt
|
||||||
override LDFLAGS += --embed-file share
|
override LDFLAGS += --embed-file share
|
||||||
endif
|
endif
|
||||||
|
|
||||||
icetime$(EXE): icetime.o iceutil.o
|
icetime$(EXE): icetime.o iceutil.o $(addsuffix .o, $(addprefix timings-, $(CHIPS)))
|
||||||
$(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS)
|
$(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS)
|
||||||
|
|
||||||
icetime.o: icetime.cc timings.inc
|
timings-%.cc: timings.py ../icefuzz/timings_%.txt
|
||||||
iceutil.o: iceutil.cc
|
python3 timings.py $* > $@
|
||||||
|
|
||||||
timings.inc: timings.py ../icefuzz/timings_*.txt
|
|
||||||
python3 timings.py > timings.inc.new
|
|
||||||
mv timings.inc.new timings.inc
|
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
|
|
@ -67,7 +65,7 @@ test: test0 test1 test2 test3 test4 test5 test6 test7 test8 test9
|
||||||
show: show0 show1 show2 show3 show4 show5 show6 show7 show8 show9
|
show: show0 show1 show2 show3 show4 show5 show6 show7 show8 show9
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f icetime$(EXE) icetime.exe timings.inc *.o *.d
|
rm -f icetime$(EXE) icetime.exe *.o *.d
|
||||||
rm -rf test[0-9]*
|
rm -rf test[0-9]*
|
||||||
|
|
||||||
-include *.d
|
-include *.d
|
||||||
|
|
|
||||||
|
|
@ -746,7 +746,12 @@ const std::set<std::string> &get_inports(std::string cell_type)
|
||||||
return inports_map.at(cell_type);
|
return inports_map.at(cell_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "timings.inc"
|
double get_delay_lp384(std::string cell_type, std::string in_port, std::string out_port);
|
||||||
|
double get_delay_lp1k(std::string cell_type, std::string in_port, std::string out_port);
|
||||||
|
double get_delay_lp8k(std::string cell_type, std::string in_port, std::string out_port);
|
||||||
|
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(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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
print("// auto-generated by timings.py from ../icefuzz/timings_*.txt")
|
print("// auto-generated by timings.py from ../icefuzz/timings_*.txt")
|
||||||
|
print("#include <string>")
|
||||||
|
|
||||||
def timings_to_c(chip, f):
|
def timings_to_c(chip, f):
|
||||||
print("")
|
print("")
|
||||||
|
|
@ -47,6 +49,11 @@ def timings_to_c(chip, f):
|
||||||
print(" exit(1);")
|
print(" exit(1);")
|
||||||
print("}")
|
print("}")
|
||||||
|
|
||||||
for db in "lp384 lp1k lp8k hx1k hx8k up5k".split():
|
if len(sys.argv) >= 2:
|
||||||
|
chips = sys.argv[1:]
|
||||||
|
else:
|
||||||
|
chips = "lp384 lp1k lp8k hx1k hx8k up5k".split()
|
||||||
|
|
||||||
|
for db in chips:
|
||||||
with open("../icefuzz/timings_%s.txt" % db, "r") as f:
|
with open("../icefuzz/timings_%s.txt" % db, "r") as f:
|
||||||
timings_to_c(db, f);
|
timings_to_c(db, f);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue