-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (24 loc) · 910 Bytes
/
Makefile
File metadata and controls
33 lines (24 loc) · 910 Bytes
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
PROJ ?= fireflies
DEVICE = hx1k
PACKAGE = tq144
all: $(PROJ).bin
$(PROJ).json: $(PROJ).v
yosys -p "synth_ice40 -top $(PROJ) -json $@" $<
$(PROJ).asc: $(PROJ).json icestick.pcf
nextpnr-ice40 --$(DEVICE) --package $(PACKAGE) --pcf icestick.pcf --json $< --asc $@ --freq 12
$(PROJ).bin: $(PROJ).asc
icepack $< $@
timing: $(PROJ).asc
icetime -d $(DEVICE) -mtr $(PROJ).rpt $<
prog: $(PROJ).bin
iceprog $<
sim: sim/sb_ram40_4k.v sim/tb_fireflies.cpp fireflies.v
verilator --cc --exe --build -Wall -Wno-UNUSED -Wno-UNDRIVEN -Wno-DECLFILENAME -Wno-WIDTH \
--public-flat-rw --top-module fireflies -o sim_fireflies \
sim/sb_ram40_4k.v fireflies.v sim/tb_fireflies.cpp -MAKEFLAGS -j4
./obj_dir/sim_fireflies
clean:
rm -f fireflies.json fireflies.asc fireflies.bin fireflies.rpt \
musicbox.json musicbox.asc musicbox.bin musicbox.rpt
rm -rf obj_dir
.PHONY: all timing prog sim clean