Skip to question and answer

Hardware interview practice

SystemVerilog Cross Coverage Explained

MediumFunctional CoverageMultiple choice

Before any filtering, how many cross bins are formed?

Question code
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

  1. A. 2
  2. B. 4
  3. C. 8
  4. D. 16

Concise answer

The answer and the key reason

The cross contains four bins. Each coverpoint contributes two named bins, so the cross records the four possible low/high bin pairings. The number of raw values contained inside each source bin does not expand the cross to eight or sixteen bins.

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

Explain it first, then compare the reviewed solution.

Open this exact question in the practice bank to attempt it, check your reasoning, and access the full member solution.Practice this question

Keep practicing

Temporal ChecksSVA Overlapped vs. Nonoverlapped ImplicationTemporal ChecksHow SVA disable iff Handles ResetFunctional CoverageSystemVerilog Coverpoint Bins Interview Question