-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (40 loc) · 1.1 KB
/
Makefile
File metadata and controls
54 lines (40 loc) · 1.1 KB
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
VERILATOR_ARGS = --binary --trace-fst --trace-structs
RTL_FILES = ./rtl/tiny_nn_pkg.sv \
./rtl/fp_add.sv \
./rtl/fp_mul.sv \
./rtl/fp_cmp.sv \
./rtl/tiny_nn_core.sv \
./rtl/tiny_nn_top.sv \
TOP_DV_FILES = ./dv/tiny_nn_top_tb.sv
FP_ADD_DV_FILES = ./dv/fp_op_tester.sv \
./dv/fp_add_tb.sv
FP_MUL_DV_FILES = ./dv/fp_op_tester.sv \
./dv/fp_mul_tb.sv
SV2V_OUT = ./sv2v_out/tiny_nn.v
top_dv: $(RTL_FILES) $(TOP_DV_FILES)
verilator $(VERILATOR_ARGS) \
--top-module tiny_nn_top_tb \
$?
fp_add_dv: $(RTL_FILES) $(FP_ADD_DV_FILES)
verilator $(VERILATOR_ARGS) \
--top-module fp_add_tb \
$?
fp_mul_dv: $(RTL_FILES) $(FP_MUL_DV_FILES)
verilator $(VERILATOR_ARGS) \
--top-module fp_mul_tb \
$?
top_dv_sv2v: $(SV2V_OUT) $(TOP_DV_FILES)
verilator $(VERILATOR_ARGS) \
-Wno-fatal \
--top-module tiny_nn_top_tb \
-o Vtiny_nn_top_tb_sv2v \
$?
$(SV2V_OUT): $(RTL_FILES)
mkdir -p $(dir $(SV2V_OUT))
sv2v $? > $(SV2V_OUT)
sv2v: $(SV2V_OUT)
clean:
rm -rf ./obj_dir
rm -f $(SV2V_OUT)
all: top_dv fp_add_dv fp_mul_dv sv2v top_dv_sv2v
.PHONY: top_dv fp_add_dv fp_mul_dv sv2v top_dv_sv2v all clean