vcs/urg 进行覆盖率coverage merge及部分merge到整体

article/2025/10/23 12:01:33

目录

1.vcs收coverage基本Option

2.相同代码的merge

3.部分merge到整体

3.1 mapfile

3.2 -map使用语法

3.3合并的常见问题

3.3.1 UCAPI-MAP-SHAPEMISMATCH


coverage相关的用户手册可以在本人的百度云盘中查看Coverage Technology User Guide.pdf

还可以参考gsithxy的博文 [VCS]Condition Coverage收不全的问题及解法 该文给出了vcs收覆盖率的option、merge常见问题、merge常见option

1.vcs收coverage基本Option

Option

description

-cm line+cond+fsm+tgl+branch+assert

line : Enable collecting line or statement coverage
cond : Enable collecting condition coverage
fsm : Enable collecting FSM coverage
tgl : Enable collecting toggle coverage
branch : Enable collecting branch coverage
assert :  Enable collecting SystemVerilog assertion coverage

-cm_libs yv

yv :Enable collecting coverage source code from Verilog libraries
Default doesn't collect coverage of the library files. 

-cm_dir $directory_path_name

Specify an name and location for simv.vdb

Default is simv.vdb

-cm_log $filename

Specify a log file for monitoring coverage.

Default is cm.log. To suppress the log file, you could re-direct the log file to empty path. (ex, -cm_log /dev/null)

-cm_name $testname

Specify a different location for different simulation, used in dsim flow

-cm_hier $filename

Collect particular instances' coverage

$filename contents
------------------------------
+/-tree $instance_name [$level] //level number of 0 (or no level number) specifies the entire sub-hierarchy
+/-module $module_name

-cm_assert_hier $filename

Collect particular assertion' coverage

$filename contents
------------------------------
+/-assert my_assert
+/-assert A*
+/-assert $instance_name

-cm_line contassign

Specifies enabling line coverage for Verilog continuous assignments.

-cm_tgl portsonly

Only monitor port of toggle coverage, remove net and variables monitor in modules.

2.相同代码的merge

export path := cov_r20111db_file=$(shell find ${path} -maxdepth 2 -depth -name "simv*").PHONY:merge
merge:@echo ${db_file}urg -full64 -dir ${db_file} -dbname ${path}/merged.vdb  #urg -full64 -dir a.vdb b.vdb c.vdb -dbname xxx.vdb
cov:bsub -I verdi -cov -covdir ${path}/merged.vdb

上述命令将path目录下多个simv*.vdb下面的多个覆盖率文件merge成一个叫merge.vdb的文件

3.部分merge到整体

主要参考Coverage Technology User Guide.pdf中mapping coverage一节

项目中经常出现UT覆盖率merge到BT/SST及整芯片的情况。此时需要使用urg的-map命令

3.1 mapfile

-map命令需要mapfile以表明map关系,下图给出的mapfile意思是将module name为My_Ip的在B模块中的两个例化My_Ip1,My_Ip2的覆盖率映射到

A.B.My_Ip1上去。

3.2 -map使用语法

urg -dir base.vdb -dir input.vdb -mapfile file_name

Where, file_name is the mapping configuration file
 

3.3合并的常见问题

3.3.1 UCAPI-MAP-SHAPEMISMATCH

       When merge vdb files of local simulation to whole chip,  you might get the error as following:

“Warning-[UCAPI-MAP-SHAPEMISMATCH] Shape mismatch in mapping”

     导致shape mismatch可能有以下几个原因:

1. Coverage option mismatch;

Make sure the coverage-related options are the same for both vdbs.

For example:if one vdb is compiled with –cm_line contassign and the other isn’t, it will cause shape mismatch;

$vcs_cov_opts .= " -cm_line contassign ";

2. RTL mismatch;

3. Version  mismatch;

4. Tool bug;


http://chatgpt.dhexx.cn/article/HfxOt4x8.shtml

相关文章

代码覆盖率 ——语句覆盖 Statement Coverage、分支覆盖 Branch Coverage、 路径覆盖 Path Coverage的区别

我们以下面代码为例: public static boolean Method(boolean a, boolean b) {int x 2;int y -4;if(a)x y;elsex -2*x;if(b)y 0-x;return ((100/(xy))> 0);}语句覆盖 Statement Coverage 当我们要实现100% Statement Coverage,只需以下两个test…

NGS 测序深度和覆盖度—Depth、Coverage

文章目录 前言这是比较基本的两个概念:二者的关系:例子:使用**bamdst**计算覆盖度安装 使用参考: 前言 温故而知新,刚入门的时候没有好好记笔记,现在补上😑 公众号:猪猪的乌托邦 这…

idea插件Coverage(用例覆盖率)使用

idea插件Coverage(用例覆盖率)使用 选择测试用例中要执行的包、类或方法,右键选择Run …with Coverage。 执行结束后可在右侧查看覆盖率结果。可以点击导出按钮导出覆盖率报告。注意:若只执行了包中的某个类或方法,则…

浅谈coverage

背景描述: 公司需要对测试用例的对工程代码的覆盖率做统计,因此需要用到coverage,这里有个特殊的点,公司的工程运行时要在容器中进行的。 实际应用: 1. 首先,需要下载coverage: pip3 install…

Python代码覆盖率分析工具Coverage

目录 简介 安装 命令行中使用 调用API使用 简介 Coverage是一个Python代码覆盖率分析工具,它可以用于衡量Python测试代码的质量。通过给代码执行带来的覆盖率数据,Coverage可以帮助开发人员找出被回归测试代码中的漏洞,并且指明哪些代码…

coverage 测试代码覆盖率

测试覆盖率,简单的说,就是评价测试活动覆盖产品代码的指标。测试的目的,是确认产品代码按照预期一样工作,也可以看作是产品代码工作方式的说明文档。进一步考虑,测试覆盖率可以看作是产品代码质量的间接指标&#xff0…

GIS原理篇 Coverage

一、什么是 Coverage Coverage 是一种用于存储矢量数据的地理相关数据模型,它包含地理要素的空间(位置)数据和属性(描述性)数据。Coverage 使用一组要素类来表示地理要素。每个要素类存储一组点、线(弧&am…

Python:代码覆盖率工具coverage

简介:覆盖率测量通常用于衡量测试的有效性。它可以显示您的代码的哪些部分正在被测试执行,哪些不是。coverage是一个测量 Python 程序代码覆盖率的工具。它监视您的程序,注意代码的哪些部分已被执行,然后分析源代码以识别可能已执…

configure--prefix

本文主要说明--prefix参数的作用,其主要用在编译安装源代码应用中的./configure环节。 ./configure --help 查看详细的说明帮助 1、源码安装一般包括几个步骤:配置(configure),编译(make)&…

路由策略 匹配工具 IP-Prefix

⦁ p-prefix-name:指定地址前缀列表的名称。字符串形式,长度范围是1~169,不支持空格,区分大小写。 ⦁ index index-number:指定本匹配项在地址前缀列表中的序号。整数形式,取值范围是1&am…

CondaValueError: The target prefix is the base prefix. Aborting.

报错截图 错误原因 conda命令错误 正确做法 conda create -n py38 python3.8

zuul 里面的 prefix 和 strip-prefix 怎么使用

首先两个是配置路由前缀的, 下面是我网上找的一段话: prefix :前缀,当请求匹配前缀时会进行代理strip-prefix :代理前缀默认会从请求路径中移除,通过该设置关闭移除功能, 当 stripPrefixtrue …

Trie树(Prefix Tree)介绍

本文用尽量简洁的语言介绍一种树形数据结构 —— Trie树。 一、什么是Trie树 Trie树,又叫字典树、前缀树(Prefix Tree)、单词查找树 或 键树,是一种多叉树结构。如下图: 上图是一棵Trie树,表示了关键字集…

configure --prefix=/的作用和用法

非root用户安装python和gcc的时候,总是需要设定这个,只知道是个路径,具体是什么路径,代表什么不清楚。 不明白就百度: configure --prefix/是干啥用的?这个路径代表了什么? Configure是一个可…

前缀和(Prefix Sum)

前缀和指一个数组的某下标之前的所有数组元素的和(包含其自身)。前缀和分为一维前缀和,以及二维前缀和。前缀和是一种重要的预处理,能够降低算法的时间复杂度,可以在 O ( 1 ) O(1) O(1)的时间复杂度内求出区间和。 一…

CMAKE_INSTALL_PREFIX

一、定义 CMAKE_INSTALL_PREFIX为cmake的内置变量,用于指定cmake执行install命令时,安装的路径前缀。Linux下的默认路径是/usr/local ,Windows下默认路径是 C:/Program Files/${PROJECT_NAME} 二、用…

IP-Prefix List

地址前缀列表 一、IP-Prefix List二、语法及匹配规则1、语法2、匹配规则 三、配置案例1、拓扑2、分析ACL实现IP-Prefix List实现 四、IE考试题思考题 在进行配置案例前先了解一下基础知识 一、IP-Prefix List IP-Prefix List:能够同时匹配网络号和前缀长度 性能及可…

【脚本】更新依赖库pkgconfig文件中的prefix设置

在本地编译和安装了某个库后,如果其lib目录下存在pkgconfig子目录,则子目录下会存在若干.pc文件,文件中会有prefix的配置(该配置标识当前库的安装路径),当要把该库拷贝到其他机器上时,如果库的路…

Elasticsearch学习--查询(prefix、wildcard、regexp、fuzzy)

一、前缀搜索 prefix 不计算相关度评分性能较差前缀搜索匹配的是分词后的词项前缀搜索没有缓存前缀搜索尽可能把前缀长度设置的更长 GET product/_search {"query": {"fuzzy": {"name": {"value": "product1"}}} } index…

bgp 使用route-map设置Local perference(本地优先属性)配置与详解

实验目的: 1、掌握基于route-map的本地优先配置方法。 2、使用route-map配置可以定置基于目标网络的本地优先。 实验拓扑: 接口IP配置及bgp基础配置详见 CSDNhttps://mp.csdn.net/mp_blog/creation/editor?spm1001.2014.3001.5352 查看R3与R4的路由…