-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (35 loc) · 1.44 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
47
48
49
50
51
52
53
54
# ======================================================= #
# Bitstream path
FS = build/e4tham_tangnano_example_1.0.0/tangnano-apicula/e4tham_tangnano_example_1.0.0.fs
# VVP Dump
DUMP = build/e4tham_tangnano_example_1.0.0/sim-icarus/dump.fst
# ======================================================= #
# API
.PHONY: load tangnano sim view init clean
# ======================================================= #
# Synth targets
load: fusesoc.conf ${FS}
sudo openFPGALoader -m -b tangnano ${FS}
tangnano: fusesoc.conf ${FS}
# ======================================================= #
# Sim targets
sim: fusesoc.conf
fusesoc run --target sim e4tham:tangnano:example
view: fusesoc.conf ${DUMP}
gtkwave ${DUMP} > /dev/null 2>&1 &
lint: $(shell find tangnano -type f) fusesoc.conf $(shell find rtl -type f) adder.core
fusesoc run --target lint e4tham:tangnano:example
# ======================================================= #
# Misc targets
init: fusesoc.conf
clean:
rm -rf build fusesoc.conf
# ======================================================= #
# Files
fusesoc.conf:
fusesoc library add adder . --sync-type=local
${FS}: $(shell find tangnano -type f) fusesoc.conf $(shell find rtl -type f) adder.core
fusesoc run --target tangnano e4tham:tangnano:example
${DUMP}: $(shell find sim -type f) fusesoc.conf $(shell find rtl -type f) adder.core
fusesoc run --target sim e4tham:tangnano:example
# ======================================================= #