The Smoke Test as the Entry Gate

One broken wire can fail every test of a night's regression. A smoke test runs first, touches every part of the chip once, and stops a bad drop in seconds. Learn what a smoke must touch, and measure its reach with the bench's region map.

You Will Be Able To

  • Explain why a chip regression needs an entry gate.
  • List what a chip smoke must touch: every window, a hole, an interrupt, a pad, the pass word.
  • Decode the bench's visited bits and find the windows a test never reached.
  • Say what region coverage proves and what it does not.
Lesson
V2.3
Time
22 min
Runs on
Your browser
Check
5 questions

Monday morning. The overnight regression shows 412 failures out of 412 tests, and every log ends the same way. A wire into the boot ROM was renamed on Friday, and the chip never fetched an instruction. A two-second test could have refused that drop on Friday evening.

A Gate in Front of the RegressionStep through one RTL drop. The smoke decides, in seconds, whether the night of machine time is worth spending.
  • External
  • Debug
  • Processor
  • Bus
  • Data
  • Reset
  • Debug
A Gate in Front of the RegressionStep through one RTL drop. The smoke decides, in seconds, whether the night of machine time is worth spending. external RTL drop a new version of thechip debug Smoke test every region, oneinterrupt, one pad,one hole processor Regression hundreds of tests,hours of machines external Back to design the drop is refused bus Bus monitor visited bits: whichwindows answered build, runpass: open the gatefail: stopproves what ittouched
  1. external RTL dropa new version of the chip
    • build, run → Smoke test
  2. debug Smoke testevery region, one interrupt, one pad, one hole
    • pass: open the gate → Regression
    • fail: stop → Back to design
  3. external Back to designthe drop is refused
  4. processor Regressionhundreds of tests, hours of machines
  5. bus Bus monitorvisited bits: which windows answered
    • proves what it touched → Smoke test
  1. A new drop

    Designers release a new version of the chip. One wrong wire in it would make every test fail.

  2. The smoke runs first

    One short program touches every part of the chip once and checks a value in each.

  3. Fail: stop early

    A failing smoke sends the drop back in minutes, before the regression wastes a night.

  4. Pass: open the gate

    Only a drop that passes runs the long regression.

  5. Prove the reach

    A passive bus monitor records which windows the smoke really touched, so the smoke's reach is measured, not assumed.

Read the diagram as text
  • RTL drop: a new version of the chip
  • Smoke test: every region, one interrupt, one pad, one hole
  • Regression: hundreds of tests, hours of machines
  • Back to design: the drop is refused
  • Bus monitor: visited bits: which windows answered
  • RTL drop → Smoke test: build, run
  • Smoke test → Regression: pass: open the gate
  • Smoke test → Back to design: fail: stop
  • Bus monitor → Smoke test: proves what it touched

The entry gate of a chip regression. The visited bits are the bench's own region map of ap_soc v1.5.

Before You Start

Read The First Run first: the smoke is the first run grown up. The Chip-Level Verification Plan explains the regression it guards.

Five questions this page answers
Question
1Why does a regression need a gate in front of it?
2What must a chip smoke touch?
3How does the bench measure which windows a run touched?
4Why must a smoke make one access fail on purpose?
5What does a visited bit not prove?

The Idea: Cheap Before Expensive

A chip regression is expensive: hundreds of tests, each with a boot, often hours of machines. If the drop is broken at the root, every test fails for the same reason, and the night is lost. Worse, a thousand failures hide the one real new bug.

So teams put a gate in front. The smoke test is short and broad. It makes one access to every window of the map, takes one interrupt and sends one byte out of a pad. It makes one access that must fail, and ends with the pass word. It checks a known value at each stop. If any part of the spine is broken, the smoke fails in seconds and the drop goes back.

Broad matters more than deep. The smoke does not test the UART's rare cases; it tests that the UART answers at its address. The regression is for depth.

New Words

New words on this page
WordMeaning
Smoke testA short test that touches every part of the chip once, to show the drop is worth testing further.
RTL dropOne released version of the chip's design that tests run against.
Entry gateA rule that the regression starts only after the smoke passes.
Region coverageWhich windows of the memory map a run touched, recorded by a passive monitor.
Visited bitsThe bench's region coverage: bits 0 to 11 for the twelve windows, bit 12 for an ERROR answer.

The Smallest Example: Decode a Visited Word

The bench prints visited as four hex digits. Each bit is one window, in this order, from the bench manual.

The visited bits of soc_tb
BitWindowBitWindow
0Boot ROM6Timer and PWM
1ap_clint7ap_sysctl
2ap_plic8SPI
3SRAM9DMA
4UART010Watchdog
5GPIO11ap_pwrctl
12An ERROR answer

Bits 4 to 9 follow the select order of the fast APB, and bits 10 and 11 the slow APB. Bit 12 is set when the core's data port gets an ERROR.

Decode the hello program of the last lesson: visited = 0089. That is bits 0, 3 and 7: Boot ROM, SRAM, ap_sysctl. It fetched from ROM, used the stack in SRAM and wrote the mailbox. Nine windows were never touched.

The Rules

  1. Rule 1: Touch every window, and check a value there.

    A reset value or a read-back turns a touch into a check.

  2. Rule 2: Make one access fail on purpose.

    A read of a hole must answer ERROR, and the smoke must survive it with a trap handler.

  3. Rule 3: Take one interrupt and drive one pad.

    They prove the request wires and the pin mux, which no register access reaches.

  4. Rule 4: Stay short and repeatable.

    Seconds, not minutes, and the same answer on every run of the same drop. A gate that fails at random gets switched off.

  5. Rule 5: Measure the reach.

    Read the visited bits; do not assume the smoke touched what its comments say.

Sources for These Rules

The visited bits: tools/soc/ap_soc/bench/soc_tb/README.md ("The result block"); facts 27.13.

A hole answers ERROR: facts 27.6 and 27.7.

The stage E4 smoke programs that visit all twelve windows: docs/soc-verification-plan.md 3.10 (E4).

Regressions run on server farms: Mehta, ASIC/SoC Functional Design Verification, section 15.5.5. A quick smoke level that gates turn-in: Seligman and others, Formal Verification (2nd ed.), chapter 11, Table 11.1. It is written for formal regressions; the idea is the same.

Now Run It: Three Programs, Three Reaches

Three programs ran on the chip bench: the hello program, the interrupt lab, and the chip's own stage E4 smoke. Here is what the bench's region map saw.

Measured on our bench (soc_tb on Verilator 5.052 2026-09-05).
hello program:         verdict=pass visited=0089 interrupts=0 traps=0 cycles=815
interrupt lab:         verdict=pass visited=00ac interrupts=3 traps=3 cycles=1116
stage E4 smoke:        verdict=pass visited=1fff interrupts=0 traps=5 cycles=369

All three passed. Only the last one comes close to a gate. Its visited word is 1fff: all twelve windows and bit 12, an ERROR answer. Its 5 traps are the accesses it made to fail on purpose, each caught by its handler: rule 2.

Even this smoke is not a full gate. It took 0 interrupts and sent 0 bytes out of a pad, so rule 3 is not kept. A broken request wire or pin mux would pass it. The practice problem closes that gap.

Notice its size: 369 cycles, fewer than hello. Breadth is cheap. On this bench, starting the process costs more than running the smoke. A 20-cycle run takes 7 ms on the laptop and 28 ms on the server (facts 27.13). Rule 4 is easy to keep.

Why It Is Built This Way

Why measure reach with a bus monitor, and not by reading the smoke's code? Because code says what it means to do. The monitor sees what the fabric selected, for any test, without changing the test. When someone edits the smoke next year and a window drops out, the visited word shows it on the first run.

Why start with one broad smoke, and not a quick test for each block? Because the gate exists for faults that break everything: clocks, resets, the fabric, the boot path. One broad program finds those best. Large teams grow it into a short set of smokes, as the last section shows, and each one stays broad and short.

The Trap: A Touch Without a Check

A visited bit means the fabric selected that window at least once. It does not mean the value read was right, or that the smoke even looked at it. A smoke that loads from every window and checks nothing sets all twelve bits. It passes on a chip whose registers are all wrong.

Bit 12 has a quieter limit. It says some access answered ERROR, not which one. A read of a write-only register sets it as surely as a read of a hole. So a smoke must check its own values, and count its own traps; the region map only proves its reach. The practice problem asks for a smoke that does both.

At Scale

ap_soc~12 blocks
Phone-class SoChundreds of blocks

This section looks ahead. ap_soc has twelve windows; one smoke covers them in a few hundred cycles.

  1. Several smokes

    Large chips run a short set: a smoke with the core, one with the bus manager, one per power mode. Each must pass before the regression.

  2. Gates everywhere

    The same idea guards check-ins: a change to the bench or the firmware kit must pass the smoke before it is merged.

  3. Coverage at chip scale

    Region coverage is the first line of chip coverage. Module V12 merges it with routes, interrupts and modes across a whole regression.

Try It

Run the slice: it maps the pages the interrupt lab touched onto the twelve windows.

Compare the last line with the bench's visited word for that run, 0x00ac.

Add the page 0x1000_7000. Predict the result, and say why the slice cannot show bit 12.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: not visited: bit 0, Boot ROM not visited: bit 1, ap_clint not visited: bit 4, UART0 not visited: bit 6, Timer and PWM not visited: bit 8, SPI not visited: bit 9, DMA not visited: bit 10, Watchdog not visited: bit 11, ap_pwrctl visited (bits 11 to 0) = 000010101100

Check Yourself

Predict the outputTwo pages are added to the interrupt lab's list: 0x1000_0000 and 0x1000_3000. What is the last line the slice prints?
// The twelve device windows of map.json v1.5, in the order of the bench's visited bits (0 to 11),
// and the 4 KiB pages that one run's loads and stores touched (from its retire trace).
module tb;
  localparam int W = 12, P = 9;
  string       name [W];
  logic [31:0] base [W], size [W], page [P];
  logic [11:0] visited = 0;
  initial begin
    name[0] = "Boot ROM"; base[0] = 32'h00000000; size[0] = 32'h00001000;
    name[1] = "ap_clint"; base[1] = 32'h02000000; size[1] = 32'h00010000;
    name[2] = "ap_plic"; base[2] = 32'h0c000000; size[2] = 32'h00400000;
    name[3] = "SRAM"; base[3] = 32'h80000000; size[3] = 32'h00010000;
    name[4] = "UART0"; base[4] = 32'h10000000; size[4] = 32'h00001000;
    name[5] = "GPIO"; base[5] = 32'h10001000; size[5] = 32'h00001000;
    name[6] = "Timer and PWM"; base[6] = 32'h10002000; size[6] = 32'h00001000;
    name[7] = "ap_sysctl"; base[7] = 32'h10004000; size[7] = 32'h00001000;
    name[8] = "SPI"; base[8] = 32'h10005000; size[8] = 32'h00001000;
    name[9] = "DMA"; base[9] = 32'h10006000; size[9] = 32'h00001000;
    name[10] = "Watchdog"; base[10] = 32'h10003000; size[10] = 32'h00001000;
    name[11] = "ap_pwrctl"; base[11] = 32'h10008000; size[11] = 32'h00001000;
    page[0] = 32'h80000000;
    page[1] = 32'h10004000;
    page[2] = 32'h8000f000;
    page[3] = 32'h10001000;
    page[4] = 32'h0c000000;
    page[5] = 32'h0c002000;
    page[6] = 32'h0c200000;
    page[7] = 32'h10000000;
    page[8] = 32'h10003000;
    for (int p = 0; p < P; p++)
      for (int w = 0; w < W; w++)
        if (page[p] >= base[w] && page[p] < base[w] + size[w]) visited[w] = 1;
    for (int w = 0; w < W; w++) if (!visited[w]) $display("not visited: bit %0d, %s", w, name[w]);
    $display("visited (bits 11 to 0) = %b", visited);
  end
endmodule
ConceptWhy does a regression need a smoke in front of it?
ConceptWhich result proves the smoke reached the slow APB?
ConceptA smoke sets all thirteen visited bits. What can you still not conclude?
ConceptWhy must a smoke read a hole?

Common Mistakes

Wrong Write a smoke that touches every window and checks nothing.

Every visited bit sets on a chip whose registers are wrong.

Fix Check a reset value or a read-back at every stop.

Wrong Leave holes out of the smoke.

A decoder that answers a hole is a chip bug; only a probe of the hole finds it.

Fix Read one hole, expect ERROR, and handle the trap.

Wrong Make the smoke deep.

A long gate delays every drop and duplicates the regression.

Fix Keep it broad and short; leave depth to the regression.

Remember

  • The smoke is the entry gate: short, broad, run on every drop before the regression.
  • It touches every window with a check, reads a hole, takes an interrupt and drives a pad.
  • The bench's visited bits measure a run's reach without changing the test.
  • A visited bit proves a touch, not a check; bit 12 does not say which access failed.

Practice

Report a problem with this page