1 # Makefile for UVM Lab4
2 rtl_path = ../../rtl
3 test = test_base
4 DUT = $(rtl_path)/router.sv $(rtl_path)/router_io.sv $(rtl_path)/ral/host_io.sv
5 HARNESS_TOP = $(rtl_path)/router_test_top.sv
6 TB_TOP = ./test.sv
7 UVM_HOME = ../../uvm-1.1a
8 verbosity = UVM_MEDIUM
9 uvm_ver = uvm-1.1
10 seed = 1
11 defines = UVM_NO_DEPRECATED+UVM_OBJECT_MUST_HAVE_CONSTRUCTOR
12 plus =
13 option = UVM_TR_RECORD +UVM_LOG_RECORD #UVM_TR_RECORD enables UVM transaction recording; UVM_LOG_RECORD enables UVM log message recording;
14 SOLVER = 2
15 tcl = packet.tcl
16
17 all: simv run
18
19 simv compile: *.sv $(DUT) $(HARNESS_TOP) $(TB_TOP)
20 vcs -sverilog -ntb_opts ${uvm_ver} -timescale="1ns/100ps" -l comp.log -debug_all +vcs+vcdpluson $(DUT) $(HARNESS_TOP) $(TB_TOP) +define+${defines}
21
22 run:
23 ./simv -l simv.log +ntb_random_seed=$(seed) +UVM_TESTNAME=$(test) +ntb_solver_mode=$(SOLVER) +UVM_VERBOSITY=$(verbosity) +${plus} +${option}
24
25 uvm1.1a: uvm_compile run
26
27 uvm_compile: *.sv
28 vcs -sverilog ${UVM_HOME}/src/dpi/uvm_dpi.cc -CFLAGS -DVCS ${UVM_HOME}/src/uvm_pkg.sv +incdir+${UVM_HOME}/src+${VCS_HOME}/etc/uvm-1.1/vcs ${VCS_HOME}/etc/uvm-1.1/vcs/uvm_custom_install_vcs_recorder.sv -timescale="1ns/100ps" -l comp.log -debug_all +vcs+vcdpluson $(DUT) $(HARNESS_TOP) $(TB_TOP) +define+${defines}
29
30 random: simv
31 ./simv -l simv.log +ntb_random_seed_automatic +UVM_TESTNAME=$(test) +ntb_solver_mode=$(SOLVER) +UVM_VERBOSITY=$(verbosity) +${plus} +${option}
32
33 dve:
34 dve -vpd vcdplus.vpd -session $(tcl)&
35
36 dve_i: simv
37 ./simv -l simv.log -gui +ntb_random_seed=$(seed) +UVM_TESTNAME=$(test)
38
39 dve_tr:
40 dve -vpd vcdplus.vpd &
41
42 solution: nuke
43 cp ../../solutions/lab4/*.sv .
44 cp ../../solutions/lab4/packet.tcl .
45
46 original: copy
47
48 copy: clean
49 cp ../../solutions/lab3/*.sv .
50 cp ../../solutions/lab4/driver.sv.orig driver.sv
51 cp ../../solutions/lab4/test_collection.sv.orig test_collection.sv
52 cp ../../solutions/lab4/reset_sequence.sv.orig reset_sequence.sv
53 cp ../../solutions/lab4/input_agent.sv .
54 cp ../../solutions/lab4/reset_agent.sv .
55 cp ../../solutions/lab4/packet.tcl .
56
57 mycopy: nuke
58 cp ../lab3/*.sv .
59 cp ../../solutions/lab4/driver.sv.orig driver.sv
60 cp ../../solutions/lab4/test_collection.sv.orig test_collection.sv
61 cp ../../solutions/lab4/reset_sequence.sv.orig reset_sequence.sv
62 cp ../../solutions/lab4/input_agent.sv .
63 cp ../../solutions/lab4/reset_agent.sv .
64 cp ../../solutions/lab4/packet.tcl .
65
66 clean:
67 rm -rf simv* csrc* *.tmp *.vpd *.key log *.h temp *.log .vcs* *.txt DVE* *~
68
69 nuke: clean
70 rm -rf *.sv *.tcl
71
72 help:
73 @echo =======================================================================
74 @echo " "
75 @echo " USAGE: make target <seed=xxx> <verbosity=YYY> <test=ZZZ> "
76 @echo " "
77 @echo " xxx is the random seed. Can be any integer except 0. Defaults to 1 "
78 @echo " YYY sets the verbosity filter. Defaults to UVM_MEDIUM "
79 @echo " ZZZ selects the uvm test. Defaults to test_base "
80 @echo " "
81 @echo " ------------------------- Test TARGETS ------------------------------ "
82 @echo " all => Compile TB and DUT files and run the simulation "
83 @echo " compile => Compile TB and DUT files "
84 @echo " run => Run the simulation with seed "
85 @echo " random => Run the simulation with random seed "
86 @echo " dve => Run DVE with preset waveform displayed "
87 @echo " dve_i => Run simulation interactively with DVE "
88 @echo " dve_tr => Run DVE with transaction debugging enabled "
89 @echo " "
90 @echo " -------------------- ADMINISTRATIVE TARGETS ------------------------- "
91 @echo " help => Displays this message "
92 @echo " clean => Remove all intermediate simv and log files "
93 @echo " nuke => Remove all source code and debug files "
94 @echo " original => Return content of lab back to original state "
95 @echo " copy => Copy files from previous lab's solutions directory "
96 @echo " mycopy => Copy files from user's previous lab directory "
97 @echo " solution => Copy files from solutions directory for lab "
98 @echo " "
99 @echo " ---------------------- EMBEDDED SETTINGS -----------------------------"
100 @echo " -timescale=\"1ns/100ps\" "
101 @echo " -debug_all "
102 @echo =======================================================================