-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (38 loc) · 1.09 KB
/
Makefile
File metadata and controls
48 lines (38 loc) · 1.09 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
# CLI params to pass to verilator
SYNTHESIS :=0
GLITCH_MONITOR :=0
METASTABILITY_PROBABILITY :=100
GLOBAL_METASTABILITY_ENABLE :=0
METASTABILITY_HIERARCHY_TOGGLE :=TOP.*
SV_RNG_SEED := 883
TOP_TB := fsm_tb
TIMESCALE:=--timescale 1ns/1ps
SOURCES := $(wildcard src/*.sv)
PLUSARGS :=\
+metastability_probability=$(METASTABILITY_PROBABILITY)\
+global_metastability_enable=$(GLOBAL_METASTABILITY_ENABLE)\
+metastability_hierarchy_toggle=$(METASTABILITY_HIERARCHY_TOGGLE)\
VERILATOR_FLAGS :=\
--trace\
--assert\
--trace-structs\
--Wno-fatal\
-j 0\
$(TIMESCALE)\
OPT_FLAGS :=\
--assert\
--Wno-fatal\
-j 0\
$(TIMESCALE)\
-O3\
-GSYNTHESIS=$(SYNTHESIS)\
-GENABLE_GLITCH_MONITOR=$(GLITCH_MONITOR)
run_sim: testbench
./obj_dir/V$(TOP_TB) +verilator+seed+$(SV_RNG_SEED) $(PLUSARGS)
testbench:
verilator --binary $(VERILATOR_FLAGS) $(SOURCES) tb/$(TOP_TB).sv --top-module $(TOP_TB)
benchmark:
verilator --binary $(OPT_FLAGS) $(SOURCES) tb/$(TOP_TB).sv --top-module $(TOP_TB)
time ./obj_dir/V$(TOP_TB) +verilator+seed+$(SV_RNG_SEED) $(PLUSARGS)
clean:
rm -rf ./obj_dir waves.vcd