Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Paths
  • Concept Map
  • Meet DCRouter
  • Glossary
  • Part 0: What Verification Is8
  • Part 1: What Can Go Wrong11
  • Part 2: Specifications as Checkable Rules8
  • Part 3: Observability and Controllability7
  • Part 4: Stimulus11
  • Part 5: Checking11
  • Part 6: Coverage10
    • What Coverage Measures
    • Code Coverage
    • Functional Coverage Models
    • Crosses and the Combinatorial Explosion
    • Closure Curves
    • Holes and Unreachable Bins
    • Coverage-Driven Stimulus
    • Mutation Testing
    • A Coverage Model for DCRouter
    • Drills: Coverage
  • Part 7: Formal and Simulation10
  • Part 8: Verification Levels and Reuse8
  • Part 9: Planning and Risk9
  • Part 10: Emulation and Prototyping8
  • Part 11: Post-Silicon Validation8
  • Part 12: Bug Economics8
  • Part 13: Debug7
  • Part 14: Sign-Off7
  • Part 15: Verification in Context8
  • Part 16: Case Studies5
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 6: Coverage
  1. Topics
  2. First Principles of Verification Strategy
  3. Part 6: Coverage
  4. Crosses and the Combinatorial Explosion

Part 6 · Coverage · Senior (S)

Crosses and the Combinatorial Explosion

A cross of coverpoints has as many bins as the product of their sizes, so crossing everything with everything produces models no regression can close. The arithmetic, worked for DCRouter, and the techniques that keep crosses meaningful: grouping values, crossing only what interacts, ignoring impossible combinations, and pairwise coverage.

On this page

    Note

    Level: Senior (S) · Answers: How do we know we have tested enough?

    Before this: Functional Coverage Models, Configuration and Mode Bugs

    A reviewer asks for one more cross in DCRouter's coverage model: source input × destination × priority × every length × fault type × FIFO occupancy. Each coverpoint is modest. The cross has 4 × 4 × 2 × 16 × 3 × 9 = 13,824 bins. At the coupon collector's rate (lesson 4.2) that needs well over a hundred thousand random packets if every bin were equally likely, and they are not: high occupancy and faults are rare, so many bins would never close at all.

    Which crosses should a coverage model contain, and how do you keep them closable?

    The obvious answer, and why it breaks

    The obvious instinct is to cross everything that might interact, because bugs live in combinations (lesson 1.6). But the number of combinations multiplies, and so does the effort to fill them, while most of them exercise logic that does not interact at all. A model that cannot close produces a coverage number nobody believes and holes nobody reads.

    The idea: crosses multiply

    ∣cross(A1​,…,Ak​)∣=∣A1​∣×∣A2​∣×⋯×∣Ak​∣E[samples to fill n equally likely bins]≈nlnn

    Cross for DCRouter

    Bins

    Comment

    dst × prio × length class (4 classes)

    4 × 2 × 4 = 32

    Lesson 6.9's header cross: closes in tens of tests

    dst × prio × every length

    4 × 2 × 16 = 128

    Lesson 4.2: about 695 uniform packets

    src × dst × prio × length class

    4 × 4 × 2 × 4 = 128

    Adds the source; does any rule depend on it?

    src × dst × prio × every length × fault × occupancy

    13,824

    Unclosable, and mostly combinations of logic that does not interact

    Keeping crosses meaningful

    Technique

    How it shrinks the cross

    DCRouter example

    Group values into classes

    Values that behave alike share one bin

    Lengths 2 to 14 as one class: 16 values become 4

    Cross only what interacts

    Combine coverpoints that share logic or a rule

    Priority × destination matters (arbitration); source × CRC value does not

    Ignore or mark illegal

    Remove combinations that cannot or must not occur

    Bad CRC on a length-0 packet

    Cross with a condition

    Sample the cross only in the situation that matters

    Occupancy × push/pop only when a push arrives

    Pairwise coverage

    Every pair of values, not every tuple (fact M5)

    Four 4-valued configuration parameters: 16 configurations cover all pairs, against 256

    The question for every cross is the same: which logic would behave differently in this combination than in its parts? If none, the cross measures nothing new.

    Deciding on DCRouter's crosses

    • dst × prio × length class: yes, arbitration (R6) and length handling (R3 to R5) meet at the header.

    • fault type × priority × length class: yes, error reporting differs by priority (BUG_13) and length (BUG_12).

    • prio_en × contention: yes, as events: priority only matters when packets compete (lesson 5.10).

    • source input × CRC value: no, no logic depends on the pair.

    • occupancy × every length: no; occupancy × push/pop event, sampled on a push, instead.

    How real teams manage crosses

    Practice

    Purpose

    Cross reviews asking which logic each cross exercises

    Crosses that measure interaction, not volume

    Grouping, ignore and illegal bins as a matter of style

    Models sized to what a regression can close

    Pairwise or covering arrays for configuration spaces

    All pairs covered with few configurations

    What breaks

    A team (illustrative) added a 6-way cross of transaction attributes to their model and saw overall coverage drop from 95% to 41%. For the rest of the project the number was quoted with an asterisk, real holes in small crosses were lost among thousands of irrelevant empty bins, and the cross was eventually deleted without anyone examining it. Two well-chosen 2-way crosses would have measured the interactions that mattered and closed.

    Why this matters

    Senior lens. Size every cross before adding it: multiply the bins, estimate the samples to fill them at realistic probabilities, and name the logic that interacts. A cross that cannot close in the regression budget, or exercises no shared logic, should be grouped, conditioned or removed.

    Interview

    Asked: "Which crosses would you write?"

    Weak answer: Cross all the fields so every combination is tested.

    Strong answer: Only crosses where the combination exercises logic its parts don't. For a router: destination × priority × length class, because arbitration and length handling meet at the header; fault type × priority × length class, because error reporting varies with both. I group values that behave alike, mark impossible combinations illegal, condition crosses on the event that matters, and use pairwise coverage for configuration spaces. Crosses multiply: a 6-way cross of modest fields can reach tens of thousands of bins that no regression will close and that mostly measure nothing.

    Follow-ups: (1) How many samples to fill 128 equally likely bins? (2) When would you use pairwise coverage?

    Check yourself How many bins does src × dst × prio × length class have, and should DCRouter's model include it?

    4 × 4 × 2 × 4 = 128; only if some rule or risk depends on the source together with the rest. DCRouter's per-flow ordering does involve the source, so a source × destination cross can be justified; crossing it with priority and length adds little.

    Check yourself What does grouping lengths 2 to 14 into one class assume?

    That the design treats all middle lengths alike; if a length-dependent bug lived at, say, length 8, grouping would hide it, so the assumption must come from the specification and the design.

    Key takeaways

    • A cross has as many bins as the product of its coverpoints, and closing it costs about n ln n samples or far more.

    • Cross only what shares logic; group values, ignore impossible combinations, condition on events.

    • Use pairwise coverage for configuration spaces.

    Keep going

    Next: Lesson 6.5, Closure Curves. The closure curve, the plateau and what it means.

    Related topics

    • Part 6 overview: Coverage

    Previous

    65 / 160

    Next: Closure Curves

    Up next

    Up nextClosure Curves

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • What Coverage Measures
    • Code Coverage
    • Holes and Unreachable Bins