summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
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)