Synopsys SVTB Makefile

 1 # Makefile for SystemVerilog Lab6
 2 PKG = 
 3 TSCALE = -timescale="1ns/100ps"
 4 RTL= ../../rtl/router.v
 5 BADRTL= ../../rtl/bad/router.v
 6 SVTB = ./router_test_top.sv ./router_io.sv ./test.sv
 7 SEED = 1
 8 
 9 default: test 
10 
11 test: compile run
12 
13 bad: compile_bad run
14 
15 package_run: PKG = ./router_test_pkg.sv
16 package_run: compile run
17 
18 run:
19     ./simv -l simv.log +ntb_random_seed=$(SEED)
20     urg -dir simv.vdb
21     urg -dir simv.vdb -format text
22 
23 run_pkg:
24     ./simv -l simv.log +ntb_random_seed=$(SEED)
25 
26 compile:
27     vcs -l vcs.log -sverilog -debug_all $(TSCALE) $(PKG) $(SVTB) $(RTL)
28 
29 compile_bad:
30     vcs -l vcs.log -sverilog -debug_all $(TSCALE) $(PKG) $(SVTB) $(BADRTL)
31 
32 coverage:
33     firefox $(PWD)/urgReport/dashboard.html &
34 
35 template:
36     ntb_template -t router -c clock ../../rtl/router.v
37 
38 dve:
39     dve -vpd vcdplus.vpd &
40 
41 debug:
42     ./simv -l simv.log -gui -tbug +ntb_random_seed=$(SEED)
43 
44 copy:
45     cp ../../solutions/lab5/*.sv .
46     cp ../../solutions/lab6/Environment.sv .
47     cp ../../solutions/lab6/router_test_pkg.sv.orig router_test_pkg.sv
48     cp ../../solutions/lab6/Scoreboard.sv.orig Scoreboard.sv
49     cp ../../solutions/lab6/test.sv.orig test.sv
50     cp ../../solutions/lab5/router_test.h .
51 
52 mycopy:
53     cp ../lab5/*.sv .
54     cp ../../solutions/lab6/Environment.sv .
55     cp ../../solutions/lab6/router_test_pkg.sv.orig router_test_pkg.sv
56     cp ../../solutions/lab6/Scoreboard.sv.orig Scoreboard.sv
57     cp ../../solutions/lab6/test.sv.orig test.sv
58     cp ../lab5/router_test.h .
59 
60 solution: clean
61     cp ../../solutions/lab6/*.sv .
62     cp ../../solutions/lab6/router_test.h .
63 
64 clean:
65     rm -rf simv* csrc* *.tmp *.vpd *.key *.log *hdrs.h
66 
67 nuke: clean
68     rm -rf *.v* include *.sv .*.lock *.old .*.old DVE* *.tcl urg* *.h
69 
70 help:
71     @echo ===========================================================================
72     @echo  "                                         "
73     @echo  " USAGE: make target <SEED=xxx>                                          "
74     @echo  "                                         "
75     @echo  " ------------------------- Test TARGETS --------------------------------"
76     @echo  " test       => Compiles TB and GOOD DUT files, runs the simulation.     "
77     @echo  " bad        => Compiles TB and BAD DUT files, runs the simulation.      "
78     @echo  " compile    => Compiles the TB and DUT.                                 "
79     @echo  " run        => Runs the simulation.                                     "
80     @echo  " template   => Builds ntb templates                                     "
81     @echo  " dve        => Runs dve in post-processing mode                         "
82     @echo  " debug      => Runs simulation interactively with dve                   "
83     @echo  " clean      => Removes all intermediate simv and log files.             "
84     @echo  "                                                                        "
85     @echo  " -------------------- ADMINISTRATIVE TARGETS ---------------------------"
86     @echo  " help       => Displays this message.                                   "
87     @echo  " copy       => Copies lab files from previous working  directory        "
88     @echo  " mycopy     => Copies lab files from previous solution  directory       "
89     @echo  " solution   => Copies all files from current solutions directory        "
90     @echo  " nuke       => Erases all changes. Put all files back to original state "
91     @echo  "                                                 "
92     @echo ===========================================================================
原文地址:https://www.cnblogs.com/loves6036/p/5811974.html