forked from projf/projf-explore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 1.07 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
## Project F: Life on Screen - iCEBreaker Makefile
## (C)2021 Will Green, open source hardware released under the MIT License
## Learn more at https://projectf.io
# configuration
SHELL = /bin/sh
FPGA_PKG = sg48
FPGA_TYPE = up5k
PCF = icebreaker.pcf
# included modules
PATH_LIB = ../../../lib
ADD_SRC = ${PATH_LIB}/clock/xd.sv
ADD_SRC += ${PATH_LIB}/clock/ice40/clock_gen_480p.sv
ADD_SRC += ${PATH_LIB}/display/display_timings_480p.sv
ADD_SRC += ${PATH_LIB}/display/framebuffer.sv
ADD_SRC += ${PATH_LIB}/display/linebuffer.sv
ADD_SRC += ${PATH_LIB}/memory/rom_async.sv
ADD_SRC += ${PATH_LIB}/memory/ice40/bram_sdp.sv
ADD_SRC += ../life.sv
top_life: top_life.rpt top_life.bin
%.json: %.sv $(ADD_SRC)
yosys -ql $(subst .json,,$@)-yosys.log -p 'synth_ice40 -abc2 -top $(subst .json,,$@) -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 $< $@
clean:
rm -f top*.json top*.asc top*.rpt top*.bin top*yosys.log
all: top_life
.PHONY: all clean