diff options
Diffstat (limited to 'examples/up5k/Makefile')
-rw-r--r-- | examples/up5k/Makefile | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/up5k/Makefile b/examples/up5k/Makefile new file mode 100644 index 0000000..ea16f06 --- /dev/null +++ b/examples/up5k/Makefile @@ -0,0 +1,36 @@ +PROJ = example +PIN_DEF = up5k.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 |