Excluded and Illegal Cross Products

Remove impossible cross products, make forbidden ones errors, guard a cross with iff, and keep it small enough to close.

You Will Be Able To

  • Exclude impossible products from a cross with ignore_bins and a select expression.
  • Mark forbidden products with illegal_bins and say which wins when a product is both ignored and illegal.
  • Guard a cross with iff and predict its effect on the coverpoints.
  • Shrink a cross by coarser coverpoint bins and coverpoint exclusions.
Lesson
C18
Time
25 min
Runs on
Coverage build
Check
4 questions

A 4-lane by 4-command cross stayed at 87.5% in every regression. Two of its products could never happen: configuration only ever travels on lanes 0 and 1. The fix was one ignore_bins line, and the review learned that a cross must be told which products are impossible.

lane \ cmdnoprdwrcfg
0binbinbinbin
1binbinbinbin
2binbinbinignore_bins
3binbinillegal_binsignore_bins

The example's cross: 16 products, 2 impossible and 1 forbidden. 13 bins remain in the number.

ignore_bins on a Cross

In a cross, ignore_bins name = select_expression; removes every product the expression selects (IEEE 1800-2023 19.6.2). The selection uses the same binsof, intersect and operators as user cross bins.

Ignored Products Leave User Bins Too

An ignored product is excluded even if a user cross bin also selects it (19.6.2). The user bin keeps its other products. In the formula of 19.11.2, ignored products count among those user bins take. They never come back as automatic bins.

A User Bin and an Ignore That OverlapCross of two 2-bit coverpoints with bins one = binsof(a) intersect {1} and ignore_bins ig = binsof(b) intersect {1}. Arrows show where the shared product <1,1> goes.
  • Neutral
  • Data
A user bin and an ignore that overlapCross of two 2-bit coverpoints with `bins one = binsof(a) intersect {1}` and `ignore_bins ig = binsof(b) intersect {1}`. Arrows show where the shared product <1,1> goes. neutral <a=1, b=1> in both selections neutral bins one <1,0> <1,2> <1,3>left neutral ignore_bins ig 4 products neutral automatic 16 - 7 = 9 bins ignorednot counted here
  1. neutral <a=1, b=1>in both selections
    • ignored → ignore_bins ig
    • not counted here → bins one
  2. neutral ignore_bins ig4 products
  3. neutral bins one<1,0> <1,2> <1,3> left
  4. neutral automatic16 - 7 = 9 bins
  1. The ignore wins

    <1,1> is selected by both. It is ignored, so it does not count for one.

  2. Count the cross

    one keeps 3 products and is one bin. The 7 products taken by one or ig leave 9 automatic bins: 10 in all.

Read the diagram as text
  • <a=1, b=1>: in both selections
  • bins one: <1,0> <1,2> <1,3> left
  • ignore_bins ig: 4 products
  • automatic: 16 - 7 = 9 bins
  • <a=1, b=1> → ignore_bins ig: ignored
  • <a=1, b=1> → bins one: not counted here

A sample of a = 1, b = 1 covers nothing in this cross.

illegal_bins on a Cross

illegal_bins name = select_expression; removes products and makes a hit a run-time error. It takes precedence over everything, even an ignore_bins that selects the same product (19.6.3).

iff on a Cross

x: cross a, b iff (en) ignores the cross at any sample where en is false (19.6). The coverpoints are not affected: they count every sample unless they have guards of their own.

Training traffic counts in the coverpoints only
012lane, cmd0, cfg2, rdlink_upcoverpoints countyescross countsnoyes
Scroll horizontally ↔

The example's three transfers. The first is during link training, so only the coverpoints see it.

A per-bin guard, bins x = select iff (en), guards one cross bin instead (19.6).

Keeping a Cross Small Enough to Close

A cross has as many products as its coverpoints' bin counts multiplied together. Three 16-bin coverpoints make 4,096 products, and random stimulus will not visit them all. Shrink the cross before trying to close it.

TechniqueEffect on a 16 x 16 cross
Coarser coverpoint bins: 4 classes instead of 16 values16 products instead of 256
ignore_bins in a coverpointremoves a whole row or column of products
ignore_bins in the crossremoves only the combinations that are impossible
Cross only the pairs the plan asks abouttwo small crosses instead of one large one

Each product should be a combination the design treats differently.

Excluding a value inside a coverpoint shrinks every cross built on it. Crosses use only the counted bins of their coverpoints (19.6).

Try It

The cross has 16 - 2 - 1 = 13 bins. The training transfer counts for ln and cm (1 of 4 each) but not the cross: (25 + 25 + 0) / 3.

The second transfer is the same pair with the link up, so the cross gets 1 of 13. The third adds a lane, a command and a product. Predict the output of a write on lane 3 with the link down.

RUNVerilator (coverage build) · simulator service
Edit the code, then run it
Expected: lane=0 cmd=3 up=0: 16.67% lane=0 cmd=3 up=1: 19.23% lane=2 cmd=1 up=1: 38.46%

Check Yourself

Predict the outputPredict the exact output.
module tb;
  bit a, b;
  covergroup cg;
    ca: coverpoint a; cb: coverpoint b;
    x: cross ca, cb { ignore_bins diag = binsof(ca) intersect {0} && binsof(cb) intersect {0}; }
  endgroup
  cg c = new;
  initial begin
    a = 0; b = 1; c.sample();
    $display("%0.2f%%", c.get_inst_coverage());
  end
endmodule
ConceptA product is selected by both an ignore_bins and an illegal_bins of the same cross. What happens when it is sampled?
ConceptA cross has iff (link_up). A transfer arrives while the link is down. What counts it?
ConceptWhich change removes a whole row of products from every cross built on coverpoint a?

Common Mistakes

Wrong Leave impossible combinations in a cross and accept a number below 100%.

Nobody can tell a real hole from an impossible product, so real holes go unnoticed.

Fix Remove each impossible product with a cross ignore_bins, written from the rule that makes it impossible.

Before
x: cross ln, cm;
After
x: cross ln, cm {
  ignore_bins cfg_high = binsof(cm.cfg)
    && binsof(ln) intersect {[2:3]};
}

Wrong Put the link-up guard on a coverpoint when only the cross should wait for it.

The coverpoint then misses training traffic the plan wanted counted.

Fix Guard the cross: cross ln, cm iff (link_up).

Wrong Cross every coverpoint with every other "to be safe".

The products multiply into thousands that no regression can close.

Fix Cross only the pairs the plan asks about, with coarse bins.

Remember

  • A cross ignore_bins removes the products its select expression names, even from user bins.
  • A cross illegal_bins removes products and makes a hit an error, ahead of any ignore.
  • cross ... iff (expr) skips the cross at a sample; the coverpoints still count.
  • Excluding a coverpoint value removes its row from every cross on that coverpoint.
  • Keep crosses small: coarse bins, exclusions and only the pairs the plan needs.

Practice

Report a problem with this page