summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 92258598b4248bc6b09b1dd8ef71e3d964602ca9 (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
25
26
27
28
29
30
31
32
33
34
PROJ = uart
DEVICE = hx1k
PKG = tq144
PCF = pins.pcf

FILES = top.v uart_tx_8n1.v

.PHONY: all clean burn

all: $(PROJ).bin

%.json: $(FILES)
	# Lint to catch typos
#	verilator --lint-only -Wall $(FILES)
	# synthesize using Yosys
	yosys -ql yosys.log -p "synth_ice40  -top top -json $(PROJ).json" $(FILES)

%.asc: %.json
	# Place and route using nextpnr
	nextpnr-ice40 --$(DEVICE) --package $(PKG) --pcf $(PCF) --json $< --asc $@

%.rpt: %.asc
	# Timing
	icetime -d $(DEVICE) -mtr $@ $<

%.bin: %.asc
	# Convert to bitstream using IcePack
	icepack $< $@

burn:   $(PROJ).bin
	iceprog $<

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