-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathMakefile
46 lines (35 loc) · 1.22 KB
/
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
## Project F: Animated Shapes - iCEBreaker Makefile
## (C)2023 Will Green, open source hardware released under the MIT License
## Learn more at https://projectf.io/posts/animated-shapes/
# render module version
RENDER_MODS = 160x90
# configuration
SHELL = /bin/sh
FPGA_PKG = sg48
FPGA_TYPE = up5k
PCF = icebreaker.pcf
# included modules
PATH_LIB = ../../../lib
ADD_SRC += ${PATH_LIB}/clock/ice40/clock_480p.sv
ADD_SRC += ${PATH_LIB}/clock/xd.sv
ADD_SRC += ${PATH_LIB}/display/bitmap_addr.sv
ADD_SRC += ${PATH_LIB}/display/clut_simple.sv
ADD_SRC += ${PATH_LIB}/display/display_480p.sv
ADD_SRC += ${PATH_LIB}/display/linebuffer_simple.sv
ADD_SRC += ${PATH_LIB}/graphics/draw_*.sv
ADD_SRC += ${PATH_LIB}/memory/bram_sdp.sv
ADD_SRC += ../${RENDER_MODS}/render_*.sv
demo: demo.rpt demo.bin
demo_sb: demo_sb.rpt demo_sb.bin
%.json: top_%.sv $(ADD_SRC)
yosys -ql $(basename $@)-yosys.log -p 'synth_ice40 -abc9 -device u -top top_$(basename $@) -json $@' $< $(ADD_SRC)
%.asc: %.json
nextpnr-ice40 --${FPGA_TYPE} --package ${FPGA_PKG} --json $< --pcf ${PCF} --asc $@
%.rpt: %.asc
icetime -d ${FPGA_TYPE} -mtr $@ $<
%.bin: %.asc
icepack $< $(subst top_,,$@)
all: demo demo_sb
clean:
rm -f *.json *.asc *.rpt *.bin *yosys.log
.PHONY: all clean