From 3b2dc433adb168fc94e4fa3076154b6c4bf6c0cd Mon Sep 17 00:00:00 2001 From: uvok Date: Thu, 25 Dec 2025 19:15:33 +0100 Subject: Use variables for device and family --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e566393..516898f 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,12 @@ MAKEFLAGS += --no-builtin-variables PROGRAM ?= led CST ?= tangnano9k.cst FLASH_OPTS ?= +# https://github.com/YosysHQ/apicula/wiki/Nextpnr%E2%80%90Himbaechel-Gowin +# but +# https://github.com/YosysHQ/apicula/wiki/gowin_pack says something different. huh? +DEVICE_NAME ?= GW1NR-LV9QN88PC6/I5 +DEVICE_FAMILY ?= GW1N-9C + # Can't use this for deps: # -E $(PROGRAM).deps # as yosys needs to have -o specified for this to work @@ -59,7 +65,7 @@ clean: # place and route? %.pnr.json: %.json $(CST) nextpnr-himbaechel --json $< --write $@ \ - --device GW1NR-LV9QN88PC6/I5 --vopt family=GW1N-9C \ + --device $(DEVICE_NAME) --vopt family=$(DEVICE_FAMILY) \ --vopt cst=$(CST) \ --placed-svg $*.plc.svg \ --routed-svg $*.rt.svg \ @@ -67,7 +73,7 @@ clean: --sdc clock.sdc \ || \ nextpnr-gowin --json $< --write $@ \ - --device GW1NR-LV9QN88PC6/I5 --family GW1N-9C \ + --device $(DEVICE_NAME) --family $(DEVICE_FAMILY) \ --cst $(CST) \ --placed-svg $*.plc.svg \ --routed-svg $*.rt.svg \ @@ -76,7 +82,7 @@ clean: # pack bitstream %.fs: %.pnr.json - gowin_pack -d GW1N-9C -o $@ $< + gowin_pack -d $(DEVICE_FAMILY) -o $@ $< ## inter-file dependencies -include $(DEPS) -- cgit v1.2.3