2015-12-31 12:05:04 +01:00
|
|
|
include ../config.mk
|
2015-10-19 17:02:56 +02:00
|
|
|
LDLIBS = -lm -lstdc++
|
2017-02-12 00:50:15 +01:00
|
|
|
override CXXFLAGS += -DPREFIX='"$(PREFIX)"' -DCHIPDB_SUBDIR='"$(CHIPDB_SUBDIR)"'
|
2015-10-19 17:02:56 +02:00
|
|
|
|
2016-03-02 12:34:51 +01:00
|
|
|
ifeq ($(STATIC),1)
|
|
|
|
|
LDFLAGS += -static
|
|
|
|
|
endif
|
|
|
|
|
|
2016-02-14 13:47:27 +01:00
|
|
|
all: icetime$(EXE)
|
2015-10-19 17:02:56 +02:00
|
|
|
|
2019-03-20 11:38:36 +01:00
|
|
|
CHIPS=lp384 lp1k lp8k hx1k hx8k up5k
|
|
|
|
|
|
2017-11-15 12:13:35 +01:00
|
|
|
ifeq ($(EXE),.js)
|
2017-11-24 17:41:34 +01:00
|
|
|
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
|
2017-11-15 12:13:35 +01:00
|
|
|
|
|
|
|
|
share/$(CHIPDB_SUBDIR)/chipdb-384.txt: ../icebox/chipdb-384.txt
|
|
|
|
|
mkdir -p share/$(CHIPDB_SUBDIR)
|
|
|
|
|
cp $< $@
|
|
|
|
|
share/$(CHIPDB_SUBDIR)/chipdb-1k.txt: ../icebox/chipdb-1k.txt
|
|
|
|
|
mkdir -p share/$(CHIPDB_SUBDIR)
|
|
|
|
|
cp $< $@
|
|
|
|
|
share/$(CHIPDB_SUBDIR)/chipdb-8k.txt: ../icebox/chipdb-8k.txt
|
|
|
|
|
mkdir -p share/$(CHIPDB_SUBDIR)
|
|
|
|
|
cp $< $@
|
2017-11-24 17:41:34 +01:00
|
|
|
share/$(CHIPDB_SUBDIR)/chipdb-5k.txt: ../icebox/chipdb-5k.txt
|
|
|
|
|
mkdir -p share/$(CHIPDB_SUBDIR)
|
|
|
|
|
cp $< $@
|
2017-11-15 12:13:35 +01:00
|
|
|
override LDFLAGS += --embed-file share
|
|
|
|
|
endif
|
|
|
|
|
|
2019-03-20 11:38:36 +01:00
|
|
|
icetime$(EXE): icetime.o iceutil.o $(addsuffix .o, $(addprefix timings-, $(CHIPS)))
|
2017-02-12 00:50:15 +01:00
|
|
|
$(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS)
|
2015-10-19 17:02:56 +02:00
|
|
|
|
2019-03-20 11:38:36 +01:00
|
|
|
timings-%.cc: timings.py ../icefuzz/timings_%.txt
|
|
|
|
|
python3 timings.py $* > $@
|
2016-01-15 18:25:02 +01:00
|
|
|
|
2015-10-19 17:02:56 +02:00
|
|
|
install: all
|
2015-12-31 12:05:04 +01:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
2018-07-30 16:04:04 +02:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/share/icebox
|
2017-07-17 05:52:58 +02:00
|
|
|
cp icetime$(EXE) $(DESTDIR)$(PREFIX)/bin/icetime$(EXE)
|
2018-07-30 16:04:04 +02:00
|
|
|
cp ../icefuzz/timings_*.txt $(DESTDIR)$(PREFIX)/share/icebox/
|
2015-10-19 17:02:56 +02:00
|
|
|
|
|
|
|
|
uninstall:
|
2017-07-17 05:52:58 +02:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/icetime$(EXE)
|
2015-10-19 17:02:56 +02:00
|
|
|
|
2015-10-21 10:27:25 +02:00
|
|
|
|
|
|
|
|
# View timing netlist:
|
|
|
|
|
# yosys -qp 'read_verilog -lib cells.v; prep; show' test0_ref.v
|
2015-10-23 21:08:36 +02:00
|
|
|
# yosys -qp 'read_verilog -lib cells.v; prep; show' test0_out.v
|
2015-10-21 10:27:25 +02:00
|
|
|
|
|
|
|
|
test0 test1 test2 test3 test4 test5 test6 test7 test8 test9: icetime
|
2015-10-23 21:08:36 +02:00
|
|
|
test -f $@_ref.v || python3 mktest.py $@
|
2016-02-01 23:32:03 +01:00
|
|
|
./icetime -m -d hx1k -P tq144 -p $@.pcf -o $@_out.v $@.asc
|
2015-10-22 15:50:25 +02:00
|
|
|
yosys $@.ys
|
2015-10-21 10:27:25 +02:00
|
|
|
|
2015-10-23 21:08:36 +02:00
|
|
|
run0 run1 run2 run3 run4 run5 run6 run7 run8 run9: icetime
|
2016-02-01 23:32:03 +01:00
|
|
|
./icetime -t -d hx1k -P tq144 -p $(subst run,test,$@).pcf $(subst run,test,$@).asc
|
2015-10-23 21:08:36 +02:00
|
|
|
|
2015-10-29 01:13:24 +01:00
|
|
|
show0 show1 show2 show3 show4 show5 show6 show7 show8 show9: icetime
|
2015-10-27 20:00:36 +01:00
|
|
|
bash show.sh $(subst show,test,$@)
|
|
|
|
|
xdot $(subst show,test,$@).dot
|
2015-10-23 21:08:36 +02:00
|
|
|
|
|
|
|
|
test: test0 test1 test2 test3 test4 test5 test6 test7 test8 test9
|
2015-10-21 10:27:25 +02:00
|
|
|
|
2015-10-29 12:13:13 +01:00
|
|
|
show: show0 show1 show2 show3 show4 show5 show6 show7 show8 show9
|
|
|
|
|
|
2015-10-19 17:02:56 +02:00
|
|
|
clean:
|
2019-03-20 11:38:36 +01:00
|
|
|
rm -f icetime$(EXE) icetime.exe *.o *.d
|
2015-10-24 15:01:32 +02:00
|
|
|
rm -rf test[0-9]*
|
2015-10-19 17:02:56 +02:00
|
|
|
|
|
|
|
|
-include *.d
|
|
|
|
|
|
|
|
|
|
.PHONY: all install uninstall clean
|
|
|
|
|
|