#Auto generated by Edalize

TARGET   := test_icestorm_0
PCF_FILE := pcf_file.pcf
PNR      ?= next
ARACHNE_PNR_OPTIONS := a few arachne_pnr_options
NEXTPNR_OPTIONS     := multiple nextpnr_options
DEVICE   := None

all: $(TARGET).bin
timing: $(TARGET).tim
stats: $(TARGET).stat

.PRECIOUS: %_next.asc %_arachne.asc

%.blif: %.mk
	$(MAKE) -f $<
%_arachne.asc: $(PCF_FILE) %.blif
	arachne-pnr $(ARACHNE_PNR_OPTIONS) -q -p $? -o $@
%.json: %.mk
	$(MAKE) -f $<
%_next.asc: %.json
	nextpnr-ice40 -l next.log -q $(NEXTPNR_OPTIONS) --pcf $(PCF_FILE) --json $? --asc $@
%.bin: %_$(PNR).asc
	icepack $< $@
%.tim: %_$(PNR).asc
	icetime -tmd $(DEVICE) $< > $@
%.stat: %_$(PNR).asc
	icebox_stat $< > $@

build-gui: $(TARGET).json
	nextpnr-ice40 -q $(NEXTPNR_OPTIONS) --pcf $(PCF_FILE) --json $? --asc $@ --gui

clean:
	rm -f $(TARGET).blif $(TARGET).json $(TARGET)_arachne.asc $(TARGET)_next.asc $(TARGET).bin
