博文精选】vcs产生code coverage与function coverage

2020-02-13 17:49

vcs仿真中,可以产生以下两类coverage:

  • code coverage
  • function coverage

对于code coverage,在编译和仿真需要加额外参数。对于function coverage,编译和仿真不需要加额外参数。

一、code coverage

code coverage包含以下一些coverage:

  • line coverage
  • toggle coverage
  • condition coverage
  • branch coverage
  • FSM coverage
  • assert coverage

要使能这些coverage,vcs的-cm选项,来控制,是否产生这些coverage

-cm <cov_metrics_name>

关于cov_metrics_name,有如下选择:

  • line:使能line coverage
  • cond:使能cond coverage
  • tgl:使能toggle coverage
  • fsm:使能FSM coverage
  • branch:使能branch coverage
  • assert:使能assert coverage

多个选项之间,使用+进行连接。例如,要使能line,fsm coverage,使用如下选项:

-cm line+fsm

code coverage选项,在编译和仿真的时候,都必须要有,否则不能正常的生成coverage。

编译如果带有coverage coverage选项,会在编译目录下,生成simv.vdb目录,里面包含了coverage model。

二、function coverage

function coverage,没有选项控制,因为是在代码中指定的。

在编译的时候,不会生成simv.vdb目录,因为function coverage不需要coverage model。

三、coverage其他选

-cm_dir选项

官方解释:

The -cm_dir <directory_path_name> option enables you to

specify an alternative name or location for saving the default

simv.vdb directory. If not specified, VCS automatically generates

the coverage database with the name simv.vdb or

<exe_name>.vdb where, exe_name is the argument to -o option

if included during compilation.

带上coverage选项,vcs编译完毕后,默认会在编译目录,生成simv.vdb文件夹。该文件夹里面,包含了coverage model。

可以通过-cm_dir选项,更改默认的coverage model生成的目录。

仿真的时候,如果没有指定-cm_dir选项,那么使用编译时候指定的simv.vdb的目录。也可以仿真带有-cm_dir选项,修改仿真时,生成的simv.vdb目录位置。

  1. -cm_name选项

官方解释:

The -cm_name <filename> option as a compile-time or runtime

option enables you to specify an alternative test name instead of the

default name. The default test name is test

对于每一个test,生成的coverage数据,默认是在simv.vdb/snps/coverage/db/testdata/test目录下

默认coverage数据,是在test目录下,可以通过-cm_name选项,修改默认的test目录。

比如-cm_name load_test,那么coverage数据,就会生成在simv.vdb/snps/coverage/db/testdata/load_test目录下。

3. -cm_hier选项

该选项,在coverage technology reference manual手册上有介绍。

官方解释该选项:

The -cm_hier option is a compile-time option to specify module definitions, instances and sub-hierarchies, and source files that you want VCS to either exclude from coverage or exclusively compile for coverage.

在收集code coverage的时候,工具默认会收集所有模块的coverage。但是有时候,我们只关心某一层模块以及之下的coverage。此时就需要-cm_hier选项来指定层次。

-cm_hier选项,指定一个coverage配置文件。该配置文件,指定了收集coverage的模块。

对于这个coverage配置文件,有如下一些语法:

3.1 +tree instance_name [level_number]

VC VCS compile only the specified instance and the instances under it for coverage. These instances can be Verilog module or VHDL entity instances. VCS exclude all other instances from coverage.

A level number of 0 (or no level number) specifies the entire subhierarchy, 1 specifies only this instance, 2 specifies this instance and those instances directly under this instance, 3 specifies this instance and instances in the subhierarchies that are one and two levels below the specified instance. There is no limit to the integer you specify as the level number.

If the subhierarchy includes instances in the other HDL, VCS does not include these instances.

只对指定层次的模块,以及该层次下的模块,统计coverage。level_number,表示从该层次模块,向下统计coverage的层次。0表示统计所有,1表示只统计当前层,2表示统计当前层和下一层,之后依次类推。

3.2 -tree instance_name [level_number]

VC VCS exclude this instance from coverage and other instances under it. These instances can be Verilog module or VHDL entity instances. VCS include all other instances in coverage.

A level number of 0 (or no level number) specifies the entire subhierarchy, 1 specifies only this instance, 2 specifies this instance and those instances directly under this instance, and so on.

If the subhierarchy includes instances in the other HDL, VCS does not exclude these instances.

只对指定层次的模块,以及该层次下的模块,不统计coverage。level_number,表示从该层次模块,向下不统计coverage的层次。0表示不统计所有,1表示只不统计当前层,2表示不统计当前层和下一层,之后依次类推。

3.3 +module module_name | entity_name

VCS compiles all instances of the specified Verilog module or VHDL entity definition, and excludes all other definitions under it, for coverage.

只对指定模块统计coverage。

3.4 -module module_name | entity_name

VCS does not compile all instances of the specified Verilog module or VHDL entity definition, and includes all other definitions under it, for coverage.

只对指定模块不统计coverage

3.5 +file file_name

VCS compile for coverage only the code in this file. If the file is not in the current directory, specify the path name of the file.

对指定的文件,统计该文件内模块的coverage。如果file_name不是当前路径下,那么需要使用绝对路径。

3.6 -file file_name

VCS exclude the code in this file from coverage. If the file is not in the current directory, specify the path name of the file.

对指定的文件,不统计该文件内模块的coverage。如果file_name不是当前路径下,那么需要使用绝对路径。

3.7 +filelist file_name

VCS compile for coverage only the source files listed in the specified file.

只对file_name文件,统计该文件里面指定的源文件中模块的coverage。

3.8 -filelist file_name

VCS exclude from coverage the source files listed in the specified file.

只对file_name文件,不统计该文件里面指定的源文件中模块的coverage。

3.9 +moduletree module_name [level_number]

VCS provides coverage metrics for all instances of the specified module and for all module instances in the hierarchy below the specified module. In other words, each hierarchy tree starting at each instance of the specified module will have coverage metrics provided. The coverage metrics are only provided for the number of levels of hierarchy specified by the optional level_number.

对指定的模块,以及该模块下的模块,统计coverage。level_number,表示从该模块,向下统计coverage的层次。0表示统计所有,1表示只统计当前层,2表示统计当前层和下一层,之后依次类推。

3.10 -moduletree module_name [level_number]

VCS excludes coverage metrics for all instances of the specified module and for all module instances in the hierarchy below the specified module. In other words, each hierarchy tree starting at each instance of the specified module will have coverage metrics excluded. The coverage metrics are only excluded for the number of levels of hierarchy specified by the optional level_number.

对指定的模块,以及该模块下的模块,不统计coverage。level_number,表示从该模块,向下统计coverage的层次。0表示统计所有,1表示只统计当前层,2表示统计当前层和下一层,之后依次类推。

3.11 +/-node

Excludes or includes a signal in toggle coverage.

去除或者包括对指定信号toggle coverage的统计。后面跟信号的绝对路径,可以使用通配符*。

如:

+node top.cnt_inst*.out[7:5] //对该信号,不统计toggler

-node top.cnt_inst*.out[4:0] //对该信号,统计toggler

比如我们想收集,tb_top.aaa.bbb.ccc 这个模块,以及模块之下的coverage,那config文件内容如下:

+tree tb_top.aaa.bbb.ccc 0

比如我们想收集,ccc 这个模块,以及模块之下的coverage,那config文件内容如下:

+moduletree ccc 0

如果只想收集ccc这个模块呢:

+moduletree ccc 1

四、查看coverage

1. dve

如果使用dve,使用如下命令查看coverage数据:

dve -full64 -cov -dir simv.vdb

2. verdi

如果使用verdi,使用如下命令查看coverage数据:

verdi -cov -cov_dir simv.vdb

  1. urg

urg命令,可以将coverage数据,转换成html。

urg -dir simv.vdb

在当前目录下,会生成 urgReport 目录,里面有生成的html文件,使用浏览器即可查看这些文件。

vcs产生code coverage与function coverage相关推荐

  1. SyetemVerilog Function coverage练习

    正好在学习func_coverage,读到大佬的两个blog,学习一下. 参考: https://www.amiq.com/consulting/2015/09/18/functional-cover ...

  2. ajax判断成功状态码,Ajax返回状态码200,成功函数不触发(Ajax returns status code 200, success function not triggering)...

    Ajax返回状态码200,成功函数不触发(Ajax returns status code 200, success function not triggering) 关于这一点有很多话题,但没有一个 ...

  3. NLP-生成模型-2017-PGNet:Seq2Seq+Attention+Coverage+Copy【Coverage解决解码端重复解码问题;Copy机制解决解码端OOV问题】【抽取式+生成式】

    PGNet模型训练注意事项: Coverage机制要在训练的最后阶段再加入(约占总训练时间的1%),如果从刚开始训练时就加入则反而影响训练效果: Copy机制在源文本的各个单词上的概率分布直接使用At ...

  4. SVA Function Coverage

    1.SVA中的 $使用: 1.无限制的delay 2.连续的delay 3.request-grant 协议 4.multi hreading  导致错误 2.前置是条件,后置直接为0. 转载于:ht ...

  5. [VCS]Coverage Options Introduction

    Coverage Options Introduction 摘要:VCS仿真中,可以产生以下两类coverage:code coverage和function coverage,对于code cove ...

  6. Verdi/Coverage tool 学习 第3节(常用编译仿真选项篇)

    目录 VCS产生code coverage 与 function coverage 归类总结 一.code coverage 二.function coverage 三.coverage其他选项 3. ...

  7. uvm 形式验证_IC设计职位详解之“数字验证工程师”就业必学课程

    数字验证处于数字IC设计流程的前端,属于数字IC设计类岗位的一种.在IC设计中,数字验证所占的人数比重是非常多的,很多大公司,数字前端设计工程师与验证工程师的比例已经达到1:3. 数字验证主要分成几种 ...

  8. 数字IC验证工程师加班吗?工资高吗?一天是怎么样的呢?

    现阶段的IC行业,数字IC验证工程师非常紧缺,尤其是在这个行业中干了很多年的工程师那更是奇货可居.但是最近和一些在校学生和刚入行的朋友们交流的时候,发现大多数人对数字IC验证工程师的具体工作不了解,甚 ...

  9. IC设计职位详解之“数字验证工程师”就业必学课程

    数字验证处于数字IC设计流程的前端,属于数字IC设计类岗位的一种.在IC设计中,数字验证所占的人数比重是非常多的,很多大公司,数字前端设计工程师与验证工程师的比例已经达到1:3. 数字验证主要分成几种 ...

最新文章

  1. 16进制魔术数字 0xdeadbeef Leet英文转写形式 简介
  2. 卷积神经网络的网络层与参数的解析
  3. 记“debug alipay”一事
  4. 解读 | 滴滴主题研究计划:机器学习专题+
  5. db2 sql 判断select是否为空_学会复杂一点的SQL语句:Oracle DDL和DML
  6. java注入 named_spring @autowired 如何根据bean(@Service)的name来注入
  7. 六时车主 App iOS隐私政策
  8. 【可临摹UI设计干货】APP UI界面的版式设计理论!
  9. 测试nignx php请求并发数,Nginx 高级篇(八)ab 压力测试即 nginx 的性能统计模块...
  10. 动态添加Table tbody 给option 下拉框动态赋值 逻辑删除
  11. 第3章 面向对象 (上)
  12. Redis基础6(Redis6管道)
  13. Packet Tracer 5.0建构CCNA实验攻略2配置vlan
  14. Atitit.为什么小公司也要做高大上开源项目
  15. java程序员集合框架面试题_常见的Java集合框架面试题目及回答
  16. 吉林大学超星学习通06 07 08
  17. python常用的编程软件_mPython(图形化编程软件)
  18. MotorSolve(电机设计软件)v5.1绿色中文版
  19. 有哲理有关java的_从Java到“浑沌之死”再到人生哲理
  20. u盘恢复软件?windows小工具不要错过!

热门文章

  1. 2023-2028年中国护肤品行业市场供需与投资预测分析报告
  2. 戴尔新专利:一台笔记本,两个可拆卸屏,你怎么看?...
  3. python多进程存储数据丢失的存储器是_python查漏补缺 --- 模块、文件、异常
  4. iOS pods组件化私有的framework 、xcframework
  5. 【Python入门】Python的判断语句(判断语句的嵌套)
  6. Android 6.0+ 解决浏览器某些页面无法访问的问题
  7. WPF 精修篇 TextBox多行 滚动条
  8. 分类5:机器学习处理帕尔默企鹅数据
  9. OleDbDataAdapter 类
  10. ATA-L系列水声功率放大器-宽频带-大功率