aboutsummaryrefslogtreecommitdiffstats
path: root/icezum/counter-8bits/Makefile
diff options
context:
space:
mode:
authorobijuan <juan@iearobotics.com>2017-02-16 20:03:03 +0100
committerobijuan <juan@iearobotics.com>2017-02-16 20:03:03 +0100
commitbedecee054b7dc8db5a1dfa265696665f4270c67 (patch)
tree0bb239f5913d4623406e7d3f6bc85ed59f980529 /icezum/counter-8bits/Makefile
parent6e6b67b9ea316b64c22027082b160c41b26a7ac5 (diff)
downloadghdl-yosys-plugin-bedecee054b7dc8db5a1dfa265696665f4270c67.tar.gz
ghdl-yosys-plugin-bedecee054b7dc8db5a1dfa265696665f4270c67.tar.bz2
ghdl-yosys-plugin-bedecee054b7dc8db5a1dfa265696665f4270c67.zip
Icezum Alhambra board example: 8-bit counter displayed on leds
Diffstat (limited to 'icezum/counter-8bits/Makefile')
-rw-r--r--icezum/counter-8bits/Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/icezum/counter-8bits/Makefile b/icezum/counter-8bits/Makefile
new file mode 100644
index 0000000..c618b42
--- /dev/null
+++ b/icezum/counter-8bits/Makefile
@@ -0,0 +1,32 @@
+PROJ = counter8
+PIN_DEF = counter8.pcf
+DEVICE = hx1k
+
+all: $(PROJ).rpt $(PROJ).bin
+
+%.blif: %.vhdl
+ ghdl -a $(PROJ).vhdl
+ yosys -m ../../ghdl.so -p 'ghdl $(PROJ); synth_ice40 -blif $@'
+
+
+%.asc: $(PIN_DEF) %.blif
+ arachne-pnr -d $(subst hx,,$(subst lp,,$(DEVICE))) -o $@ -p $^
+
+%.bin: %.asc
+ icepack $< $@
+
+%.rpt: %.asc
+ icetime -d $(DEVICE) -mtr $@ $<
+
+prog: $(PROJ).bin
+ iceprog $<
+
+sudo-prog: $(PROJ).bin
+ @echo 'Executing prog as root!!!'
+ sudo iceprog $<
+
+clean:
+ rm -f $(PROJ).blif $(PROJ).asc $(PROJ).rpt $(PROJ).bin work-obj93.cf
+
+.SECONDARY:
+.PHONY: all prog clean