summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMartin Stensgård <mastensg@mastensg.net>2025-04-10 19:57:00 +0200
committerMartin Stensgård <mastensg@mastensg.net>2025-04-10 19:57:00 +0200
commite194505a8cbe4f0c199abab40c64131647cb23cd (patch)
treeeb8bb1eb6f401888e4729287993b7a89316f9555 /Makefile
parent5b604a04f9f7e4ab051995794d939e41d40fb8cd (diff)
top
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 23 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1afafb7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,23 @@
+TOP = top
+
+all: check top.bin
+
+check:
+ verilator --lint-only --top $(TOP) top.v
+
+clean:
+ rm -f top.asc top.bin top.json
+
+load: all
+ iceprog top.bin
+
+.PHONY: all check clean load
+
+top.asc: top.json top.pcf
+ nextpnr-ice40 --hx1k --package tq144 --json top.json --pcf top.pcf --asc top.asc --top $(TOP)
+
+top.bin: top.asc
+ icepack top.asc top.bin
+
+top.json: top.v
+ yosys -q -p "synth_ice40 -json top.json -top $(TOP)" top.v