What Coverage Means at Chip Level
Decide what a chip's coverage should count. Not the blocks' insides again, but what happens between them: routes, interrupts in each core state, power, resets, pads and scenarios.
You Will Be Able To
- Tell a block coverage point from an integration coverage point, with an example of each.
- Read a chip coverage ledger: bins, hits, holes and tie-offs.
- Say why a chip coverage plan leaves the insides of pre-verified blocks out.
- Explain why a hole is information, not a failure.
- Lesson
- V12.1
- Time
- 26 min
- Runs on
- Your browser
- Check
- 5 questions
The week before tape-out, the coverage review is short. Every block team reports its own coverage closed. Then someone asks which test made the timer interrupt arrive while the core was asleep. Nobody knows. Nothing counted it.
- Bus
- Processor
- Clock / reset
- Pads
- Power
- Debug
- Test
- Data
- Interrupt
- Run 0: gpio on the processor
New bins in: routes, interrupts in core states, clock gates and resets, pad selects, power states.
- Run 1: gpio on the seat
New bins in: routes, interrupts in core states.
- Run 2: dma on the processor
New bins in: routes, dma writes, pad selects.
- Run 3: dma on the seat
New bins in: routes.
- Run 4: timer on the processor
New bins in: routes, interrupts in core states.
- Run 5: timer on the seat
New bins in: routes, interrupts in core states.
- Run 6: wake on the processor
New bins in: routes, interrupts in core states, clock gates and resets, power states, debug, firmware scenarios.
- Run 7: wake on the seat
New bins in: routes, interrupts in core states.
Read the diagram as text
- Routes: 78 of 182 bins hit
- Interrupts in core states: 14 of 61 bins hit
- DMA writes: 4 of 27 bins hit
- Clock gates and resets: 9 of 17 bins hit
- Pad selects: 24 of 43 bins hit
- Power states: 12 of 12 bins hit
- Debug: 1 of 4 bins hit
- Firmware scenarios: 1 of 3 bins hit
- Routes → DMA writes: DMA is a manager
- Interrupts in core states → Firmware scenarios: checked by C
docs/soc/chip-coverage.json: 349 bins after eight passing runs, 143 hit, 205 holes, 1 tied off.
Before You Start
The Coverage track teaches the language: What Coverage Measures, Covergroups and Coverpoints, Choosing Bins, Transitions, Cross Coverage and Coverage in a Class. Read them first if a covergroup is new. The fundamentals module defines coverage in The SoC Verification Toolbox.
| Question | |
|---|---|
| 1 | What does a block bench's coverage already prove? |
| 2 | What should a chip's coverage count instead? |
| 3 | What is a bin, a hole and a tie-off in a chip ledger? |
| 4 | Why does a plan give no points to the insides of a pre-verified block? |
| 5 | What does a hole tell you, and what does it not? |
The Idea: Count What Happens Between Blocks
Coverage measures what your tests made happen. It does not decide whether the chip was right; checkers do that. A test can pass and still never reach the corner you care about. Coverage tells you which corners your passing tests reached.
Each block of a chip arrives with its own coverage closed. Its bench drove every register field, every queue level, every error case. Measuring those again through the chip costs a lot and teaches little. The chip adds something no block bench had: the other blocks.
So chip coverage counts integration. Did every manager reach every target it may reach? Did each interrupt arrive while the core ran, slept and handled another? Did every clock gate close, every pad take every function, every reset source fire? Those are the points only the chip can measure.
New Words
| Word | Meaning |
|---|---|
| Integration coverage | Coverage of what happens between blocks: routes, a block in a chip state, scenarios across blocks. |
| Coverage plan | The list of points a team agrees to measure, each with a reason. A chip's plan is written from its integration tables. |
| Bin | One counted point of the plan, such as "the timer's request rose while the core slept". |
| Hole | A bin no passing test has hit yet. |
| Tie-off | A bin that can never be hit on this chip, because its input is tied to a constant. It is listed with its reason, not counted as a hole. |
| Ledger | The table of every bin with its hit count and the test that hit it first. |
| Sampler | Bench code bound into the chip that counts each bin when its event happens. |
The Smallest Example: Three Interrupts, Three Core States
Take three device interrupts of ap_soc: UART0 (source 1), GPIO (2) and the timer (3). The core can be running, asleep in wfi, or already inside a handler. The plan crosses them: nine rows. Three tests run in turn. Work out the rows by hand.
| Test | Interrupt arrivals | New rows | Rows hit |
|---|---|---|---|
| uart echo | uart while running, three times | 1 | 1 of 9 |
| timer sleep | timer in wfi, timer while running | 2 | 3 of 9 |
| gpio in handler | gpio and timer while in a handler | 2 | 5 of 9 |
The same three tests run in the example below. Arrivals that repeat a row add hits, not rows.
The first test hit one row three times: more hits, not more coverage. After three tests four rows are still holes, among them uart in wfi. No block bench could have filled any of these nine rows. Each needs a core and a device together.
The Rules
Rule 1: Count between blocks, not inside them.
A point belongs in the chip plan when it needs two blocks, or a block in a state of the chip. A block's insides belong to its bench.
Rule 2: A pre-verified block gets no points of its own.
Its connections, its clock, its reset and its interrupts still do.
Rule 3: Sample where the event is visible.
When a wire shows the event, the bench counts it. When only software can know, firmware reports it, and a bench point backs it up.
Rule 4: Every bin has a reason, and every tie-off has a written one.
A bin nobody can explain is noise. A bin that can never be hit is listed with why.
Rule 5: A hole is information.
It says no passing test reached that point. It does not say the chip is wrong there, or right.
Rule 6: Hits are counts, coverage is rows.
Running a test ten times adds hits. Only new rows add coverage.
Sources for These Rules
Functional coverage at SoC level is applied to the interfaces between blocks, plus internal points of blocks not verified elsewhere. A pre-verified processor gets no coverpoints of its own. Code coverage is used beside it: MEHTA-DV 16.9 (PDF p327-328).
The bins, their sampling edges and the tie-off of reset.debug: tools/soc/ap_soc/bench/soc_tb/README.md, "Chip coverage (E11)", and facts §27.15.
Covergroups, bins and crosses as a language: the Coverage track (lessons C1 to C6) and IEEE 1800 clause 19.
The Lab: The Chip's Own Ledger
First the toy of the worked example, on the site's Icarus. The plan is counted with plain integers:
after uart echo 1 of 9 rows hit
after timer sleep 3 of 9 rows hit
after gpio in handler 5 of 9 rows hit
hole: uart in wfi
hole: uart in handler
hole: gpio running
hole: gpio in wfiRule 6 at work in the first line: three uart arrivals, one row. The holes printed last are exactly the rows no test reached.
Now the chip. Stage E11 bound a sampler into the chip bench and ran eight passing tests. GPIO, DMA, timer and a software wake each ran on the processor and on the bus-manager seat. The ledger has 349 bins. 143 are hit, 205 are holes and 1 is a tie-off.
| Group | What it counts | Bins | Hit |
|---|---|---|---|
| visit | Routes: manager to target | 156 | 57 |
| window | Routes by mode: processor or seat | 26 | 21 |
| irq | Interrupts in each core state | 61 | 14 |
| dma | DMA writes and overlap with the core | 27 | 4 |
| gate | Clock gates | 12 | 8 |
| pin | Pad selects | 43 | 24 |
| power | Power states and edges | 12 | 12 |
| reset | Reset sources | 5 | 1 |
| debug | Debug halts, steps, locks | 4 | 1 |
| firmware | Scenarios reported by firmware | 3 | 1 |
docs/soc/chip-coverage.json, eight passing runs (stage E11).
Rule 1 shaped every row: none of them is inside one block. Rule 4 shows in the tie-off: reset.debug can never fire, because the v1.5 debug module ties debug_reset_req low. Rule 5 shows in the debug group: debug.lock was hit, debug.step never. No test of the suite stepped the core, so the ledger says nothing about stepping either way.
Rule 4 also bites in the route group. Every route bin has a read twin and a write twin, and 69 of the holes are such twins. Some need a decision rather than a test. visit.core.rom.write is a write to read-only memory, which the ROM answers with an error. The plan must either keep it as an error-path target or ignore it with a written reason.
Why It Is Built This Way
Why not just run every block's coverage model again inside the chip? You could, and some teams do for a few blocks. But a chip test runs far slower than a block test, and a block point hit again proves nothing new. The chip's cycles are better spent on points only it can reach.
Why keep ties out of the holes? Because a hole is a call to action, and a tie-off is not. Count it as a hole and the team chases an impossible test. Hide it and the next revision, where the input is no longer tied, loses the bin. A listed reason keeps both honest.
Traps
The first trap is the borrowed percentage. A team reports chip coverage as the mean of the block reports. Every block is near 100 percent, so the chip looks done. The interrupt that arrives during sleep was never in any of those models, so the number cannot see it missing.
The second trap is the plan written from the register map. It has a bin for every field of every register: hundreds of points, each a block point again. The routes, the core states and the power edges are not in the map, so they are not in the plan.
The third trap is reading a hole as a bug. A hole on debug.step does not mean stepping is broken. It means no test stepped. The fix is a test, and only that test can tell you whether stepping works.
At Scale
This section looks ahead. ap_soc's plan fits on one page; a large chip's does not.
Plans from integration tables
Large teams generate bins from the connection tables, the map's routes and the power intent. A new wire then gets its bin by itself.
Coverage per subsystem
A big chip is closed in layers: subsystems first, then the top level counts only what crosses between them.
Owners per bin
Every bin has a named owner who writes its test or its waiver.
Try It
Run it: three tests, nine rows, and the holes they left.
Add a fourth test, uart in wfi (the predict question below). Which line changes?
Make the first test fire three different sources. How many rows does it fill now?
after uart echo 1 of 9 rows hit after timer sleep 3 of 9 rows hit after gpio in handler 5 of 9 rows hit hole: uart in wfi hole: uart in handler hole: gpio running hole: gpio in wfiCheck Yourself
Common Mistakes
Wrong Report chip coverage as the mean of the blocks' coverage.
The blocks' models contain none of the points between blocks.
Fix Write a chip plan of integration points and measure it on the chip.
Wrong Count a tied-off point as a hole.
No test can ever hit it on this chip; the team chases an impossible test.
Fix List it as a tie-off with its reason from the connection table.
Wrong Read a hole as a bug.
A hole says no passing test reached the point, nothing more.
Fix Write the test that reaches it; its checks decide.
Remember
- Chip coverage counts what happens between blocks; the blocks counted their own insides.
- A ledger lists every bin with its hits and its first test; holes and tie-offs are kept apart.
- Repeats add hits, not coverage.
- A hole is a missing test, not a known bug.