[examples] Made the example Makefiles easier to reuse.

This commit is contained in:
Piotr Esden-Tempski 2015-12-28 16:53:48 +01:00
parent 7852514c2c
commit de33788bf9
2 changed files with 26 additions and 18 deletions

View File

@ -1,18 +1,22 @@
all: example.bin
PROJ = example
PIN_DEF = hx8kboard.pcf
DEVICE = 8k
example.blif: example.v
yosys -p 'synth_ice40 -top top -blif example.blif' example.v
all: $(PROJ).bin
example.txt: example.blif hx8kboard.pcf
arachne-pnr -d 8k -o example.txt -p hx8kboard.pcf example.blif
%.blif: %.v
yosys -p 'synth_ice40 -top top -blif $@' $<
example.bin: example.txt
icepack example.txt example.bin
%.txt: $(PIN_DEF) %.blif
arachne-pnr -d $(DEVICE) -o $@ -p $^
%.bin: %.txt
icepack $< $@
prog:
iceprog example.bin
iceprog $(PROJ).bin
clean:
rm -f example.blif example.txt example.bin
rm -f *.blif *.txt *.bin
.PHONY: all prog clean

View File

@ -1,18 +1,22 @@
all: example.bin
PROJ = example
PIN_DEF = icestick.pcf
DEVICE = 1k
example.blif: example.v
yosys -p 'synth_ice40 -top top -blif example.blif' example.v
all: $(PROJ).bin
example.txt: example.blif icestick.pcf
arachne-pnr -d 1k -o example.txt -p icestick.pcf example.blif
%.blif: %.v
yosys -p 'synth_ice40 -top top -blif $@' $<
example.bin: example.txt
icepack example.txt example.bin
%.txt: $(PIN_DEF) %.blif
arachne-pnr -d $(DEVICE) -o $@ -p $^
%.bin: %.txt
icepack $< $@
prog:
iceprog example.bin
iceprog $(PROJ).bin
clean:
rm -f example.blif example.txt example.bin
rm -f *.blif *.txt *.bin
.PHONY: all prog clean