-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
53 lines (35 loc) · 830 Bytes
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FPGA_PACKAGE = tq144
FPGA_DEVICE = hx1k
###
PROJ = picohx_demo
TOP = $(PROJ)_top
ICE40_PIN_DEF = ../data/picohx.pcf
SOURCES := \
$(TOP).v \
debouncer.v
VIDEO_SOURCES := $(addprefix video/, \
vga_timing.v \
vga_core.v \
dvi-12bit.v \
)
SOURCES += $(VIDEO_SOURCES)
###
main: $(PROJ).bin
header: $(PROJ).h
count: $(SOURCES)
yosys -p 'synth_ice40 -top $(TOP) -noflatten' $^
%.json: $(SOURCES)
yosys -p 'synth_ice40 -top $(TOP) -json $@' $^
%.asc: $(ICE40_PIN_DEF) %.json
nextpnr-ice40 --package $(FPGA_PACKAGE) --$(FPGA_DEVICE) --json $(filter-out $<,$^) --placer heap --seed 0 --pcf $< --asc $@
%.bin: %.asc
icepack $< $@
%.h: %.bin
xxd -i $^ > $@
###
prog: $(PROJ).bin
../../scripts/picoprog.py $<
clean:
rm -f $(PROJ).bin $(PROJ).asc $(PROJ).json $(PROJ).h
.SECONDARY:
.PHONY: main header clean prog