System verilog 如何正确地从封面组中排除{';1}值?

System verilog 如何正确地从封面组中排除{';1}值?,system-verilog,uvm,System Verilog,Uvm,我实施了以下covergroup: covergroup my_covergroup_cg (input string name); enable_reg_cp : coverpoint enabled_reg[PARAM1-1:0] { illegal_bins no_enable = {0}; } feature_active_reg_cp : coverpoint feature_active_reg_mask[PARAM2-1:0]

我实施了以下covergroup:

covergroup my_covergroup_cg  (input string name);
      enable_reg_cp : coverpoint enabled_reg[PARAM1-1:0] {
         illegal_bins no_enable = {0};
      }
      feature_active_reg_cp : coverpoint feature_active_reg_mask[PARAM2-1:0] { // Interested in covering a PARAM2-width chunk of a 32-bit feature_active_reg
         illegal_bins all_features_active = {'1}; // We must not activate all features (1 bit = 1 feature active)
      }      
      my_covergroup_cross : cross enable_reg_cp , feature_active_reg_cp {
         illegal_bins il0 = (binsof (enable_reg_cp) intersect {0});
         illegal_bins il1 = (binsof (feature_active_reg_cp) intersect {'1});
      }
   endgroup : my_covergroup_cg
执行时,my cross的“il1”非法bin将被 feature_active_reg_mask[PARAM2-1:0]-完全合法且与{'1}不匹配(相当于..111111:所有)


在“binsof”范围内如何处理这些{'1}是否存在特殊问题?

这很可能是一个工具问题。根据1800-20167 LRM中第19.5.7节的值分辨率,所有bin表达式都在覆盖点类型的上下文中进行评估。您可以使用
[$:$]
作为表示最大可能值的替代方法

但是。。。
交叉
中的
非法垃圾箱
是不必要的,因为只有覆盖点的包含垃圾箱被交叉。而且。。。如果您定义了一组显式的bin,那么就没有隐式定义的bin,因此您应该将其编写为

covergroup my_covergroup_cg  (input string name);
      enable_reg_cp : coverpoint enabled_reg[PARAM1-1:0] {
         bins enable[] = {[1:$]}; // will be split into N bins according to auto_bins_max
      }
      feature_active_reg_cp : coverpoint feature_active_reg_mask[PARAM2-1:0] { // Interested in covering a PARAM2-width chunk of a 32-bit feature_active_reg
         bins some_features_active = {[0:$]}; 
         ignore_bins all_features_active = {[$:$]}; // We must not activate all features (1 bit = 1 feature active)
      }      
      my_covergroup_cross : cross enable_reg_cp , feature_active_reg_cp;
   endgroup : my_covergroup_cg

在第二个coverpoint中,$值与两个箱子规格重叠,但
ignore\u箱子
覆盖了这一点

只想分享我的知识共享解决方案: 我决定使用
localparam
semantic。似乎这个问题与解释
{'1}
的工具有关。 我做了以下工作:

localparam all_ones = {PARAM2{1'b1}};
covergroup my_covergroup_cg  (input string name);
      enable_reg_c .... // rest of code
我把这个别名传给了我的
非法垃圾箱

illegal_bins il1 = (binsof (feature_active_reg_cp) intersect {all_ones});

干杯,

请注意,PARAM2绝对大于1。对covergroups的记忆不足,无法确定,但您是否尝试了复制操作符?(
{$bits(feature_active_reg_cp){1'b1}
)我猜想
intersect
语句的右侧是“自确定的”,因此
'1
的宽度为1(见LRM 2012;5.7.1)。(将此作为评论,因为我真的不确定)谢谢你的回复。我一直使用
[$:$]
并注意到该工具将其视为一个范围而不是最大值,因此它将覆盖点可以获得的所有可能值非法化。