From 5b59c9092092c4e502f6446990650290775283d2 Mon Sep 17 00:00:00 2001 From: uvok Date: Fri, 26 Dec 2025 10:33:45 +0100 Subject: makefile: centralize nextpnr args also, get roid ofPROGRAM variable --- Makefile | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 516898f..9e8bcca 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,11 @@ DEVICE_FAMILY ?= GW1N-9C # as yosys needs to have -o specified for this to work # but I specify the command manually # also, yosys inserts /tmp/ files which makes this useless. -YOSYS_OPTS ?= -Q -q -l $(PROGRAM).yosys.log -e "conflict|is used but has no driver" +YOSYS_OPTS = -Q -q -l $*.yosys.log -e "conflict|is used but has no driver" +NEXTPNR_OPTS = -q -l $*.pnr.log \ + --sdc clock.sdc \ + --placed-svg $*.plc.svg \ + --routed-svg $*.rt.svg DEPS := $(wildcard *.dep) # this is "bad", as it runs the deps target every time @@ -38,7 +42,7 @@ tangnano9k.cst: ## helper targets .PHONY: clean flash show show: $(PROGRAM).v - yosys -p "read_verilog $<; show $(PROGRAM)" + yosys -p "read_verilog $<; prep; show $(PROGRAM)" flash: $(PROGRAM).fs openFPGALoader -b tangnano9k $(FLASH_OPTS) $(PROGRAM).fs @@ -67,18 +71,10 @@ clean: nextpnr-himbaechel --json $< --write $@ \ --device $(DEVICE_NAME) --vopt family=$(DEVICE_FAMILY) \ --vopt cst=$(CST) \ - --placed-svg $*.plc.svg \ - --routed-svg $*.rt.svg \ - -q -l $(PROGRAM).pnr.log \ - --sdc clock.sdc \ || \ nextpnr-gowin --json $< --write $@ \ --device $(DEVICE_NAME) --family $(DEVICE_FAMILY) \ - --cst $(CST) \ - --placed-svg $*.plc.svg \ - --routed-svg $*.rt.svg \ - -q -l $(PROGRAM).pnr.log \ - --sdc clock.sdc + --cst $(CST) # pack bitstream %.fs: %.pnr.json -- cgit v1.2.3