Taking the Core Out
Put a bus manager in the core's seat and see what it buys: exact control, quick tests and an early start. Then see what it costs: no instruction runs, so nothing that needs one is tested.
You Will Be Able To
- Say what a test gains when a bus manager takes the core's seat, and what it loses.
- Decide, for a planned check, whether it needs real instruction flow.
- Read a seat's run of an interrupt that ends at a pin instead of a handler.
- Explain why a team keeps both modes all the way to tape-out.
- Lesson
- V6.1
- Time
- 24 min
- Runs on
- Your browser
- Check
- 5 questions
The chip's blocks are integrated, but the processor still fails some of its own tests. Must every register test wait for a core that can run C?
Teams answer no: they put a model of the core's bus port in its seat. This lesson is about when that pays, and what it hides.
- Test
- Manager
- Processor
- Bus
- Peripheral
- Control / FSM
- Control
- Data
- Interrupt
- The core steps out
The processor is held in reset. Nothing fetches, nothing retires, no handler can run.
- The bench steps in
Each row of the test becomes one bus transfer of the seat, with exactly the address, size and timing it names.
- The chip is the same
The fabric and every block are the same RTL as with the processor.
- Pins are watched
An interrupt reaches the seat as a pin level. The seat can test it; it cannot trap on it.
Read the diagram as text
- Test: a table, C on the host, or UVM
- Bus-manager seat: in ap_core_slot
- ap_rv32: held in reset
- AHB-Lite fabric: unchanged
- DMA, ap_plic, ...: unchanged
- Interrupt pins: software, timer, external
- Test → Bus-manager seat: one transfer a row
- Bus-manager seat → AHB-Lite fabric: exact transfers
- AHB-Lite fabric → DMA, ap_plic, ...: the same routes
- DMA, ap_plic, ... → Interrupt pins: requests
- Interrupt pins → Bus-manager seat: watched, never taken
ap_core_slot in the simulation view (tools/soc/ap_soc/bench/ap_core_slot.sv) and the seat ap_core_seat.sv; plan §3.6.
Before You Start
Read One Bench, Two Modes and Interrupt Tests End to End first.
| Question | |
|---|---|
| 1 | What does a test gain when the seat replaces the core? |
| 2 | What does it lose? |
| 3 | How does a test without a core check an interrupt? |
| 4 | Why is a table on the seat cheaper than the same rows on the processor? |
| 5 | Which checks must still run with the core? |
The Idea: Test the Chip Around the Core
A chip test needs something that makes bus transfers. Firmware on the processor is the honest choice: it is what the product will run. But firmware needs a working core, a compiler, start-up code and a boot. It also only makes the transfers a compiler chooses.
A bus manager in the seat needs none of that. The bench tells it each transfer: the address, the size, the data and when. So the test is quick to write and does exactly what it says. The price is plain. No instruction runs, so traps, handlers, start-up code and the agreement between software and registers go untested.
So the question for each check is simple. Does it need an instruction to run? If not, the seat is usually the cheaper and sharper tool.
New Words
| Word | Meaning |
|---|---|
| Bus-manager seat | Bench code with the core's exact data-port pins that makes transfers the bench asks for; it starts transfers but runs no instructions. |
| Without-CPU mode | +core=bfm: the processor is held in reset and the seat drives its data port. |
| Instruction flow | What only a running core makes: fetches, traps, handler entry and return, the stack, start-up code. |
| Pin row | A table row that tests an interrupt pin's level (core irq) or waits for it (core wait_irq). |
| Claim and complete | Reading ap_plic's claim register takes the highest pending source; writing its number back ends it. |
| Front end | The form a without-CPU test is written in: a sequence table, C on the host, or UVM sequences. |
The Smallest Example: Who Sees the Interrupt, and When
A request rises at cycle 53. The seat looks at the pin every cycle. A toy core only notices it between instructions, which end on multiples of 3. Then it needs 6 cycles to reach its handler. Work it out before you read the table.
| Observer | Sees the request at | Then |
|---|---|---|
| Seat | cycle 53 | reads the claim register itself |
| Toy core | cycle 54, the next multiple of 3 | handler starts at 54 + 6 = 60 |
Toy numbers of the example below, not the latency of ap_rv32.
The seat saw the request first, 7 cycles before the handler ran. But those cycles of waiting and entry are exactly what the seat never shows. A handler that saves the wrong register, or returns to the wrong place, is invisible to it.
The Rules
Rule 1: The seat makes exactly the transfers it is told.
Address, size, data and timing come from the row, not from a compiler. That is its control.
Rule 2: The seat needs no core, no compiler and no boot.
A table runs on the first day the fabric and blocks do. That is its speed of writing.
Rule 3: The seat runs no instructions.
Traps, handler entry and return, the stack, start-up code and the C view of the registers are not tested.
Rule 4: An interrupt ends at a pin.
The seat tests the pin's level and then claims and completes through the bus itself.
Rule 5: Some rows exist only on the seat.
A pin row, or two transfers back to back, have no form a processor could execute.
Rule 6: Everything else stays the same.
The same fabric, blocks, pad models, passive checkers and end-of-test rules decide the verdict.
Sources for These Rules
The seat and the switch: tools/soc/ap_soc/bench/ap_core_slot.sv (the simulation view) and bench/ap_core_seat.sv. See plan §3.6 and facts 27.12.
Pin rows and the interpreter that runs core rows on the processor: tools/soc/ap_soc/bench/soc_tb/README.md ("The sequence table"), soc-rows.mjs.
Replacing the processor with a bus agent for hardware tests, and keeping the real core for a boot: MEHTA-DV 16.4.
The Lab: An Interrupt with No Handler
The DMA is told to raise its interrupt when a job is done, and ap_plic to pass source 5 on. The seat starts a 4-byte copy and waits for the external pin. Then it claims and completes the interrupt by plain bus transfers, as a handler would.
core w 10006018 00000001 ffffffff 00000000 0 1
core w 0c000014 00000001 ffffffff 00000000 0 1
core w 0c002000 00000020 ffffffff 00000000 0 1
core irq 00000000 00000000 00000004 00000000 0 1
core w 10006000 80003000 ffffffff 00000000 0 1
core w 10006004 80003040 ffffffff 00000000 0 1
core w 10006008 00000004 ffffffff 00000000 0 1
core w 1000600c 00000001 ffffffff 00000000 0 1
core wait_irq 00000000 000000c8 00000004 00000000 0 1
core irq 00000000 00000000 00000004 00000004 0 1
core r 0c200004 00000000 ffffffff 00000005 0 1
core w 10006014 00000002 ffffffff 00000000 0 1
core w 0c200004 00000005 ffffffff 00000000 0 1
core irq 00000000 00000000 00000004 00000000 2 1verdict=pass reason=pass core=bfm cycles=73 bus_transfers=20 retired=0- Cycle 4
Cycle 53: the DMA's DONE has reached ap_plic as source 5, and the external pin is high. The wait_irq row ends.
- Cycle 5
Cycle 54: the seat reads the claim register at 0x0C20_0004. No trap, no handler: just a read.
- Cycle 7
Cycle 56: the claim took the source, so the pin falls. The seat then clears DONE at the DMA and completes source 5.
Recorded on ap_soc v1.5, Verilator 5.052 2026-09-05, +core=bfm. Cycles count from the first rising edge of clk_sys after reset.
Rule 4 at work. The pin rose at cycle 53, and the claim read went out at cycle 54. The claim took the source, so the pin fell at cycle 56. The whole test took 73 cycles and retired 0 instructions.
Rule 5 at work. soc-rows.mjs can turn a list of core rows into a table that an interpreter in ROM runs on the processor. Asked to do that for this list, it stops:
pin: the row 'core irq' has no form on the processorThat message is the lesson in one line. On the processor, the same check needs a trap handler, an enabled mie bit and a claim inside the handler. That is a firmware test, and module V4 wrote it.
What the seat saves is measured too. The E9 fault bench ran its GPIO stimulus both ways: 406 cycles through the interpreter, 61 on the seat. The register sweep took 10,254 against 1,193. The seat itself is not faster hardware; the interpreter pays for fetching and decoding every row.
Why It Is Built This Way
Why put a bus manager in the core's own seat, and not on a spare port of the fabric? Because the seat has the core's exact pins and its route through the fabric. A register that answers the seat answers the core the same way. A spare port would test a route the product never uses.
Why not take the core out for good, once it works? Because only the core tests what software relies on: start-up code, handlers, the C view of every register. A team that drops firmware tests ships a chip whose registers work and whose boot does not. Industry keeps both, and picks per check.
Traps
The first trap is a pass that proves less than it seems. A seat table that checks an interrupt pin passes on a chip whose handler entry is broken. The table never claimed to test the entry, but the regression report says "interrupts: pass". Name each without-CPU check for what it covers: "the request reaches the pin".
The second trap is the opposite: a firmware test where a table would do. A team writes a long C test to read the reset values of all 79 registers. It costs a compile and a boot, and every read pays for the instructions around it. It finds the same bug the seat finds. The seat's quick turn is lost.
The third trap is timing that only the seat makes. Two transfers back to back, a write and a read with no idle cycle between: the processor never does that. A bug found that way is real, but a firmware test will never see it again. Keep such a test on the seat, and say why.
At Scale
This section looks ahead. ap_soc has one core and one seat.
A bus agent per port
Large chips replace each core, and each port of a core, by a verification agent on its bus. The agent drives random traffic the cores never make.
The core comes back for boot
The same chips keep a real core model, or an instruction-set model, for boot and for the software tests.
Many front ends
Tables, C on the host and UVM sequences all drive the same seat. Lessons V6.5 and V6.7 compare them.
Try It
Run it: the pin rises at the recorded cycle; the seat and a toy core each notice it.
Change the toy core to one instruction every 5 cycles (the predict question below). What changes for the seat?
Which line is the part a seat-only test can never check?
seat: pin seen at cycle 53 core: taken at cycle 54, handler starts at cycle 60 what only the core shows: the entry, 7 cyclesCheck Yourself
Common Mistakes
Wrong Report an interrupt as tested after a seat table saw its pin.
The pin is only half the path; the handler's entry, claim and return are untested.
Fix Name the check "request reaches the pin" and keep a firmware test for the handler.
Wrong Write firmware for checks that need no instruction.
Each check then pays for a compile, a boot and the instructions around every transfer.
Fix Put register, map and bus checks on the seat.
Wrong Drop the seat once the core runs.
The seat still makes the exact and illegal transfers the core never will.
Fix Keep both modes to tape-out and choose per check.
Remember
- The seat gives exact transfers and needs no core, compiler or boot.
- It runs no instructions, so traps, handlers, start-up code and the C view of the registers stay untested.
- Without a handler, an interrupt test ends at the pin and claims through the bus.
- Teams keep both modes and choose per check.