|
| 1 | +# Makefile for UVM Lab6 |
| 2 | + |
| 3 | +LD_LIBRARY_PATH = ${NOVAS_HOME}/share/PLI/VCS/LINUX |
| 4 | + |
| 5 | +test = ubus_example_base_test |
| 6 | +env_path = /u/arwaa/PCIe_Training/makefile/sv |
| 7 | +test_path = /u/arwaa/PCIe_Training/makefile/examples |
| 8 | +rtl_path = /u/arwaa/PCIe_Training/makefile/examples/ |
| 9 | + |
| 10 | +PROGRAM_TOP = ${test_path}/ubus_tb_top.sv |
| 11 | +TEST_TOP = ${PROGRAM_TOP} |
| 12 | +TOP = ${TEST_TOP} |
| 13 | +DUT = ${rtl_path}dut_dummy.v |
| 14 | +TESTLIST = ubus_example_base_test test_read_modify_write test_r8_w8_r4_w4 test_2m_4s |
| 15 | + |
| 16 | +log = simv.log |
| 17 | +uvm_ver = uvm-1.1 |
| 18 | +seed = 1 |
| 19 | + |
| 20 | +compile_switches = -sverilog -lca -debug_access+all -kdb +vcs+vcdpluson -timescale="1ns/100ps" -l ./scratch/comp.log -ntb_opts ${uvm_ver} +incdir+${env_path}+${test_path} ${TOP} |
| 21 | +runtime_switches = -l ${log} +UVM_TESTNAME=${test} |
| 22 | + |
| 23 | +seq = uvm_reg_bit_bash_seq |
| 24 | + |
| 25 | +##### Required to create a make file which contains the following targets |
| 26 | +########## Target to compile the environment |
| 27 | +compile: ${env_path}/*.sv ${TOP} |
| 28 | +ifeq ($(CES64),TRUE) |
| 29 | + vcs -full64 ${compile_switches} |
| 30 | + @echo "Compiled in 64-bit mode" |
| 31 | +else |
| 32 | + vcs ${compile_switches} |
| 33 | + @echo "Compiled in 32-bit mode" |
| 34 | +endif |
| 35 | + |
| 36 | +########## Target to launch a single test |
| 37 | +run: |
| 38 | + simv +ntb_random_seed=${seed} ${runtime_switches} +seq=${seq} |
| 39 | + |
| 40 | +random: simv |
| 41 | + simv +ntb_random_seed_automatic ${runtime_switches} +seq=${seq} |
| 42 | + |
| 43 | +########## Target to launch all tests |
| 44 | +run_all: |
| 45 | + for test in ${TESTLIST} ; do \ |
| 46 | + simv +ntb_random_seed=${seed} -cm_dir ./scratch/$$test -l ./scratch/$$test/$$test.log +UVM_TESTNAME=$$test +seq=${seq} ; \ |
| 47 | + done |
| 48 | +random_all: |
| 49 | + for test in ${TESTLIST} ; do \ |
| 50 | + simv +ntb_random_seed_automatic -cm_dir ./scratch/$$test -l ./scratch/$$test/$$test.log +UVM_TESTNAME=$$test +seq=${seq} ; \ |
| 51 | + done |
| 52 | + |
| 53 | +########## Target to compile and run the simulation |
| 54 | +all: simv run |
| 55 | + |
| 56 | +########## Target to merge coverage database and generate coverage report |
| 57 | +cover: |
| 58 | + urg -dir ./scratch/*.vdb |
| 59 | + urg -dir ./scratch/*.vdb -format text |
| 60 | + |
| 61 | +########## Target to clean your workspace before the build |
| 62 | +clean: |
| 63 | + rm -rf simv* csrc* *.tmp *.vpd *.key log *.h temp *.log .vcs* *.txt DVE* *.hvp urg* .inter.vpd.uvm .restart* .synopsys* novas.* *.dat *.fsdb verdi* work* vlog* |
| 64 | + |
| 65 | +########## Target for the makefile help |
| 66 | +help: |
| 67 | + @echo ============================================================================ |
| 68 | + @echo " " |
| 69 | + @echo " USAGE: make target <seed=xxx> <verbosity=YYY> <test=ZZZ> " |
| 70 | + @echo " " |
| 71 | + @echo " xxx is the random seed. Can be any integer except 0. Defaults to 1 " |
| 72 | + @echo " YYY sets the verbosity filter. Defaults to UVM_MEDIUM " |
| 73 | + @echo " ZZZ selects the uvm test. Defaults to test_base " |
| 74 | + @echo " " |
| 75 | + @echo " ------------------------- Test TARGETS -------------------------------- " |
| 76 | + @echo " all => Compile TB and DUT files and run the simulation " |
| 77 | + @echo " compile => Compile TB and DUT files " |
| 78 | + @echo " run => Run the simulation with seed " |
| 79 | + @echo " random => Run the simulation with random seed " |
| 80 | + @echo " run_all => Run the simulation with seed for all the tests " |
| 81 | + @echo " random_all => Run the simulation with random seed for all the test " |
| 82 | + @echo " cover => Merge coverage database and generate coverage report " |
| 83 | + @echo " " |
| 84 | + @echo " -------------------- ADMINISTRATIVE TARGETS --------------------------- " |
| 85 | + @echo " help => Displays this message " |
| 86 | + @echo " clean => Remove all intermediate simv and log files " |
| 87 | + @echo " " |
| 88 | + @echo " ---------------------- EMBEDDED SETTINGS ------------------------------ " |
| 89 | + @echo " -timescale=\"1ns/100ps\" " |
| 90 | + @echo " -debug_all " |
| 91 | + @echo ============================================================================ |
0 commit comments