Hardware interview practice
SystemVerilog Cross Coverage Explained
Before any filtering, how many cross bins are formed?
cp_a: coverpoint a { bins low = {[0:1]}; bins high = {[2:3]}; }
cp_b: coverpoint b { bins low = {[0:1]}; bins high = {[2:3]}; }
x_ab: cross cp_a, cp_b;Answer choices
- A. 2
- B. 4
- C. 8
- D. 16
Concise answer
The answer and the key reason
Deeper explanation
Work through the implementation and tradeoffs
Cross coverage combines source bins, not every underlying value directly. Here `cp_a` has `low` and `high`, and `cp_b` also has `low` and `high`. Pairing each bin from the first coverpoint with each bin from the second produces low-low, low-high, high-low, and high-high.
Each source bin happens to contain two values, but those values are already grouped before the cross is formed. A sample such as `a=0, b=3` therefore contributes to the low-high cross bin. Filtering constructs such as `ignore_bins`, `illegal_bins`, or `binsof` expressions can later remove or redefine combinations, but the unfiltered starting count is four.
What to remember
- Crosses combine bins
- Two by two equals four
- Values remain grouped
Practice the complete prompt
