From 6af697b4eb6546cbf692069be30ab0e74afac40e Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 16 Oct 2022 17:52:27 -0400 Subject: [PATCH] Initial support for post-placement simulation This isn't really useful for most modules (since the placement info is if they were the only thing instantiated), but it should be a good base. Signed-off-by: Sean Anderson --- Makefile | 43 ++++++++++++++++++++++++++++++++++--------- rtl/common.vh | 4 +++- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 734a708..453514b 100644 --- a/Makefile +++ b/Makefile @@ -16,12 +16,20 @@ FORCE: %.synth.json: %.v $(SYNTH) -q -E $@.d -p "synth_ice40 -top $(*F)" -b json -o $@ -f verilog $< -%.synth.v: %.synth.json %.v +define run-jsontov = ( echo '`include "common.vh"'; grep timescale $*.v; \ - $(SYNTH) -q -b verilog -f json $< ) | sed 's/endmodule/`DUMP(1)\n\0/g' > $@ + $(SYNTH) -q -p "write_verilog -defparam -noattr" -f json $< ) | \ + sed 's/endmodule/`DUMP(1)\n\0/g' > $@ +endef + +%.synth.v: %.synth.json %.v + $(run-jsontov) + +%.place.v: %.place.json %.v + $(run-jsontov) # Don't warn about including the timescale from common.vh -IFLAGS := -g2012 -Wall -Wno-timescale +IFLAGS := -g2012 -gspecify -Wall -Wno-timescale define run-icarus = $(ICARUS) $(IFLAGS) -I$(