个流程大致步骤都相同都是:Compile,SIM(urg,覆盖#率的分析和采集),debug时主要是跑一个pattern,并dump VPD文件,SIM的同时可以打开DVE视图界面,结束后观察波形,regress主要用#于采集覆盖率,一般要跑多个pattern,这时就无需dump VPD文件(节约时间),由于是debug后有进行的重复运行,所以叫regress(回归)。
# 在我们的验证平台中,若不做代码覆盖率的功能,可以不写regress,只要写debug的流程和跑多个pattern的脚本就好了。
#---------------------------------------------------------------------------------------------------------------------# The DEBUG flow turns on VPD dumping and turns off coverage collection. After # building a testcase using the debug targets, you can debug the TB and the DUT# source code using the testbench debugger and DVE. Of course, you can turn on # coverage metrics and run in debug mode by changing compile and runtime options # in the makefile. These changes are independent of the regression flow so that# the regressions will still run optimally without the interference of VPD dumping.# debug流程打开VPD文件的dump并关闭覆盖率在build了一个包含DUT的testcase后,可以使用VCS的debugger和DVE进行debug。
当# 然,你也以通过改变makefile文件中的compile和runtime选项参数来开启覆盖率功能。
Debug流程和regress流程是各自独立的,regression# 流程一般不生成VPD。
#--------------------------------------------------------------------------------------------------------------------------------# The REGRESSION flow turns off VPD dumping and turns on Coverage Metrics and TB # coverage collection. This flow is intended to support verification engineers who# are working through the regression process and are interested in coverage# collection and urg.# REGRESSION流程关闭VPD dump并打开Coverage collection功能,该流程是为了支持验证引擎进行“流水线验证“(跑多个testcase)和# 代码覆盖率功能。
??在验证平台中可以将运行多个testcase的脚本命名为regress,运行单个testcase的脚本命名为regone??,这只是# synopsys的模版,我们不必完全遵守,可以不区分debug和regress,然后将是否打开波形和coverage设置成参数。
#-------------------------------------------------------------------------------------------------------------------------------# Command Line make命令行# -----------------# The Makefile supports the following command line# makefile支持下列命令行# % make target_name_* <SEED=xxx> <DEFINES=xxxx># makefile文件放在哪?放在仿真路径。
make [-f makefile文件名][选项][宏定义][目标]# -f 指定makefile 若没有则make程序首先在当前目录查找名为makefile的文件,如果没有找到,它就会转而查找名为Makefile的文件。
# Where target_name is the name of a testcase located in the testdirectory. Every# test in the test directory is named using test_{test_name}. All of the test targets# are listed in the TEST TARGETS section of the makefile.# target_name是test路径下的一个testcase的名字,test路径下的testcase的名字使用test_{test_name}来命名,例如test_1# 所有的test target 都在makefile文件中的TEST TARGETS部分列出#---------------------------------------------------------------------------------------------------------------------------# Compile and Run Testcases 编译与运行testcase# -------------------------------# To compile and run a tescase use the test_* and regress_test_* targets.# 编译与运行testcase,(test_1 就是执行了下面的两个命令先编译在运行)test_1==> compile_1 run_1 详见下面命令定义# % make test_1 // Builds and runs test 1 with VPD dumping 其实就是debug的前边的流程# % make regress_test_1// Builds and runs test 1 with coverage turned on# -------------------------------------------------------------------------------------------------------------------------# Debugging Testcases Debug 实在上面命令之后在进行的# ------------------------# You can use DVE and the testbench debugger to visualize waveforms and testbench # execution. You must first build the testbench using the make compile_* command.# dubug必须是在DVE(VCS的debug工具,与debussy一样的功能)下进行,因为要看波形嘛,但是debug之前必须先compile# % make compile_1 // Builds test 1 for debugging //需要重新编译一次吗?# Once you have built the environment with the proper debug switches, you can use DVE and the testbench debugger.# # testbench debugger 是否是指编译后的那个simv可执行文件呢?其实gui_1 和上面test_1中的run_1是一样的只是增加了-gui项# 即增加了打开gui界面的参数,其他雷同# % make gui_1 // Debug test 1 with DVE# % make tb_gui_1 // Debug test 1 with the testbench debugger# % make both_guis_1 // Debug using both guis# % make pp_1 // Debug using the VPD file VPD文件要在执行simv之后才有吧?# If you want, you can turn on coverage for the DEBUG flow by uncommenting the # coverage flag in the makefile. If you do this, you can still look at coverage.# This may be useful in helping those who are debugging coverage related issues. # 如果在makefile中的debug流程中使用了coverage功能,那么可以使用下面命令观察覆盖率# % make urg // Visualize coverage data from debug runs# -----------------------------------------------------------------------------------------------------------------------------# Regression Testcases# --------------------# Regression tests are used to collect coverage information. To build a testcase# for coverage collection use a command similar to the following.# regress流程主要是为了收集代码覆盖率信息,在执行regress之前需要重新build testcase 类似debug时的compile# % make regress_build_1 // Build and run a regression test with a default seed# Once the test has been built, you can run it again with a new seed.# 与debug不同的是regress需要重新run(使用新的SEED)一下,【还是debug的时候也要run一下?】# % make regress_run_1 SEED=1234# After running one or more regression runs, you can visualize the coverage data # using urg and the following command# run完之后可以用下面命令看代码覆盖率# % make regress_urg#----------------------------------------------------------------------------------------------------------------------------# HOW TO REUSE THIS FILE ON ANOTHER DUT //如何重用该模版# STEP 1: Update the file locations as required //设置file所属的路径# STEP 2: Update the DUT section with directory and source location info//更新模版中DUT部分,指定DUT的路径和include的路径# STEP 3: Update the TB section with directory and source location info//更新模版中TB部分,指定TB的路径和include的路径# STEP 4: Update the Coverage section with name of dut top (eg top.dut)//跟新模版中Coverage部分,指定要测试代码覆盖率的dut的top# STEP 5: Add test targets to the debug and regression targets section//将debug 和regress的target加入模版中对应的部分# STEP 5: Adjust the debug and regression compile and run time arguments//调整debug和regress的compile和runtime的命令参数# STEP 7: Adjust command line options as required//调整命令行命令(后边带百分号和冒号的就表示可以在make命令行中使用的命令)# STEP 8: Update the env class so that it extends dkm_env//更新env class(环境类)使得它可以提供dkm_env# You will need to have a copy of the dkm directory and it should //dkm 是什么?# be located at $(TB_SRC_DIR)/dkm# a) Add [`include "dkm_env.sv"]# b) Add [extends dkm_env] to the environment class definition# c) Call the super.new("name") from the constructor# STEP 9: Run the debug and regression targets# % make testbench_target_* // testbench_target_* 是指test_1之类的testcase#-----------------------------------------------------------------------------看了上文,大家应该可以简单了解这个Makefile的功能了。