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.
- External
- Debug
- Processor
- Bus
- Data
- Reset
- Debug
- A new drop
Designers release a new version of the chip. One wrong wire in it would make every test fail.
- The smoke runs first
One short program touches every part of the chip once and checks a value in each.
- Fail: stop early
A failing smoke sends the drop back in minutes, before the regression wastes a night.
- Pass: open the gate
Only a drop that passes runs the long regression.
- 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.
| Question | |
|---|---|
| 1 | Why does a regression need a gate in front of it? |
| 2 | What must a chip smoke touch? |
| 3 | How does the bench measure which windows a run touched? |
| 4 | Why must a smoke make one access fail on purpose? |
| 5 | What 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
| Word | Meaning |
|---|---|
| Smoke test | A short test that touches every part of the chip once, to show the drop is worth testing further. |
| RTL drop | One released version of the chip's design that tests run against. |
| Entry gate | A rule that the regression starts only after the smoke passes. |
| Region coverage | Which windows of the memory map a run touched, recorded by a passive monitor. |
| Visited bits | The 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.
| Bit | Window | Bit | Window |
|---|---|---|---|
| 0 | Boot ROM | 6 | Timer and PWM |
| 1 | ap_clint | 7 | ap_sysctl |
| 2 | ap_plic | 8 | SPI |
| 3 | SRAM | 9 | DMA |
| 4 | UART0 | 10 | Watchdog |
| 5 | GPIO | 11 | ap_pwrctl |
| 12 | An 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
Rule 1: Touch every window, and check a value there.
A reset value or a read-back turns a touch into a check.
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.
Rule 3: Take one interrupt and drive one pad.
They prove the request wires and the pin mux, which no register access reaches.
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.
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.
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=369All 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
This section looks ahead. ap_soc has twelve windows; one smoke covers them in a few hundred cycles.
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.
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.
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.
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) = 000010101100Check Yourself
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.