在 coverpoint 中使用 Item

huangapple go评论58阅读模式
英文:

Use of Item in coverpoint

问题

在下面的代码中,有人可以解释一下 "item" 指的是什么吗?

covergroup cg(bit ip);
 coverpoint txn_type {
    bins T0 = {0};
    bins T1 = {1};
    bins T2 = {2} with (((item || (!item)) && ip) == 1);
  }
endgroup
英文:

In the below code, can someone please explain what "item" refers to?

covergroup cg(bit ip);
 coverpoint txn_type {
    bins T0 = {0};
    bins T1 = {1};
    bins T2 = {2} with (((item || (!item)) && ip) == 1);
  }
endgroup

答案1

得分: 2

请参考IEEE标准1800-2017,查阅第19.5.1.1节 使用covergroup表达式的Coverpoint bin

with 子句指定仅包括满足给定表达式的 covergroup_range_list 中的值(即表达式求值为真,如12.4节所述)。在表达式中,名称 item 用于代表候选值。候选值与coverpoint的类型相同。

item 视为在 with 结构中隐式声明的变量。在您的代码中,item 代表coverpoint变量 txn_type

英文:

Always start with the IEEE Std, 1800-2017. Refer to section 19.5.1.1 Coverpoint bin with covergroup expressions:

> The with clause specifies that only those values in the
> covergroup_range_list that satisfy the given expression (i.e., for
> which the expression evaluates to true, as described in 12.4) are
> included in the bin. In the expression, the name item shall be used to
> represent the candidate value. The candidate value is of the same type
> as the coverpoint.

Think of item as an implicitly-declared variable used in the with construct. In your code, item represents the coverpoint variable, txn_type.

huangapple
  • 本文由 发表于 2023年3月9日 20:10:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/75684433.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定