Functional Verification — Advanced
Fundamentals' covergroup tracked one dimension at a time — did counter_4bit reach each individual value. This page introduces cross coverage: tracking combinations of two or more coverage dimensions together, which catches an entire class of gap that single-dimension coverage misses completely. The running example is seq_detector_101 — reusing Overview's exact traced stimulus one more time, now viewed through a cross-coverage lens instead of a pass/fail lens.
Analogy — Single-dimension coverage is checking a restaurant menu to confirm every individual ingredient has been used in at least one dish over the year — flour, yes; tomatoes, yes; cheese, yes. Cross coverage is checking every specific COMBINATION — has the kitchen ever actually made a dish with flour AND tomatoes AND cheese together, at the same time, not just each ingredient separately in different dishes. A kitchen can score 100% on individual-ingredient coverage while never once having made a specific popular combination — exactly the gap cross coverage exists to catch.
Why Individual Coverage Bins Aren't Enough
Annotated Example — Cross Coverage From Overview's Exact Stimulus
Overview's exact input stream 1011010 was traced through seq_detector_101 starting from S0. Recording the (state, bit_in) pair present at EACH step of that exact trace:
Verified computationally by simulating the exact FSM logic against Overview's exact stimulus: this single 7-bit directed test — which achieved 100% of its OWN job (correctly detecting both "101" occurrences) — only reaches 66.67% cross coverage, leaving (S0, bit_in=0) and (S2, bit_in=0) completely untested. Neither gap is a bug in the design or the testbench; it's a genuine, quantified statement about what this ONE directed stimulus sequence does and doesn't exercise — exactly the kind of gap functional coverage (Fundamentals) and cross coverage (this page) exist to make visible rather than left as an unstated assumption.
Try It (2 Minutes)
Design a short additional stimulus sequence (starting fresh from S0 after a reset) specifically to hit the two missing cells, (S0, bit_in=0) and (S2, bit_in=0).
You should land on: applying bit_in=0 while in S0 (the very first bit of a fresh sequence, e.g., starting with "0...") hits (S0,0) immediately, since S0 is the reset state. To hit (S2,0), the FSM must first reach S2 (requires seeing "10" from S0: S0→S1 on a 1, S1→S2 on a 0) and then apply a 0 while in S2 (S2→S0 on that 0) — so the sequence "100" reaches state S2 and then applies 0, hitting (S2,0). Adding a short sequence like "0100" (which passes through (S0,0), then S0→S1, S1→S2, and (S2,0)) would hit both missing cells, bringing cross coverage from 4/6 to a full 6/6 = 100%, closing the gap Overview's original directed test alone left open.

