aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/regressions/Makefile
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2019-02-08 07:01:33 -0800
committerEddie Hung <eddieh@ece.ubc.ca>2019-02-08 07:01:33 -0800
commitbbe819a2ea2ddb12c1575ebb075008e19da402b2 (patch)
tree179fb33805964c1ff6fee4de32868f5696f50c42 /ice40/regressions/Makefile
parentbc5743b50c93d3914f1a0c7f4c09e9f7a921358d (diff)
downloadnextpnr-tests-bbe819a2ea2ddb12c1575ebb075008e19da402b2.tar.gz
nextpnr-tests-bbe819a2ea2ddb12c1575ebb075008e19da402b2.tar.bz2
nextpnr-tests-bbe819a2ea2ddb12c1575ebb075008e19da402b2.zip
Generate ASC, and pipe it through icebox_vlog for sanity
Diffstat (limited to 'ice40/regressions/Makefile')
-rw-r--r--ice40/regressions/Makefile21
1 files changed, 15 insertions, 6 deletions
diff --git a/ice40/regressions/Makefile b/ice40/regressions/Makefile
index 82f0510..7e581ae 100644
--- a/ice40/regressions/Makefile
+++ b/ice40/regressions/Makefile
@@ -4,8 +4,8 @@ JSON := $(wildcard */*.json)
SH := $(wildcard */*.sh)
SH_BASENAME := $(patsubst %.sh,%,$(SH))
JSON := $(filter-out $(addsuffix .json,$(SH_BASENAME)),$(JSON))
-JSON_OUTPUT := $(patsubst %.json,%.log,$(JSON))
-SH_OUTPUT := $(patsubst %.sh,%.log,$(SH))
+JSON_OUTPUT := $(patsubst %.json,%_postpnr.v,$(JSON))
+SH_OUTPUT := $(patsubst %.sh,%_postpnr.v,$(SH))
all: $(JSON_OUTPUT) $(SH_OUTPUT)
@@ -18,8 +18,17 @@ ifeq ($(wildcard $(NPNR)),)
$(error "$$(NPNR) must point to a nextpnr-ice40 binary (currently: $@)")
endif
-$(JSON_OUTPUT): %.log: %.json $(wildcard %.pcf) $(wildcard %.npnr) $(NPNR)
- $(NPNR) --json $(word 1,$^) $(if $(wildcard $*.pcf),--pcf $*.pcf,) $(if $(wildcard $*.npnr),$(shell cat $*.npnr),) > $@ 2>&1
+$(JSON_OUTPUT): %_postpnr.v: %.json $(wildcard %.pcf) $(wildcard %.npnr) $(NPNR)
+ $(NPNR) --json $*.json --asc $*.asc $(if $(wildcard $*.pcf),--pcf $*.pcf,) $(if $(wildcard $*.npnr),$(shell cat $*.npnr),) > /dev/null 2>&1
+ icebox_vlog $*.asc > $@
-$(SH_OUTPUT): %.log: %.sh $(NPNR)
- cd $(dir $@) && NPNR=$(NPNR) bash $(notdir $(word 1,$^)) > /dev/null 2>&1
+$(SH_OUTPUT): %_postpnr.v: %.sh $(NPNR)
+ cd $(dir $@) && NPNR=$(NPNR) bash $(notdir $*.sh) > /dev/null 2>&1
+ if [ -f "$*.asc" ]; then \
+ icebox_vlog $*.asc > $@; \
+ else \
+ touch $@; \
+ fi
+
+clean:
+ @rm -f */*.asc $(JSON_OUTPUT) $(SH_OUTPUT)