From 17638d5cbd8969befb7e9b03d4806d95ab22e70d Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Thu, 23 Nov 2023 23:26:13 +0000 Subject: [PATCH] Build system: Slight improvements, randomised nextpnr rng seed and printed it to the terminal. In case timing fails running it a bunch of times can yield one value that passes. --- system/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/system/Makefile b/system/Makefile index 82ad640..495b679 100644 --- a/system/Makefile +++ b/system/Makefile @@ -79,10 +79,14 @@ synth_ecp5.json: ${SOURCES} ${TOP_LEVEL_SOURCE} fpga_config/${FPGA_BOARD}/fpga_t ${QUIET_YOSYS} ${Q} yosys -q -D BUILTIN_RAM=2048 -D NOT_FULL -p 'read -sv '"${SOURCES} ${TOP_LEVEL_SOURCE} fpga_config/${FPGA_BOARD}/fpga_top.v ${EXTRA_SYNTHESIS_SOURCES} ; synth_ecp5 -json $@ -abc9 -top fpga_top" +RANDOM :::= $(shell seq 1 200|sort -R|head -n1) + synth_ecp5_out.config:synth_ecp5.json ${QUIET_NEXTPNR} - ${Q} nextpnr-ecp5 --Werror -q --json $< --textcfg $@ ${NEXTPNR_ECP5_DEV} --package ${ECP5_PACKAGE} --lpf fpga_config/${FPGA_BOARD}/pin_constraint.pcf --report=synth_pnr_report.json + ${Q}printf '\e[1;30mNotice: nextpnr rng seed is : %s\e[0m\n' "${RANDOM}" + ${Q} nextpnr-ecp5 --seed ${RANDOM} --Werror -q --json $< --textcfg $@.1 ${NEXTPNR_ECP5_DEV} --package ${ECP5_PACKAGE} --lpf fpga_config/${FPGA_BOARD}/pin_constraint.pcf --report=synth_pnr_report.json ${Q}../tools/parse_nextpnr_stats.sh --brief synth_pnr_report.json + ${Q}mv "$@.1" "$@" synth_ecp5.bit:synth_ecp5_out.config ${QUIET_ECPPACK} @@ -99,6 +103,9 @@ upload_orangecrab:synth_ecp5.dfu ${QUIET_DFU_UTIL} ${Q}stdbuf -o0 dfu-util --download "$<" |stdbuf -o0 tr '\n' '\a' | stdbuf -o0 tr '\r' '\n' | grep Download --line-buffered | stdbuf -o0 tr '\n' '\r' |stdbuf -o0 tr '\a' '\n' +nextpnr-gui: synth_ecp5.json + ${Q} nextpnr-ecp5 --json $< ${NEXTPNR_ECP5_DEV} --package ${ECP5_PACKAGE} --lpf fpga_config/${FPGA_BOARD}/pin_constraint.pcf --gui + upload: upload_orangecrab .PHONY: clean