aboutsummaryrefslogtreecommitdiffstats
path: root/icezum/pushbutton/Makefile
blob: d483e9ac563eac49fb8fed5149aad9c9869d5b14 (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
PROJ = pushbutton
PIN_DEF = $(PROJ).pcf
DEVICE = hx1k

all: $(PROJ).rpt $(PROJ).bin

%.blif: %.vhdl
	ghdl -a $(PROJ).vhdl
	yosys -m ../../ghdl.so -p 'ghdl $(PROJ); synth_ice40 -blif $@'


%.asc: $(PIN_DEF) %.blif
	arachne-pnr -d $(subst hx,,$(subst lp,,$(DEVICE))) -o $@ -p $^

%.bin: %.asc
	icepack $< $@

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

prog: $(PROJ).bin
	iceprog $<

sudo-prog: $(PROJ).bin
	@echo 'Executing prog as root!!!'
	sudo iceprog $<

clean:
	rm -f $(PROJ).blif $(PROJ).asc $(PROJ).rpt $(PROJ).bin work-obj93.cf

.SECONDARY:
.PHONY: all prog clean