Support building actual bitstreams

In addition to PNR-ing for per-module, post-placement simulation, we
also want to be able to do PNR for the purposes of generating a
bitstream. Refactor things a bit so we can (mostly) reuse the same
command line.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
Sean Anderson 2023-01-22 16:26:35 -05:00
parent b68e1312c4
commit 5cf02e9490
1 changed files with 19 additions and 4 deletions

View File

@ -64,9 +64,24 @@ endef
%.place.vvp: %.place.v rtl/iverilog_dump.v
$(run-icarus)
%.asc %.sdf %.place.json &: %.synth.json | log
$(PNR) -q --pcf-allow-unconstrained --freq 125 --hx8k --package ct256 --json $< \
--write $*.place.json --sdf $*.sdf --asc $*.asc --log log/$(*F).place
PNRARGS := --freq 125 --hx8k --package ct256 --pcf-allow-unconstrained --no-promote-globals
define run-pnr =
$(PNR) -q $(PNRARGS) --json $< --log log/$(*F).$(LOG_EXT)
endef
%.sdf %.place.json &: PNRARGS += --write $*.place.json --sdf $*.sdf
%.sdf %.place.json &: LOG_EXT := place
%.sdf %.place.json &: %.synth.json | log
$(run-pnr)
%.asc: PNRARGS += --pcf $*.pcf --asc $@ -r
%.asc: LOG_EXT := asc
%.asc: %.synth.json %.pcf | log
$(run-pnr)
%.bin: rtl/%.asc
$(ICEPACK) $< $@
-include $(wildcard rtl/*.d)
@ -123,4 +138,4 @@ asc: $(addprefix rtl/,$(addsuffix .asc,$(MODULES)))
clean:
rm -f *.fst
rm -rf log
cd rtl && rm -f *.json *.asc *.pre *.vvp *.d *.synth.v *.place.v
cd rtl && rm -f *.json *.asc *.pre *.vvp *.d *.synth.v *.place.v *.sdf