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.

Plan Rows Turning Green, Run by RunThe chip's coverage plan has ten groups of integration points. Each of the eight runs of the suite fills some of them for the first time. The groups that stay grey after the last run are where the next tests must go.
  • Bus
  • Processor
  • Clock / reset
  • Pads
  • Power
  • Debug
  • Test
  • Data
  • Interrupt
Plan Rows Turning Green, Run by RunThe chip's coverage plan has ten groups of integration points. Each of the eight runs of the suite fills some of them for the first time. The groups that stay grey after the last run are where the next tests must go. bus Routes 78 of 182 bins hit processor Interrupts incore states 14 of 61 bins hit bus DMA writes 4 of 27 bins hit clock reset Clock gates andresets 9 of 17 bins hit pads Pad selects 24 of 43 bins hit power Power states 12 of 12 bins hit debug Debug 1 of 4 bins hit test Firmwarescenarios 1 of 3 bins hit DMA is a managerchecked by C
  1. bus Routes78 of 182 bins hit
    • DMA is a manager → DMA writes
  2. processor Interrupts in core states14 of 61 bins hit
    • checked by C → Firmware scenarios
  3. clock reset Clock gates and resets9 of 17 bins hit
  4. pads Pad selects24 of 43 bins hit
  5. power Power states12 of 12 bins hit
  6. bus DMA writes4 of 27 bins hit
  7. debug Debug1 of 4 bins hit
  8. test Firmware scenarios1 of 3 bins hit
  1. Run 0: gpio on the processor

    New bins in: routes, interrupts in core states, clock gates and resets, pad selects, power states.

  2. Run 1: gpio on the seat

    New bins in: routes, interrupts in core states.

  3. Run 2: dma on the processor

    New bins in: routes, dma writes, pad selects.

  4. Run 3: dma on the seat

    New bins in: routes.

  5. Run 4: timer on the processor

    New bins in: routes, interrupts in core states.

  6. Run 5: timer on the seat

    New bins in: routes, interrupts in core states.

  7. Run 6: wake on the processor

    New bins in: routes, interrupts in core states, clock gates and resets, power states, debug, firmware scenarios.

  8. 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.

Five questions this page answers
Question
1What does a block bench's coverage already prove?
2What should a chip's coverage count instead?
3What is a bin, a hole and a tie-off in a chip ledger?
4Why does a plan give no points to the insides of a pre-verified block?
5What 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

New words on this page
WordMeaning
Integration coverageCoverage of what happens between blocks: routes, a block in a chip state, scenarios across blocks.
Coverage planThe list of points a team agrees to measure, each with a reason. A chip's plan is written from its integration tables.
BinOne counted point of the plan, such as "the timer's request rose while the core slept".
HoleA bin no passing test has hit yet.
Tie-offA 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.
LedgerThe table of every bin with its hit count and the test that hit it first.
SamplerBench 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.

Which rows each test fills
TestInterrupt arrivalsNew rowsRows hit
uart echouart while running, three times11 of 9
timer sleeptimer in wfi, timer while running23 of 9
gpio in handlergpio and timer while in a handler25 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

  1. 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.

  2. Rule 2: A pre-verified block gets no points of its own.

    Its connections, its clock, its reset and its interrupts still do.

  3. 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.

  4. 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.

  5. 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.

  6. 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:

Icarus Verilog version 12.0 (stable), the runnable example.
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 wfi

Rule 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.

The Ledger by Group
GroupWhat it countsBinsHit
visitRoutes: manager to target15657
windowRoutes by mode: processor or seat2621
irqInterrupts in each core state6114
dmaDMA writes and overlap with the core274
gateClock gates128
pinPad selects4324
powerPower states and edges1212
resetReset sources51
debugDebug halts, steps, locks41
firmwareScenarios reported by firmware31

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

ap_soc~12 blocks
Phone-class SoChundreds of blocks

This section looks ahead. ap_soc's plan fits on one page; a large chip's does not.

  1. 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.

  2. Coverage per subsystem

    A big chip is closed in layers: subsystems first, then the top level counts only what crosses between them.

  3. 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?

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: 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 wfi

Check Yourself

Predict the outputA fourth test makes the UART0 interrupt arrive in wfi. What is the fourth line printed?
// A coverage plan of integration rows: each device interrupt arriving in each state of the core.
// Plain counters, as the chip's coverage model keeps them (Icarus 12 has no covergroups).
module tb;
  int hits [1:3][0:2];
  int closed;
  function automatic string source_name(input int s);
    return s == 1 ? "uart" : s == 2 ? "gpio" : "timer";
  endfunction
  function automatic string state_name(input int c);
    return c == 0 ? "running" : c == 1 ? "in wfi" : "in handler";
  endfunction
  task automatic event_at(input int source, input int state);
    hits[source][state]++;
  endtask
  task automatic report(input string test);
    closed = 0;
    for (int s = 1; s <= 3; s++) for (int c = 0; c <= 2; c++) if (hits[s][c] > 0) closed++;
    $display("after %-15s %0d of 9 rows hit", test, closed);
  endtask
  initial begin
    event_at(1, 0);
    event_at(1, 0);
    event_at(1, 0);
    report("uart echo");
    event_at(3, 1);
    event_at(3, 0);
    report("timer sleep");
    event_at(2, 2);
    event_at(3, 2);
    report("gpio in handler");
    event_at(1, 1);
    report("uart sleep");
    for (int s = 1; s <= 3; s++) for (int c = 0; c <= 2; c++) if (hits[s][c] == 0) $display("hole: %s %s", source_name(s), state_name(c));
  end
endmodule
ConceptWhich is an integration coverage point?
ConceptWhy does reset.debug count as a tie-off and not a hole?
ConceptA processor core comes from a vendor, verified. What does the chip plan cover for it?
Conceptdebug.step is a hole in the ledger. What do you know?

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.

Practice

Report a problem with this page