-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (45 loc) · 990 Bytes
/
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
55
56
57
.PHONY: all sim build clean
all: build sim
NUM_TESTS := 10000
TOLERATE_BITS := 3
RAND_CONS := 61
FPU_SRC := duv/pfpu32_top.v
clean:
rm -fr work
SV_TARGET := $(FPU_SRC) tb/defs.sv tb/bfm.sv tb/top.sv
top_module := test
ucdb_file := coverage.ucdb
cover_repo := coverage.report
do_command := coverage save -onexit $(ucdb_file) ; run -all ; q
vlog_args := \
-lint \
-suppress 8604 \
-warning error
vsim_args := \
-do "$(do_command)" \
+NUM_TESTS=$(NUM_TESTS) \
+TOLERATE_BITS=$(TOLERATE_BITS) \
+RAND_CONS=$(RAND_CONS) \
-suppress 8604 \
-suppress 8630
ifdef TEST_PRINT
vsim_args += +TEST_PRINT
endif
ifeq ($(BUG), 1)
vlog_args += +define+BUG_ADDSUB
else
ifeq ($(BUG), 2)
vlog_args += +define+BUG_MULDIV
else
ifeq ($(BUG), 3)
vlog_args += +define+BUG_ADDSUB +define+BUG_MULDIV
endif
endif
endif
build:
vlog $(vlog_args) $(SV_TARGET)
sim: simulate cover
simulate:
vsim -c work.$(top_module) $(vsim_args)
cover:
vcover report -verbose $(ucdb_file) > $(cover_repo)