Syrostan-MCU/FPGA/makefile

27 lines
581 B
Makefile
Raw Normal View History

2021-08-31 17:40:52 +08:00
# Project setup
PROJ = blinky
BUILD = ./build
DEVICE = 8k
FOOTPRINT = ct256
# Files
FILES = top.v
.PHONY: all clean burn
all:
# if build folder doesn't exist, create it
mkdir -p $(BUILD)
# synthesize using Yosys
yosys -p "synth_ice40 -top top -blif $(BUILD)/$(PROJ).blif" $(FILES)
# Place and route using arachne
arachne-pnr -d $(DEVICE) -P $(FOOTPRINT) -o $(BUILD)/$(PROJ).asc -p pinmap.pcf $(BUILD)/$(PROJ).blif
# Convert to bitstream using IcePack
icepack $(BUILD)/$(PROJ).asc $(BUILD)/$(PROJ).bin
burn:
iceprog $(BUILD)/$(PROJ).bin
clean:
rm build/*