summaryrefslogtreecommitdiff
path: root/fpga-toolchain/experiments/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'fpga-toolchain/experiments/Makefile')
-rw-r--r--fpga-toolchain/experiments/Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/fpga-toolchain/experiments/Makefile b/fpga-toolchain/experiments/Makefile
new file mode 100644
index 0000000..4f906f7
--- /dev/null
+++ b/fpga-toolchain/experiments/Makefile
@@ -0,0 +1,26 @@
+# Project setup
+PROJ = blinky
+BUILD = ./build
+DEVICE = 8k
+FOOTPRINT = ct256
+
+# Files
+FILES = top.v
+
+.PHONY: all clean burn
+
+all:
+ # if build folder doesn't exist, create it
+ mkdir -p $(BUILD)
+ # synthesize using Yosys
+ yosys -p "synth_ice40 -top top -blif $(BUILD)/$(PROJ).blif" $(FILES)
+ # Place and route using arachne
+ arachne-pnr -d $(DEVICE) -P $(FOOTPRINT) -o $(BUILD)/$(PROJ).asc -p pinmap.pcf $(BUILD)/$(PROJ).blif
+ # Convert to bitstream using IcePack
+ icepack $(BUILD)/$(PROJ).asc $(BUILD)/$(PROJ).bin
+
+burn:
+ iceprog $(BUILD)/$(PROJ).bin
+
+clean:
+ rm build/*