DVE 如何查看代码覆盖率和功能覆盖率
#sv and DUT paths
RTL = ./router.v
SVTB = ./router_top.sv ./router_if.sv ./router_tb_pkg.sv ./router_tb.sv
SEED = 1
#code coverage command
CM = -cm line+cond+fsm+branch+tgl
CM_NAME = -cm_name simv
CM_DIR = -cm_dir ./covdir.vdb
compile:
vcs -l vcs.log -sverilog -full64 -debug_access+all \
$(SVTB) $(RTL) \
-top router_top \
${CM} \
${CM_NAME} \
${CM_DIR}
rung:
./simv ${CM} -gui -l run.log
cov:
dve -full64 -covdir *.vdb &
help:
@echo ===========================================================================
@echo " "
@echo " USAGE: make target <SEED=xxx> "
@echo " "
@echo " ------------------------- Test TARGETS --------------------------------"
@echo " test => Compiles TB and GOOD DUT files, runs the simulation. "
@echo " bad => Compiles TB and BAD DUT files, runs the simulation. "
@echo " compile => Compiles the TB and DUT. "
@echo " rung => Runs the simulation. "
@echo " template => Builds ntb templates "
@echo " dve => Runs dve in post-processing mode "
@echo " debug => Runs simulation interactively with dve "
@echo " clean => Removes all intermediate simv and log files. "
@echo " "
@echo " -------------------- ADMINISTRATIVE TARGETS ---------------------------"
@echo " help => Displays this message. "
@echo " copy => Copies lab files from previous working directory "
@echo " mycopy => Copies lab files from previous solution directory "
@echo " solution => Copies all files from current solutions directory "
@echo " nuke => Erases all changes. Put all files back to original state "
@echo " "
@echo ===========================================================================
1、对于代码覆盖率 要在编译时添加命令
CM = -cm line+cond+fsm+branch+tgl # 表示要收集代码覆盖率的类型 CM_NAME = -cm_name simv # 表示生成的覆盖率文件名 CM_DIR = -cm_dir ./covdir.vdb # 表示覆盖率要存储到哪个文件夹下面
2、在跑仿真的时候要填加上命令
./simv ${CM} -gui -l run.log 即:
./simv -cm line+cond+fsm+branch+tgl -gui -l run.log # 注意参数-cm line+cond+fsm+branch+tgl的顺序 必须紧跟在./simv 后面
然后使用make cov 打开 查看代码覆盖率和功能覆盖率: