aboutsummaryrefslogtreecommitdiffstats
path: root/examples/up5k_rgb/Makefile
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2017-11-17 11:27:40 +0000
committerDavid Shah <davey1576@gmail.com>2017-11-17 15:09:58 +0000
commitc71db50a27600885ea4e84d9744a4a4417af02c6 (patch)
tree8304c84ecc3c1f704a5813bbc25c86d1a5310415 /examples/up5k_rgb/Makefile
parente7d22f22777227df18ff9c34e3b663aef04a075b (diff)
downloadicestorm-c71db50a27600885ea4e84d9744a4a4417af02c6.tar.gz
icestorm-c71db50a27600885ea4e84d9744a4a4417af02c6.tar.bz2
icestorm-c71db50a27600885ea4e84d9744a4a4417af02c6.zip
Add UltraPlus LED driver support and demo
Diffstat (limited to 'examples/up5k_rgb/Makefile')
-rw-r--r--examples/up5k_rgb/Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/up5k_rgb/Makefile b/examples/up5k_rgb/Makefile
new file mode 100644
index 0000000..711ce5a
--- /dev/null
+++ b/examples/up5k_rgb/Makefile
@@ -0,0 +1,36 @@
+PROJ = rgb
+PIN_DEF = rgb.pcf
+DEVICE = up5k
+# Relative paths for easier development without messing with installed version
+ARACHNE = ../../../arachne-pnr/bin/arachne-pnr
+ARACHNE_ARGS = -c ../../icebox/chipdb-5k.txt
+ICEPACK = ../../icepack/icepack
+ICETIME = ../../icetime/icetime
+ICEPROG = ../../iceprog/iceprog
+
+all: $(PROJ).bin
+
+%.blif: %.v
+ yosys -p 'synth_ice40 -top top -blif $@' $<
+
+%.asc: $(PIN_DEF) %.blif
+ $(ARACHNE) $(ARACHNE_ARGS) -d $(subst up,,$(subst hx,,$(subst lp,,$(DEVICE)))) -o $@ -p $^
+
+%.bin: %.asc
+ $(ICEPACK) $< $@
+
+%.rpt: %.asc
+ $(ICETIME) -d $(DEVICE) -mtr $@ $<
+
+prog: $(PROJ).bin
+ $(ICEPROG) -S $<
+
+sudo-prog: $(PROJ).bin
+ @echo 'Executing prog as root!!!'
+ sudo $(ICEPROG) -S $<
+
+clean:
+ rm -f $(PROJ).blif $(PROJ).asc $(PROJ).rpt $(PROJ).bin
+
+.SECONDARY:
+.PHONY: all prog clean