Three Ways to Drive a Chip
Drive the chip with its own core, with a bus manager in the core's seat, or on a fast platform. Learn what each mode finds, what it misses, and why firmware on the real core is the rarest skill of the three.
You Will Be Able To
- Say what each of the three modes is best at and weak at.
- Choose a mode for a test from what the test needs to be real.
- Decide from simulator speed when software is too long for RTL.
- Lesson
- V1.3
- Time
- 24 min
- Runs on
- Your browser
- Check
- 5 questions
Your register sweep found nothing in ten minutes, and the boot code still crashes. A colleague says the sweep could never have found it, because the crash needs a real trap on a real core. Which tool should the next test use?
- File
- Processor
- Sequence
- Manager
- Model
- DUT
- Pads
- Data
- With CPU
Firmware runs on the real core. Traps, handlers, start-up code and sleep are all real.
- Without CPU
A bus manager takes the core's seat. It can make any traffic, including traffic the core never makes.
- Fast platform
An instruction-level model, an emulator or an FPGA board runs long software far faster, with less to see.
- Same pads
In every mode, the outside world is played by models on the pads.
Read the diagram as text
- Firmware in C: compiled, loaded into SRAM
- Real core: mode 1: with CPU
- Bench test: sequence or C through DPI
- Bus manager: mode 2: without CPU
- Long software: boot loader, drivers, an OS
- Fast platform: mode 3: model or hardware
- The rest of the chip: bus, memories, peripherals
- Pad models: UART, GPIO, flash
- Firmware in C → Real core: instructions
- Real core → The rest of the chip: loads, stores
- Bench test → Bus manager: transfers
- Bus manager → The rest of the chip: any bus traffic
- Long software → Fast platform: billions of instructions
- Fast platform → The rest of the chip: fast, less visible
- The rest of the chip → Pad models: pins
One bench, one chip. Teams switch between the first two with one setting and move to the third for long software.
Before You Start
Read What the Block Bench Already Proved first. You should know how a program runs on a core and starts up: Start-Up Code. A first look at sequences and drivers helps: From a Layered Bench to UVM.
The labs of this module are small slices. They use the real addresses and interrupt numbers of ap_soc v1.5, and each page says so. The whole chip runs from module V2 on, and in the guided run of the fundamentals module.
| Question | |
|---|---|
| 1 | What are the three ways to drive a chip? |
| 2 | What can only firmware on the real core find? |
| 3 | What can only a bus manager do? |
| 4 | Why do fast platforms exist, and what do they cost? |
| 5 | Why is with-CPU verification rare, and why does that make it valuable? |
The Idea: Who Sits in the Core's Seat
A chip has one seat that drives the bus: the core. Whatever sits in that seat decides what the test can do. Put the real core there, running compiled firmware, and the chip behaves exactly as it will on a board. Put a bus manager there, a model that issues transfers on command, and you can make any traffic you like.
The third choice changes the clock speed itself. Software teams need billions of instructions, and RTL simulation runs thousands to hundreds of thousands of cycles a second. A fast platform trades visibility and exact timing for speed. It can be a model of the core, an emulator, or an FPGA board.
New Words
| Word | Meaning |
|---|---|
| With CPU | The real core runs firmware written in C or assembly, and the bench checks the results. |
| Without CPU | A bus manager takes the core's seat and issues transfers that a bench test asks for. |
| Bus manager | A bench model that drives the bus like a processor would, one transfer at a time, on command. |
| Fast platform | A way to run the design far faster than RTL simulation: a virtual platform, an emulator or an FPGA prototype. |
| Virtual platform | A software model of the chip at instruction level, fast enough to boot an operating system. |
| Emulator | Special hardware that runs the RTL itself, millions of cycles a second, at very high cost. |
What Each Mode Is For
| With CPU | Without CPU | Fast platform | |
|---|---|---|---|
| Who drives the bus | The real core | A bus manager | A core model, or the real core in hardware |
| Best at | Boot, traps, handlers, start-up code, sleep, real use cases | Register sweeps, bus stress, error injection, illegal traffic | Long software: boot loaders, drivers, an OS |
| Weak at | Exact bus timing, traffic the core never makes | Anything that needs real instructions | Visibility and fast turnaround after an RTL change |
| When | From first integration to tape-out | From week one, before the core is ready | Once the RTL is stable |
| How common | Rare outside chip teams | Common | Rare: the hardware costs a fortune |
Built from docs/soc-verification-plan.md section 2.2. Mehta, ASIC/SoC Functional Design Verification, chapter 12 covers virtual platforms and emulation.
Most verification engineers grow up in the second column, because that is how block benches work. The first column is different work. You write C, you read a retire trace, you debug a handler that returned to the wrong place. Few people get to do it before they join a chip team, and teams notice those who can.
The Rules
Rule 1: Ask what must be real.
If the bug needs real instructions, use the core. If it needs traffic the core never makes, use a manager.
Rule 2: Ask how long.
Billions of cycles do not fit in RTL simulation. Move such software to a fast platform.
Rule 3: Use both of the first two.
One bench switches between them. The same chip, two tools.
Sources for These Rules
Mehta, ASIC/SoC Functional Design Verification, section 12.1 (why simulation is too slow for software, and what virtual platforms and emulators add).
The three-mode table and the switch on one bench are this track's plan (sections 2.2 and 3.6), from common practice.
Speeds were measured on the laptop with the five-stage core alone in its bench (plan section 6.2).
Icarus 12.0 ran about 9.2 thousand cycles a second, and Verilator 5.032 about 534 thousand.
Now Run It: The Same Four Writes, Three Ways
The lab is a toy, and it says so. One register block, acc_block, adds every value written to address 0x10, and a read of 0x14 returns the sum. The test adds 3, 4, 2 and 1, three times over.
First comes a "core", a four-step sequencer. It spends three clocks on reset and first fetch, then fetches each step before its bus write. Then a bus manager issues the same four writes directly. Last, a fast model does the same arithmetic as plain function calls, with no clock at all.
with CPU: sum 10 after 15 clocks
without CPU: sum 10 after 8 clocks
fast model: sum 10 after 0 clocks, 4 callsAll three agree on the sum: 10. They differ in cost. The core run took 15 clocks, because fetches and boot cost cycles. The manager took 8, two clocks for each write. The fast model took no clocks at all, but it also has no bus to look at.
Scale that up. On the real chip, even a boot from a back-door load is planned at a few hundred cycles. Every with-CPU test pays it, and the manager saves it. A fast platform saves almost everything, and in return you cannot watch a single wire.
The Trap: One Mode for Everything
A team that knows only bus managers writes every chip test as a bench test. Its regression is fast and green. Then the first firmware runs on silicon. The stack was never set up, the trap vector points at nothing, and the handler returns to the wrong place.
The opposite team writes everything in firmware. Its tests are slow, and they never reach the bus timings the core cannot make. Pick the mode per test, from what the test must make real.
Try It
Run the lab. Compare the three sums and the three clock counts.
Change the four values to 10, 20, 30 and 40. Predict the last line.
Remove the extra clock before each core write. Predict the new core clock count.
with CPU: sum 10 after 15 clocks without CPU: sum 10 after 8 clocks fast model: sum 10 after 0 clocks, 4 callsCheck Yourself
Common Mistakes
Wrong Use a bus manager to test start-up code or handlers.
A manager runs no instructions, so start-up code and traps never happen.
Fix Use the real core for anything made of instructions.
Wrong Run billions of cycles of software in RTL simulation.
At hundreds of thousands of cycles a second, it takes days.
Fix Move long software to a fast platform.
Wrong Expect a fast platform to show bus timing.
It trades visibility and exact timing for speed.
Fix Debug timing in RTL simulation.
Remember
- Three modes: firmware on the real core, a bus manager in the core's seat, a fast platform.
- With CPU finds boot, traps, handlers, sleep and real use cases; without CPU makes any traffic, early and fast.
- Fast platforms run long software and give up visibility and exact timing.
- Teams use the first two on one bench, and pick the mode per test.