From IP to Chip to System
A chip is verified at several levels: block, subsystem, chip and system. Learn what each level may assume from the one below, and how a function bug differs from an integration bug. Then watch a real chip with two faults show the difference.
You Will Be Able To
- Name the levels of verification on a chip project and what each one owns.
- Say what each level may assume from the level below.
- Tell a function bug from an integration bug, and place each at the level that finds it first.
- Read a chip run that fails, and decide which level should have caught the bug.
- Lesson
- VF.2
- Time
- 24 min
- Runs on
- Your browser
- Check
- 5 questions
A chip test fails on a Tuesday night. The board sent the byte 0x5A into the chip, and the firmware read back 0xA5. Before anyone starts to debug, the team must agree on two things. Whose bug is it, and which bench should have caught it first?
- Test
- Peripheral
- Control / FSM
- Pads
- Processor
- Data
- Interrupt
- Block level
The block bench owns every pin of UART0. It proves the block against the UART's own specification.
- Chip level
The same UART0 now sits behind a pad and a pin mux, and its request runs to ap_plic. The chip bench reaches it only through the pads.
- System level
Firmware runs on the core. A byte at the pad must end in a handler that reads it, as on a real board.
Read the diagram as text
- Block bench: drives every pin of UART0
- UART0: the same block at every level
- ap_plic: input 1 is UART0
- Pads: IO0 transmit, IO1 receive
- Chip bench: owns only the pads
- Core with firmware: a handler reads the byte
- Block bench → UART0: all pins
- UART0 → ap_plic: request
- Chip bench → Pads: UART line
- Pads → UART0: pin mux
- ap_plic → Core with firmware: interrupt
One block seen at three levels. Each level adds joins the level below never had.
Before You Start
Read An SoC as a Verifier Sees It first: it names the parts of a chip and the six questions. The companion track explains the levels in general, in The Levels: Block, Subsystem, Chip, System. It explains verification against validation in Verification, Validation and Test.
What a block team hands over is taught in the SoC Architecture track, in IP Blocks: What Arrives With a Block.
| Question | |
|---|---|
| 1 | What are the levels of verification on a chip project? |
| 2 | What may each level assume from the level below? |
| 3 | What is the difference between a function bug and an integration bug? |
| 4 | Where does the block team stop and the chip team start? |
| 5 | How does a real chip run show which level should have caught a bug? |
The Idea: Each Level Trusts the One Below
Nobody verifies a whole chip in one go. The design is built from blocks, the blocks are joined into a chip, and the chip runs software on a board. So verification climbs the same ladder. Each level proves what it can see, and trusts the level below for the rest.
Trust is the key word. A block level that passed lets the chip level skip the inside of the block. That saving only works if each level does its own job fully. A hole at one level becomes a bug that the next level may never look for.
The levels also find different kinds of bugs. Some bugs live inside one block. Others live in the joins between blocks, and appear only when the joins exist. Knowing which is which tells you who must fix a bug, and where its test belongs.
New Words
| Word | Meaning |
|---|---|
| IP block | A block designed to be reused, often bought from another company. UART0 is one. |
| Block level | Verification of one block alone, on a bench that drives all its pins. |
| Subsystem | A group of blocks that work together, such as a core with its memories. |
| Chip level | Verification of the whole chip through its pads, with every block in place. Also called SoC level. |
| System level | The chip running real software, as it will on a board. |
| Firmware | The program that runs on the chip's own processor. Here it is a small C program. |
| Verification plan | The written list of what must be verified at a level, how, and what each level assumes. |
| Regression | Running every test again, often every night, so that a change cannot quietly break an old result. |
| Function bug | A block that does the wrong thing by its own specification. |
| Integration bug | Blocks that each work, joined the wrong way: a wire, an address, a clock or a pad. |
| Handler | The function the processor runs when an interrupt arrives. |
| Seeded fault | A bug put into a copy of the chip on purpose, to see which tests catch it. Each has an ID such as Q027. |
| Status word | The last word a test writes for the bench: 0x900D for a pass, or 0xBAD0_0000 plus a fail code. |
| Validation | Checking the real chip, after manufacture, against what the product needs. Verification comes before it. |
The Ladder of Levels
| Level | It owns | It may assume | It finds |
|---|---|---|---|
| Block (IP) | Every pin of one block | Nothing: it is the bottom rung | Function bugs: rare cases, every mode, every error |
| Subsystem | A few blocks and their bus | Each block passed its bench | Bugs between close neighbours, such as a core and its memory |
| Chip (SoC) | Only the pads | Blocks and subsystems passed | Integration bugs: wires, map, clocks, resets, pads, power |
| System | The chip and its software | The chip passed its chip tests | Bugs between hardware and software, and in real use |
After silicon comes back, validation on the real chip asks whether it suits the product. That is a different question, covered by the companion track.
Read the third column as a promise between levels. The chip level does not re-test the divider of UART0, because the block level promised it. In return, the chip level owns everything the block level could not see. Where the block team stops is exactly where its bench runs out of pins.
The Smallest Example: Two Bugs in One UART
Take two bugs that both stop a received byte from reaching the firmware. Ask, for each one, which bench could see it.
| Bug | Kind | Block bench sees it? | Chip test sees it? |
|---|---|---|---|
| UART0 stores each received byte inverted | Function | Yes: it compares every byte it sends in | Yes, but later and at a higher price |
| UART0's request is not wired to ap_plic input 1 | Integration | No: the wire is outside the block | Yes: no interrupt ever arrives |
A function bug can show at every level. An integration bug can only show where its join exists.
The first bug is cheap to find at block level and expensive later. The second bug cannot be found at block level at all, however good the bench. That asymmetry is the whole reason chip-level verification exists.
The Rules
Rule 1: Each level proves what only it can see.
Block benches prove functions. Chip tests prove joins. System tests prove the chip with its software.
Rule 2: Each level assumes the one below passed, and says so.
The assumption is written into the plan, so a gap below is visible.
Rule 3: A function bug belongs to the lowest level that can see it.
Fix it there, and add the missing test there.
Rule 4: An integration bug exists only where its join exists.
No block bench can find it, however thorough.
Sources for These Rules
Mehta, ASIC/SoC Functional Design Verification, sections 16.1 to 16.4: an SoC verified as subsystems that are themselves made of blocks.
Mehta, section 2.2: work done at block level is carried up into the subsystem plan.
The split between function and integration bugs is this track's point of view (docs/soc-verification-plan.md section 2.1).
Now Run It: Two Levels in a Slice
The lab at the end of this page holds a small transmitter, uart_tx, and a chip that puts it behind a pin mux. The parameter BUG seeds one bug. BUG = 2 is an integration bug: the chip routes the transmit line to pad 1 instead of pad 0.
BUG = 2
block bench: sent 4b, line read 4b: pass
chip bench: sent 4b, pad 0 read ff: FAILRule 4 at work. The block bench sends 0x4B and reads 0x4B back from the line: the block is right. The chip bench sends the same byte and reads 0xFF at pad 0, because nothing ever drives it. Change BUG to 1 and both benches fail, because a function bug travels with the block.
Now on the Real Chip: One Byte, Three Chips
The same idea runs on ap_soc v1.5. The program below sets pad IO1 to UART receive and enables the receive interrupt. Then it asks the board to send 0x5A. Its handler reads the byte, and main checks it.
/* uart_rx.c: the board sends 0x5A; the UART interrupt handler must read it. */
#include "hal.h"
#include "irq.h"
#include "tb.h"
volatile unsigned got, rx;
static void on_uart(void)
{
rx = reg_read32(UART0_RXDATA); /* reading the byte clears RX_READY */
got = got + 1;
}
int main(void)
{
reg_write32(SYSCTL_PINMUX, 2u << 2); /* pad IO1 carries UART RX */
reg_write32(UART0_IRQ_ENABLE, UART0_IRQ_ENABLE_RX_READY_MASK);
irq_enable(UART0_IRQ, on_uart); /* ap_plic source 1 and the core's enable */
tb_event(3); /* the board sends 0x5A on pad IO1 */
for (volatile unsigned t = 0; t < 400 && got == 0; t++) { }
if (got == 0) {
tb_puts("no interrupt; UART0 STATUS ");
tb_put_hex(reg_read32(UART0_STATUS));
tb_putc('\n');
return 1;
}
tb_puts("handler read ");
tb_put_hex(rx);
tb_putc('\n');
return rx == 0x5A ? 0 : 2;
}
It ran on three builds of the chip: as designed, and two copies with one seeded fault each. Q027 makes UART0 store each received byte inverted, a function bug. Q094 wires ap_plic input 1 to the timer's request, so UART0's request reaches nothing: an integration bug. The bench asked for the byte at cycle 267 in every run. Each run ends with a status word: 0x900D is a pass, and 0xBAD0_0000 plus a code is a fail with that code. The next lesson shows how the bench reads it.
| Chip | Console | Interrupts taken | Status word |
|---|---|---|---|
| As designed | handler read 0000005a | 1 | 0x0000900D |
| Q027: The receive FIFO complements each incoming byte | handler read 000000a5 | 1 | 0xBAD00002 |
| Q094: PLIC input 1 follows request 3 | no interrupt; UART0 STATUS 00000003 | 0 | 0xBAD00001 |
Read the rows with rules 3 and 4. On the good chip the handler reads 0x5A and the test passes. With Q027 the handler runs but reads 0xA5, the inverse, and the test fails with code 2. A UART block bench that sends bytes in and compares them would have caught this first.
Q094 is different. No interrupt arrives, and the test gives up at cycle 8735. Yet UART0's STATUS register reads 0x3. Bit 0, ROOM, says the transmitter is free; bit 1, RX_READY, says a received byte is waiting. So the byte sits safely inside UART0. The block did its job; the wire to ap_plic did not. No UART bench could ever see that.
EVENT 267: 00000003
CONSOLE 8735: no interrupt; UART0 STATUS 00000003Why It Is Built This Way
Why not test everything at chip level, where all the joins exist? Because every chip test pays for the whole chip. Every cycle simulates the core, the fabric and every block, not only UART0. The test must also boot and set up the pad and the interrupt first. In the good run above, 267 cycles pass before the board is even asked for the byte.
A block bench pays none of that. It can try every divider and every error case in the time a chip test spends booting. So each level does the work it is cheapest at, and the levels together cover the chip.
Traps
The first trap is "the block passed, so the chip is fine". The Q094 copy has a perfect UART0 and a broken chip. A passing block bench says nothing about the wires around the block.
The second trap is the opposite: testing the inside of every block again from the chip. It costs a boot per case and finds what the block bench already proved. The next lesson, on what the block bench already proved, draws that line exactly.
The third trap is fixing a function bug only at chip level. If the chip test finds Q027, the fix goes into UART0 and a test goes into its bench. Otherwise the next chip that reuses UART0 starts with the same hole.
At Scale
This section looks ahead. ap_soc has two levels you can run here: small slices and the whole chip.
More rungs
A large chip has subsystems inside subsystems: a core cluster, a memory system, a modem. Each rung has its own bench and its own team.
System level grows
Real products boot an operating system. That is too long for a simulator, so teams move to faster platforms, the subject of a later lesson.
After silicon
When the chip comes back, validation teams run it on boards. A bug found there is the most expensive kind to fix.
Where This Goes Next
The next lesson follows one chip test from reset to pass. The module after this one draws the line between the levels exactly.
| Lesson | What it adds |
|---|---|
| One Chip Test From Reset to Pass | One real chip test, from power-good to the pass word. |
| What the Block Bench Already Proved | What the block bench already proved, and the rules of the hand-over to the chip level. |
| Twelve Things Only a Chip Gets Wrong | The twelve kinds of bug only a chip gets wrong. |
| The Integration Bug Hunt | An integration bug hunt on the chip of the SoC Architecture track. |
Try It
Run the lab with BUG = 2 and read the two bench lines.
Set BUG to 1, the function bug, and predict both lines before you run it.
Set BUG to 0 and check that both benches pass.
BUG = 2 block bench: sent 4b, line read 4b: pass chip bench: sent 4b, pad 0 read ff: FAILCheck Yourself
Common Mistakes
Wrong Take a passing block bench as proof the chip works.
The block bench cannot see the wires, pads and clocks around the block.
Fix Check every join at chip level.
Wrong Re-test the inside of every block from the chip.
Each chip test pays for a boot and the real pads, and the block bench already proved it.
Fix Leave functions to the block level; test joins at chip level.
Wrong Fix a function bug found at chip level only in the chip regression.
The block bench keeps its hole for the next chip.
Fix Fix the block and add the test to its bench.
Remember
- Verification climbs the levels: block, subsystem, chip, system.
- Each level proves what only it can see and assumes the level below passed.
- A function bug can show at every level; fix and test it at the lowest one.
- An integration bug exists only where its join exists, so only the chip level can find it.