123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- all: $(PROJ).rpt $(PROJ).bin
- %.blif: %.v $(ADD_SRC) $(ADD_DEPS)
- yosys -ql $*.log -p 'synth_ice40 -top top -blif $@' $< $(ADD_SRC)
- %.json: %.v $(ADD_SRC) $(ADD_DEPS)
- yosys -ql $*.log -p 'synth_ice40 -top top -json $@' $< $(ADD_SRC)
- ifeq ($(USE_ARACHNEPNR),)
- %.asc: $(PIN_DEF) %.json
- nextpnr-ice40 --$(DEVICE) --json $(filter-out $<,$^) --pcf $< --asc $@
- else
- %.asc: $(PIN_DEF) %.blif
- arachne-pnr -d $(subst up,,$(subst hx,,$(subst lp,,$(DEVICE)))) -o $@ -p $^
- endif
- %.bin: %.asc
- icepack $< $@
- %.rpt: %.asc
- icetime -d $(DEVICE) -mtr $@ $<
- %_tb: %_tb.v %.v
- iverilog -o $@ $^
- %_tb.vcd: %_tb
- vvp -N $< +vcd=$@
- %_syn.v: %.blif
- yosys -p 'read_blif -wideports $^; write_verilog $@'
- %_syntb: %_tb.v %_syn.v
- iverilog -o $@ $^ `yosys-config --datdir/ice40/cells_sim.v`
- %_syntb.vcd: %_syntb
- vvp -N $< +vcd=$@
- 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 $(PROJ).json $(PROJ).log $(ADD_CLEAN)
- .SECONDARY:
- .PHONY: all prog clean
|