Makefile: Retry P&R a few times

P&R can be a bit flakey. Retry a few times to get a good seed before
failing.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
Sean Anderson 2023-02-18 22:46:45 -05:00
parent 7c9ac42988
commit fc3cce02ea
1 changed files with 8 additions and 1 deletions

View File

@ -74,10 +74,17 @@ endef
%.sdf %.place.json &: %.synth.json | log
$(run-pnr)
PNR_RETRIES := 10
%.asc: PNRARGS += --pcf $*.pcf --asc $@ -r
%.asc: LOG_EXT := asc
%.asc: %.synth.json %.pcf | log
$(run-pnr)
for i in $$(seq $(PNR_RETRIES)); do \
if $(run-pnr); then \
exit 0; \
fi \
done; \
exit 1
%.bin: rtl/%.asc
$(ICEPACK) $< $@