The Bench in One Picture
A chip bench has two kinds of part. Active models play the board on the pads, and passive checkers only listen. See every part of soc_tb at work in one recorded run, and learn what each one is for.
You Will Be Able To
- Name the parts of a chip bench and sort them into active and passive.
- Explain why a chip bench drives only the pads and listens everywhere else.
- Read one run's result block and checker lines to say what each part did.
- Place a new bench part on the picture before you build it.
- Lesson
- V3.1
- Time
- 22 min
- Runs on
- Your browser
- Check
- 5 questions
Your firmware passed on the bench for a week. Then someone asked a simple question: which part of the bench said "pass"? Nobody could answer. A bench that nobody can draw is a bench nobody can trust.
- Processor
- Manager
- Pads
- Clock / reset
- File
- Test
- Result
- Sequence
- Data
- Clock
- Control
- The chip and its seat
The chip is unchanged. Its core sits in a seat that can hold the processor or a bus manager.
- Active parts on the pads
Models play the board: they drive the chip's inputs and listen to its outputs, pads only.
- Passive parts inside
Checkers are bound onto buses and ports. They read and never drive.
- Start and end
A front end supplies the test; the end-of-test rules turn everything that happened into one verdict.
Read the diagram as text
- ap_soc v1.5: the design under test
- Core seat: ap_rv32 or a bus manager
- Pad models: UART, GPIO, SPI flash, JTAG
- Clock, reset, straps: the board
- Back-door loader: ROM and SRAM images
- Passive checkers: buses, blocks, the model, the mailbox
- End of test: one result block
- Test front ends: image, table, host C, UVM
- Pad models → ap_soc v1.5: drive and listen
- Clock, reset, straps → ap_soc v1.5: CLK, RST_N, BOOT
- Back-door loader → ap_soc v1.5: zero time
- ap_soc v1.5 → Passive checkers: read only
- Passive checkers → End of test: errors
- Test front ends → Core seat: the test
The picture of plan §3.4, drawn from the bench manual (tools/soc/ap_soc/bench/soc_tb/README.md).
Before You Start
Read Where You May Look: Black, Grey and White Box and The First Run first. They show one run of ap_soc and the windows a check can look through.
| Question | |
|---|---|
| 1 | Why does a chip bench drive only the pads? |
| 2 | What is the difference between an active and a passive part? |
| 3 | Which parts of soc_tb start a test, and which end it? |
| 4 | What did each part do in one recorded run? |
| 5 | Where would a new check go on the picture? |
The Idea: Play the Board, Listen to the Rest
A block bench owns every pin of its block, so it can drive anything. A chip bench cannot. The chip's customers reach it through its pads, its software and its debug port, and the bench must do the same. So a chip bench plays the board around the chip and nothing more.
It still needs to see inside, because a hang at the pads says nothing about where it started. The answer is to split the bench in two. Active parts drive the pads, the way the board will. Passive parts listen on buses and ports inside, and they never drive a single wire. Then a pass means the chip did the work, not the bench.
New Words
| Word | Meaning |
|---|---|
| Chip bench | The test bench of a whole chip; here soc_tb around ap_soc v1.5. |
| Active part | A part of the bench that drives signals: a model on the pads, a loader, the clock and reset. |
| Passive part | A part that only reads: a checker, a monitor, the model compare. |
| Pad model | Bench code that plays one device of the board on the chip's pads, such as the UART or the SPI flash. |
| Seat | The place of the core in ap_core_slot. It holds the processor, or a bus manager the bench drives. |
| Front end | What a test is written in: a firmware image, a sequence table, C on the host, or UVM sequences. |
| Result block | The lines between SOC_RESULT_BEGIN and SOC_RESULT_END: the verdict and every count of a run. |
The Smallest Example: Sort the Parts
Before the lab, sort the parts on the picture by one question: does it drive a wire of the chip?
| Part | Drives | Reads | Kind |
|---|---|---|---|
| Clock, reset, straps | CLK, RST_N, BOOT, the supply | Active | |
| Back-door loader | the flops of ROM and SRAM, before the first edge | Active (bench control) | |
| UART, GPIO, SPI flash, JTAG models | the input pads | the output pads | Active |
| AHB checkers (9), APB checkers (2) | every manager and target port, both APB buses | Passive | |
| Block monitors (4) | UART0, SPI, timer and PWM, DMA | Passive | |
| Retire trace against ap_iss | the core's trace port | Passive | |
| Mailbox monitor | bus writes to TB_STATUS, TB_PUTC, TB_EVENT | Passive | |
| End-of-test control | nothing in the chip | every count above | Bench control |
From the bench manual and soc_tb.sv. The counts are the instances in soc_tb.sv.
The Rules
Rule 1: Drive only what the board drives.
Pads, the clock, the reset pin, the straps and the supply. Everything inside the chip is the chip's.
Rule 2: Listen everywhere you need to.
Passive checkers may sit on any bus or port, because they cannot change what the chip does.
Rule 3: One part, one job.
A pad model plays its device; a checker checks its rules; the end-of-test control decides.
Rule 4: The test is separate from the bench.
The bench is compiled once. A test changes only files and plusargs.
Rule 5: One run, one verdict.
Every part reports into one result block, and the end-of-test rules turn it into pass or fail.
Sources for These Rules
The parts and their wiring: tools/soc/ap_soc/bench/soc_tb/README.md and soc_tb.sv; docs/soc-verification-plan.md §3.4.
Passive monitors, active agents, and why a monitor never drives: UVM Cookbook, Testbench Architecture (UVM-CB). IEEE 1800.2-2020 defines uvm_active_passive_enum in F.2.
The board-only rule is this track's choice for chip-level tests; plan §2.1 explains it.
The Lab: One Run, Every Part
One assembly program ran on the site's pre-built chip bench, in SRAM. It sends the byte B out of the UART pad and asks the SPI flash for its identity. It drives GPIO pad 6 and reads pad 7, then asks the bench for a byte on the UART receive pad. Meanwhile the bench reads IDCODE over the JTAG pads. Rule 1 at work: every one of those is a pad.
EVENT 217: 00000031
ARG 300: 00000031
CONSOLE 927: flash=00c0ffee gpio_in=000000e3 uart_rx=0000006bThe console line holds what the chip saw. The flash answered c0ffee through the SPI pads. GPIO IN reads e3. Pad 7 followed pad 6 through the board's wire. Pads 0, 1 and 5 are high because their idle level is 1. The byte 6b is the k the UART model sent.
verdict=pass
compares=511
mismatches=0
uart_bytes=1
spi_frames=1
jtag_scans=1
checker_errors=0Rule 5 at work: one block says what everyone did. The model compared 511 retired instructions with ap_iss and found no mismatch. The UART model received 1 byte, the flash model answered 1 frame, the JTAG host made 1 scan.
fast APB: checker: 59 writes, 38 reads, 0 wait edges, 0 rules broken, 0 notes
slow APB: checker: 0 writes, 0 reads, 0 wait edges, 0 rules broken, 0 notes
AHB, core data port: checker: 124 transfers, 97 wait edges, 0 errors, 0 rules broken
AHB, port to bridge: checker: 97 transfers, 97 wait edges, 0 errors, 0 rules broken
AHB, SRAM port: checker: 936 transfers, 0 wait edges, 0 errors, 0 rules brokenRule 2 at work. The fast APB checker counted 59 writes and 38 reads. The AHB checker on the matrix's port to the APB bridge counted the same 97 transfers. The one on the core's data port counted 124, the bus_transfers of the result block. Of those, 97 went to the APB bridge and the rest to SRAM. The slow APB checker saw nothing, because the program never touched the watchdog or ap_pwrctl.
Of the 9 AHB checkers, 5 saw no transfer at all. They are the debug and DMA managers, and ROM, CLINT and PLIC, which the program never used. Every one of the 11 lines says 0 rules broken, and none of the checkers drove a wire. Three of them counted the same transfers from three places, and they agree.
Why It Is Built This Way
The obvious shortcut is to let the bench poke inside the chip: write a register by force, hold an interrupt line high. It saves a few cycles and costs the meaning of the test. A forced register proves the force works, not the bus path a customer's software will use.
The split also lets the same bench serve every kind of test. The core's seat changes, the front end changes, and the pad models and checkers stay. Module V3 builds each part in turn; the last lesson flips the seat.
Traps
The quiet trap is a checker that drives. Picture a checker that sees an unknown bit on a data bus. It drives the bus to 0, so the run can go on. The run passes. On silicon that unknown bit is a bus nobody drives, and the read returns whatever the wires float to. The helper turned a real bug into a pass.
The second trap is a part with two jobs. A UART model that also decides pass or fail cannot be reused by a test that expects a framing error. Keep the model a model, and let the checkers and the end-of-test rules decide.
At Scale
This section looks ahead. soc_tb has four pad models and sixteen passive parts; a phone-class SoC bench has hundreds.
Verification IP
Pad models for USB, PCIe or DDR are bought as verification IP. They stay active parts on the pads, with the same split.
Bound checkers by the hundred
Every bus and every block boundary carries a checker. Bench code names them in one file, so a rename is one edit.
Emulation
On an emulator the pad models become transactors and the checkers move into synthesizable form. The picture stays the same.
Try It
Run it: one driver sends three bytes; the monitor counts them; the checker looks for unknown bits.
Change one byte to 8'b0100_x011 and predict the verdict before you run it (the check below).
Make the checker drive data back to a known value when it sees x. What would the verdict then prove?
driver sent 3, monitor saw 3, checker errors 0 verdict: passCheck Yourself
Common Mistakes
Wrong Let a checker fix up a signal so the test can go on.
A part that drives a chip signal changes the chip under test.
Fix Keep checkers passive; drive only pads, through a model.
Wrong Put the pass or fail decision inside a pad model.
The model can then not be reused by a test that expects an error from the device.
Fix Models model; checkers and the end-of-test rules decide.
Wrong Trust the pass word alone.
Firmware can write 0x900D without the chip doing the work.
Fix Read the result block: models, monitors and checkers each say what they saw.
Remember
- A chip bench plays the board on the pads and listens everywhere else.
- Active parts drive: pad models, clock and reset, the loader. Passive parts only read: checkers, monitors, the model compare.
- The test is a separate front end; the bench is compiled once.
- Every part reports into one result block; the end-of-test rules give one verdict.