-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
148 lines (109 loc) · 6.54 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#Makefile for UVM Testbench - Lab 10
# SIMULATOR = Questa for Mentor's Questasim
# SIMULATOR = VCS for Synopsys's VCS
SIMULATOR = VCS
FSDB_PATH=/home/cad/eda/SYNOPSYS/VERDI_2022/verdi/T-2022.06-SP1/share/PLI/VCS/LINUX64
RTL= ../rtl/*
work= work #library name
SVTB1= ../tb/top.sv
INC = +incdir+../tb +incdir+../test +incdir+../src_agt_top +incdir+../dst_agt_top
SVTB2 = ../test/router_pkg.sv
VSIMOPT= -vopt -voptargs=+acc
VSIMCOV= -coverage -sva
VSIMBATCH1= -c -do " log -r /* ;coverage save -onexit mem_cov1;run -all; exit"
VSIMBATCH2= -c -do " log -r /* ;coverage save -onexit mem_cov2;run -all; exit"
VSIMBATCH3= -c -do " log -r /* ;coverage save -onexit mem_cov3;run -all; exit"
VSIMBATCH4= -c -do " log -r /* ;coverage save -onexit mem_cov4;run -all; exit"
help:
@echo =============================================================================================================
@echo "! USAGE -- make target !"
@echo "! clean => clean the earlier log and intermediate files. !"
@echo "! sv_cmp => Create library and compile the code. !"
@echo "! run_test => clean, compile & run the simulation for ram_signle_adddr_test in batch mode. !"
@echo "! run_test1 => clean, compile & run the simulation for ram_ten_addr_test in batch mode. !"
@echo "! run_test2 => clean, compile & run the simulation for ram_odd_addr_test in batch mode. !"
@echo "! run_test3 => clean, compile & run the simulation for ram_even_addr_test in batch mode. !"
@echo "! view_wave1 => To view the waveform of ram_signle_addr_test !"
@echo "! view_wave2 => To view the waveform of ram_ten_addr_test !"
@echo "! view_wave3 => To view the waveform of ram_odd_addr_test !"
@echo "! view_wave4 => To view the waveform of ram_even_addr_test !"
@echo "! regress => clean, compile and run all testcases in batch mode. !"
@echo "! report => To merge coverage reports for all testcases and convert to html format. !"
@echo "! cov => To open merged coverage report in html format. !"
@echo ====================================================================================================================
clean : clean_$(SIMULATOR)
sv_cmp : sv_cmp_$(SIMULATOR)
run_test : run_test_$(SIMULATOR)
run_test1 : run_test1_$(SIMULATOR)
run_test2 : run_test2_$(SIMULATOR)
run_test3 : run_test3_$(SIMULATOR)
view_wave1 : view_wave1_$(SIMULATOR)
view_wave2 : view_wave2_$(SIMULATOR)
view_wave3 : view_wave3_$(SIMULATOR)
view_wave4 : view_wave4_$(SIMULATOR)
regress : regress_$(SIMULATOR)
report : report_$(SIMULATOR)
cov : cov_$(SIMULATOR)
# ----------------------------- Start of Definitions for Mentor's Questa Specific Targets -------------------------------#
sv_cmp_Questa:
vlib $(work)
vmap work $(work)
vlog -work $(work) $(RTL) $(INC) $(SVTB2) $(SVTB1)
run_test_Questa: sv_cmp
vsim -cvgperinstance $(VSIMOPT) $(VSIMCOV) $(VSIMBATCH1) -wlf wave_file1.wlf -l test1.log -sv_seed random work.top +UVM_TESTNAME=router_test
vcover report -cvg -details -nocompactcrossbins -codeAll -assert -directive -html mem_cov1
run_test1_Questa:
vsim -cvgperinstance $(VSIMOPT) $(VSIMCOV) $(VSIMBATCH2) -wlf wave_file2.wlf -l test2.log -sv_seed random work.top +UVM_TESTNAME=router_small_pkt_test
vcover report -cvg -details -nocompactcrossbins -codeAll -assert -directive -html mem_cov2
run_test2_Questa:
vsim -cvgperinstance $(VSIMOPT) $(VSIMCOV) $(VSIMBATCH3) -wlf wave_file3.wlf -l test3.log -sv_seed random work.top +UVM_TESTNAME=router_medium_pkt_test
vcover report -cvg -details -nocompactcrossbins -codeAll -assert -directive -html mem_cov3
run_test3_Questa:
vsim -cvgperinstance $(VSIMOPT) $(VSIMCOV) $(VSIMBATCH4) -wlf wave_file4.wlf -l test4.log -sv_seed random work.top +UVM_TESTNAME=router_large_pkt_test
vcover report -cvg -details -nocompactcrossbins -codeAll -assert -directive -html mem_cov4
view_wave1_Questa:
vsim -view wave_file1.wlf
view_wave2_Questa:
vsim -view wave_file2.wlf
view_wave3_Questa:
vsim -view wave_file3.wlf
view_wave4_Questa:
vsim -view wave_file4.wlf
report_Questa:
vcover merge mem_cov mem_cov1 mem_cov2 mem_cov3 mem_cov4
vcover report -cvg -details -nocompactcrossbins -codeAll -assert -directive -html mem_cov
regress_Questa: clean_Questa run_test_Questa run_test1_Questa run_test2_Questa run_test3_Questa report_Questa cov_Questa
cov_Questa:
firefox covhtmlreport/index.html&
clean_Questa:
rm -rf transcript* *log* fcover* covhtml* mem_cov* *.wlf modelsim.ini work
clear
# ----------------------------- End of Definitions for Mentor's Questa Specific Targets -------------------------------#
# ----------------------------- Start of Definitions for Synopsys's VCS Specific Targets -------------------------------#
sv_cmp_VCS:
vcs -l vcs.log -timescale=1ns/1ps -sverilog -ntb_opts uvm -debug_access+all -full64 -kdb -lca -P $(FSDB_PATH)/novas.tab $(FSDB_PATH)/pli.a $(RTL) $(INC) $(SVTB2) $(SVTB1)
run_test_VCS: clean sv_cmp_VCS
./simv -a vcs.log +fsdbfile+wave1.fsdb -cm_dir ./mem_cov1 +ntb_random_seed_automatic +UVM_TESTNAME=router_test urg -dir mem_cov1.vdb -format both -report urgReport1
run_test1_VCS: sv_cmp_VCS
./simv -a vcs.log +fsdbfile+wave2.fsdb -cm_dir ./mem_cov2 +ntb_random_seed_automatic +UVM_TESTNAME=router_small_pkt_test urg -dir mem_cov2.vdb -format both -report urgReport2
run_test2_VCS: sv_cmp_VCS
./simv -a vcs.log +fsdbfile+wave3.fsdb -cm_dir ./mem_cov3 +ntb_random_seed_automatic +UVM_TESTNAME=router_medium_pkt_test urg -dir mem_cov3.vdb -format both -report urgReport3
run_test3_VCS: sv_cmp_VCS
./simv -a vcs.log +fsdbfile+wave4.fsdb -cm_dir ./mem_cov4 +ntb_random_seed_automatic +UVM_TESTNAME=router_large_pkt_test urg -dir mem_cov4.vdb -format both -report urgReport4
view_wave1_VCS:
verdi -ssf wave1.fsdb
view_wave2_VCS:
verdi -ssf wave2.fsdb
view_wave3_VCS:
verdi -ssf wave3.fsdb
view_wave4_VCS:
verdi -ssf wave4.fsdb
report_VCS:
urg -dir mem_cov1.vdb mem_cov2.vdb mem_cov3.vdb mem_cov4.vdb -dbname merged_dir/merged_test -format both -report urgReport
regress_VCS: clean_VCS sv_cmp_VCS run_test_VCS run_test1_VCS run_test2_VCS run_test3_VCS report_VCS
cov_VCS:
verdi -cov -covdir merged_dir.vdb
clean_VCS:
rm -rf simv* csrc* *.tmp *.vpd *.vdb *.key *.log *hdrs.h urgReport* *.fsdb novas* verdi*
clear
# ----------------------------- END of Definitions for Synopsys's VCS Specific Targets -------------------------------#