summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 25ae12b6de6e7989fac9f81a765b23ff248b9c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
PROJ = uart
DEVICE = hx1k
PKG = tq144
PCF = pins.pcf

FILES = top.v uart_trx.v

.PHONY: all clean burn

all: $(PROJ).bin

$(PROJ).bin: $(FILES) Makefile
	# synthesize using Yosys
	yosys -p "synth_ice40 -top top -json $(PROJ).json" $(FILES)
	# Place and route using nextpnr
	nextpnr-ice40 --$(DEVICE) --package $(PKG) --pcf $(PCF) --json $(PROJ).json --asc $(PROJ).asc
	# Convert to bitstream using IcePack
	icepack $(PROJ).asc $(PROJ).bin

burn:   $(PROJ).bin
	iceprog $<

clean:
	rm -f *.json *.asc *.bin