Subsystems, Stimulus and Response
Cut the chip into subsystems, each with a clear input and a clear output. Then choose, for each one, where the stimulus comes from and what checks the response.
You Will Be Able To
- Cut a chip into subsystems with a clear input and output each.
- Choose the stimulus source and the checker for a subsystem test.
- Explain why a check at the pads proves more than a check on an internal wire.
- Lesson
- V1.5
- Time
- 24 min
- Runs on
- Your browser
- Check
- 5 questions
Faced with the whole chip, a new engineer asks where to even start. The answer is to stop looking at the whole chip. Find groups of blocks with one door in and one door out, and test each group through its doors.
- Peripheral
- Pads
- Memory
- Control / FSM
- Manager
- Clock / reset
- Debug
- Interrupt
- Reset
- Console
A byte enters at the receive pad and leaves at the transmit pad. Pad models drive and check both ends.
- Pins and boot
Pins go in and come out of the same pads. Boot starts from a strap and an image, and ends at the first fetch.
- Inside the chip
Timers, interrupts and the DMA start from register writes and end in a handler or in memory. Requests join subsystems together.
- Around the chip
Clock, reset and power start from reset and wake events; debug enters and leaves through JTAG.
Read the diagram as text
- Console: in: RX pad; out: TX pad
- Pins: in: GPIO pads; out: GPIO pads
- Memory and boot: in: strap, image; out: first fetch
- Time and interrupts: in: timer setup; out: handler runs
- Data mover: in: DMA registers; out: memory
- Clock, reset, power: in: reset, wake; out: domain state
- Debug: in: JTAG pads; out: JTAG pads
- Console → Time and interrupts: receive request
- Data mover → Time and interrupts: done request
- Clock, reset, power → Memory and boot: reset release
A subsystem view of ap_soc. Blocks can belong to more than one subsystem; the core takes part in most.
Before You Start
Read The Chip-Level Verification Plan first. The console example uses the UART of Serial Peripherals. Monitors and scoreboards come from 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 makes a group of blocks a subsystem? |
| 2 | What are the subsystems of ap_soc? |
| 3 | Where can stimulus come from at chip level? |
| 4 | Which checkers can check the response? |
| 5 | Why check at the pads when you could check a wire? |
The Idea: One Door in, One Door Out
Mehta gives a short test for a subsystem. It has a clear place to put stimulus in, and a clear place to check the result. The console of ap_soc passes it. A byte goes in at the receive pad, and the echo comes out at the transmit pad. Everything between, UART0, the interrupt, the core and the handler, is inside.
Cutting the chip this way does two things. Each subsystem gets its own stimulus and its own checker, so the plan has fewer, clearer rows. And each subsystem test checks a chain of joins at once, which is exactly what the chip level is for.
New Words
| Word | Meaning |
|---|---|
| Subsystem | A group of blocks with a clear input for stimulus and a clear output for checking. |
| Stimulus | What the test puts into the chip: a byte on a pad, a register write, a program in memory. |
| Response | What comes out that a checker can examine: a byte on a pad, memory contents, a report from firmware. |
| Pad-level model | A bench model that plays the outside world on a pad: it sends and receives like a real device. |
| Scoreboard | A checker that compares what came out with what should have come out. |
| End to end | Checked from the first input to the last output, with nothing in between trusted. |
Stimulus Sources and Checkers
| Source | Good for |
|---|---|
| Firmware on the core | Anything software does: drivers, handlers, start-up |
| A bus manager in the core's seat | Register traffic, stress, early tests |
| A pad-level model | The outside world: serial bytes, pin levels, a flash chip |
| The JTAG driver | The debugger's view |
| A back-door load | Placing a program in memory before reset, at no cycle cost |
| Checker | What it proves |
|---|---|
| Self-checking firmware | What software can see; it reports pass or fail |
| A passive bus monitor | Every transfer obeys the protocol, in every test |
| A scoreboard at the pads | The whole chain, end to end |
| A reference model of the core | Each retired instruction is right |
| An assertion on a wire | One local rule, every cycle |
Mehta pairs each subsystem with its stimulus and its response checking, item by item. An agent drives packets in, and a monitor and a scoreboard check the output. The same pairing works on a small chip.
The Rules
Rule 1: Define subsystems by their doors.
A clear input and a clear output, or it is not a subsystem yet.
Rule 2: Pick the stimulus that can really make the input.
Only a pad model can play the outside world.
Rule 3: Check at the far door.
A check at the output pads covers every join inside; a wire check covers one.
Rule 4: Add passive checks everywhere.
Monitors cost nothing in stimulus and watch every test.
Sources for These Rules
Mehta, ASIC/SoC Functional Design Verification, sections 16.3 and 16.4: the subsystems of an SoC and their stimulus and response.
Mehta, sections 17.2 and 17.3: the same steps for a cache subsystem.
The subsystem list of ap_soc is this track's own cut, made from map v1.0 and the facts file.
Now Run It: The Console, Pad to Pad
The lab is the console subsystem in miniature. A pad-level model sends two bytes into a receiver. It sends one bit every four clocks, with a start bit and a stop bit (lab choices). A bus manager plays the software: it waits for a byte, reads it, and writes it back. A pad monitor decodes the transmit pad, and a scoreboard compares.
pad model sends 4f
manager reads 4f, writes it back
pad monitor sees 4f, expected 4f
pad model sends 6b
manager reads 6b, writes it back
pad monitor sees 6b, expected 6b
scoreboard: 2 of 2 bytes matched end to endFollow the first byte. The pad model sends 4f; the manager reads 4f and writes it back; the pad monitor sees 4f, which matches. The second byte, 6b, makes the same trip. The last line says both bytes matched end to end.
Notice what the scoreboard never looked at: the receiver's registers, the ready flag, the bus. It trusted none of them, and it still proved the whole path. If any join inside were wrong, the byte at the transmit pad would differ.
The Trap: Checking Halfway
It is tempting to check the console by reading RXDATA and calling it done. That proves the receive half. The transmit half, the pin mux and the pad are never seen. A byte that never leaves the chip still passes the test.
The other half of the trap is software. In the predict question below, the "software" changes each byte before writing it back. Only a check at the far door catches a bug like that, because every block still behaves correctly.
Try It
Run the lab and follow each byte from pad to pad.
Make the manager write back rdata ^ 8'h20. Predict the last line.
Send 00 and ff instead. Predict whether the scoreboard still matches both.
pad model sends 4f manager reads 4f, writes it back pad monitor sees 4f, expected 4f pad model sends 6b manager reads 6b, writes it back pad monitor sees 6b, expected 6b scoreboard: 2 of 2 bytes matched end to endCheck Yourself
Common Mistakes
Wrong Check a subsystem at an internal register.
The joins after that register are never seen.
Fix Check at the far door, the output pads or memory.
Wrong Drive pads from the bus side.
Only a pad-level model behaves like the outside world.
Fix Use a pad model for anything that enters through a pin.
Wrong Call a group of blocks a subsystem without naming its doors.
Without a clear input and output there is nothing to drive or check.
Fix Name the input and the output first.
Remember
- A subsystem has a clear input for stimulus and a clear output for checking.
- Stimulus comes from firmware, a bus manager, pad models, JTAG or a back-door load.
- A scoreboard at the far door proves every join inside; a wire check proves one.
- Passive monitors ride along in every test.