summaryrefslogtreecommitdiffstats
path: root/blinky/Makefile
blob: 0345112334335f2691a83464a90ef5e9ed335bab (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
# Project setup
PROJ      = blinky
DEVICE    = 8k

FILES = blinky.v

.PHONY: blinky clean burn sim

blinky:
	# synthesize using Yosys
	yosys -p "synth_ice40 -top blinky -json $(PROJ).json" $(FILES)
	# Place and route using nextpnr
	nextpnr-ice40 -r --hx8k --json $(PROJ).json --package cb132 --asc $(PROJ).asc --opt-timing --pcf iceFUN.pcf

	# Convert to bitstream using IcePack
	icepack $(PROJ).asc $(PROJ).bin

burn:
	iceFUNprog $(PROJ).bin

sim:
	iverilog -o blinky_tb blinky_tb.v blinky.v
	vvp blinky_tb 
	gtkwave blinky_tb.vcd

clean:
	rm -f *.asc *.bin *blif *.vcd $(PROG).json $(PROJ)_tb