From bbe819a2ea2ddb12c1575ebb075008e19da402b2 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 8 Feb 2019 07:01:33 -0800 Subject: Generate ASC, and pipe it through icebox_vlog for sanity --- ice40/regressions/Makefile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'ice40/regressions/Makefile') 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) -- cgit v1.2.3