Skip to content
Snippets Groups Projects
Makefile 705 B
Newer Older
Leo's avatar
Leo committed
filename = top
pcf_file = io.pcf


build:
	yosys -qp "synth_ice40 -json $(filename).json" $(filename).v
	nextpnr-ice40 -q\
Leo's avatar
Leo committed
		-l pnr.log \
Leo's avatar
Leo committed
		--up5k \
		--package sg48 \
		--json $(filename).json \
		--pcf $(pcf_file) \
		--asc $(filename).asc
	icepack $(filename).asc $(filename).bin
Leo's avatar
Leo committed
#	head -n -434 pnr.log | tail -18
Leo's avatar
Leo committed
#prog: #for sram
	#iceprog -S $(filename).bin

#prog_flash:
#	@if [ -d '$(ICELINK_DIR)' ]; \
#        then \
#            cp $(filename).bin $(ICELINK_DIR); \
#        else \
#            echo "iCELink not found"; \
#            exit 1; \
#    fi

flash: build
	~/projects/icesugar/tools/icesprog.x64.linux $(filename).bin

clean:
	rm -rf $(filename).blif $(filename).asc $(filename).bin