systemverilog功能覆盖率

1 iff 如过满足条件则采样,iff可以理解为if

covergroup iff_cov;
    coverpoint tr.data iff(!vif.reset) ; //复位时不采样
endgroup

2 coverpoint和bin

covergroup name_bin ;
    coverpoint tr.kind {
        bins zero  = {0};            //1个bin 代表kind = 0
        bins low = {[1:3],7};        // 1个bin 代表1:3 或者7
        bins high[] = {[8:$]};       // (tr.kind最大值-8) 个bin
        bins rem    = default;       // 剩余数值属于1个bin
        }                     
endgroup

忽略某些bin

bit[2:0] low_ports_0_5;	//只使用数值0-5
covergroup CoverPort;
	coverpoint low_ports_0_5 {
		ignore_bins hi = {[6,7]};		//忽略掉6,7两个仓
		}
endgroup

交叉覆盖率

covergroup Covport; 
	port: coverpoint tr.port
		{bins port[] = {[0:$]};  //8
}
	kind: coverpoint tr.kind {
		bins zero = {0};  //1
		bins lo = {[1:3]};  //1
		bins hi [] = {[8:$]};   //8
		bins misc = default;  //1
}
cross kind, port {
	ignore bins hi = binsof(port) intersect {7}; 
	ignore bins md = binsof(port) intersect {0} &&
	binsof (kind) intersect {[9:11]};  //排除port的0、7、[9:11]
	ignore bins lo = binsof (kind.lo); //排除kind的[1:3]
}
endgroup

如果只想关注交叉覆盖率,而不想关注单个coverpoint,可以通过设置权重option.weight = 0来将coverpoint的覆盖率忽略

covergroup cross_type_kind;
    type : coverpoint tr.type {option.weight = 0}
    kind : coverpoint tr.kind {option.weight = 0}
    cross type,kind{
                    ignore_bins t1 =binsof(type)intersect{5};
                    }
endgroup

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值