Passive Checkers: Bind and Listen
Block teams hand over checkers for their buses and blocks. At chip level you clip them onto the chip's own wires, where they listen and never drive. See the APB checker of the Protocols track bound into ap_soc and silent on every legal transfer. Then watch a seeded fault that only the checker in the right place can name.
You Will Be Able To
- Bind a checker to signals inside the chip without editing the chip's RTL.
- Say what every shape of transfer on ap_soc's fast APB bus looks like.
- Explain why a chip-level checker must be silent on legal traffic before it is useful.
- Read a checker's report on a faulty chip and the run it ended.
- Lesson
- V3.5
- Time
- 26 min
- Runs on
- Your browser
- Check
- 5 questions
Picture the first night a block team's checkers run inside the chip. One of them reports on the good chip at the first read of the slow bus. Another stays silent through a real fault, because it sits on the wrong side of a bridge. Both are lessons about where a checker sits and what it may do there.
- Processor
- Bus
- Test
- Result
- Data
- Control
- The chip's buses
Managers, the matrix, the bridge to the fast APB bus, and the crossing to the slow one.
- Checkers clipped on
A checker on every port and bus, wired from outside the RTL. None of them drives.
- One count
Every broken rule adds to one count, and the first one ends the run.
Read the diagram as text
- Core or seat: manager ports 2 and 3
- AHB matrix: 4 managers, 5 targets
- AHB to APB bridge: the fast APB bus
- Slow APB: clk_aon
- P4 AHB checkers: one per port, 9
- P3 APB checkers: fast and slow
- Block monitors: UART0, SPI, timer, DMA
- Error count: ends the run
- Core or seat → AHB matrix: AHB
- AHB matrix → AHB to APB bridge: AHB
- AHB to APB bridge → Slow APB: async bridge
- AHB matrix → P4 AHB checkers: read only
- AHB to APB bridge → P3 APB checkers: read only
- Slow APB → Block monitors: read only
- P3 APB checkers → Error count: rules broken
soc_tb.sv: the P4 checker of the AHB lessons on 9 ports, the P3 checker on both APB buses, 4 block monitors.
Before You Start
Read Models of the Outside World and APB in One Picture first; the APB rules themselves are in module P3.
| Question | |
|---|---|
| 1 | How does a checker get into the chip without changing the chip's RTL? |
| 2 | What does "passive" promise, and why does it matter? |
| 3 | What shapes of transfer does ap_soc's fast APB bus make? |
| 4 | Why must a checker be silent on the good chip? |
| 5 | Why does only one checker report on a seeded fault? |
The Idea: Borrow the Block Team's Eyes
Each block team wrote checkers for its own interfaces: an AHB checker, an APB checker, a monitor for its block. At chip level those checkers are worth a great deal. They watch every transfer of every test, for free, and they say exactly which rule broke on which bus.
You cannot edit the chip to add them, and you must not let them change what the chip does. So they are attached from outside, wired to the chip's signals by name, and they only read. A checker that listens can never make a broken chip pass.
That gives a checker a short list of rights. It may read any signal it is wired to, keep its own state, count, and add to the bench's error count. It may not drive or force a chip signal, and it does not decide the verdict alone. It also sees only its own bus. A checker on the APB side of a bridge cannot see a broken AHB rule on the other side.
New Words
| Word | Meaning |
|---|---|
| Bind | To attach a checker to signals inside a design from outside, without editing its RTL. SystemVerilog has a bind statement for it. |
| Hierarchical name | The path of a signal through the design, such as dut.u_fabric.penable. |
| Setup cycle | The first cycle of an APB transfer: PSEL 1, PENABLE 0. |
| Access cycle | A cycle with PSEL and PENABLE both 1; the transfer completes in the one where PREADY is 1. |
| Wait state | An access cycle with PREADY 0: the completer asks for more time. |
| Back to back | A transfer whose setup cycle follows the last access cycle of the one before, with PSEL held. |
| False alarm | A checker report on legal behaviour. |
The Smallest Example: Four Shapes of Transfer
Before reading the chip's bus, list what a legal APB bus may do, cycle by cycle. P is PSEL, E is PENABLE, R is PREADY.
| Shape | Cycles (P E R) | Seen on ap_soc |
|---|---|---|
| No wait | 1 0 x, then 1 1 1 | every register block |
| Waits | 1 0 x, then 1 1 0 several times, then 1 1 1 | the bridge to the slow bus |
| Back to back | 1 1 1, then straight to 1 0 x | the seat's queued rows |
| Error | 1 0 x, then 1 1 1 with PSLVERR | a hole, a stopped block |
A checker that is right about APB must stay silent on all four. Only then does its report on something else mean anything.
The Rules
Rule 1: Attach from outside, by name.
soc_tb wires each checker to hierarchical names in the chip; SystemVerilog's bind does the same from a separate file.
Rule 2: Read only.
A checker's ports are inputs. It counts and reports into the bench's error count; it never drives or forces a chip signal.
Rule 3: Clock it on the bus's own clock and reset.
The fast APB checker runs on clk_sys and the bus reset, the slow one on clk_aon and its own reset.
Rule 4: Silence first.
Run every legal shape of traffic and get zero reports before you trust a single one.
Rule 5: One broken rule ends the run.
soc_tb stops at the first checker error, so the log shows the cause and not its consequences.
Sources for These Rules
The bind statement: IEEE 1800-2023 clause 23.11. soc_tb itself instantiates its checkers in the top with hierarchical connections; the coverage build of E11 uses bind.
The APB checker and its rules: content/modules/v3/protocols/apb-shared.mjs (module P3), after IHI 0024E 3.1 to 3.4.
The checkers of soc_tb and the end at the first error: soc_tb.sv and README.md.
The Lab: The Fast APB Bus, Good, and a Fault Next Door
apb_checker #(.NSEL(8), .TIMEOUT(96)) fast_chk (
.pclk(clk_sys), .presetn(resetn_sys), .psel({dut.u_fabric.bus_psel && dut.u_fabric.slot_none, dut.u_fabric.psel}),
.penable(dut.u_fabric.penable), .pwrite(dut.u_fabric.pwrite), .paddr(dut.u_fabric.paddr),
.pwdata(dut.u_fabric.pwdata), .pstrb(dut.u_fabric.pstrb), .pprot(dut.u_fabric.pprot),
.pready(dut.u_fabric.bus_pready), .pslverr(dut.u_fabric.bus_pslverr));Rules 1 to 3 at work: the checker sits in soc_tb, outside the chip, wired by hierarchical names. It runs on clk_sys and resetn_sys. TIMEOUT(96) makes it report a transfer that waits 96 cycles.
core r 10004000 00000000 ffffffff 2a5310c5 0 1
core w 10000010 00000008 ffffffff 00000000 0 1
core rq 10004000 00000000 ffffffff 2a5310c5 0 1
core rq 10004010 00000000 00000000 00000000 0 1
core idle 00000000 00000000 ffffffff 00000000 0 1
core r 10008004 00000000 00000040 00000040 0 1
core w 10008008 00000001 ffffffff 00000000 0 1
core re 10007000 00000000 ffffffff 00000000 0 1APB 11 psel=1 penable=0 pwrite=0 pready=1 paddr=10004000
APB 12 psel=1 penable=1 pwrite=0 pready=1 paddr=10004000
APB 17 psel=1 penable=0 pwrite=0 pready=1 paddr=10004000
APB 18 psel=1 penable=1 pwrite=0 pready=1 paddr=10004000
APB 19 psel=1 penable=0 pwrite=0 pready=1 paddr=10004010
APB 20 psel=1 penable=1 pwrite=0 pready=1 paddr=10004010A setup cycle, then one access cycle with PREADY 1: no wait. At cycle 19 the second read's setup follows the first read's access at once, with PSEL still 1. That is back to back, and legal.
APB 22 psel=1 penable=0 pwrite=0 pready=0 paddr=10008004
APB 23 psel=1 penable=1 pwrite=0 pready=0 paddr=10008004
APB 24 psel=1 penable=1 pwrite=0 pready=0 paddr=10008004
APB 31 psel=1 penable=1 pwrite=0 pready=0 paddr=10008004
APB 32 psel=1 penable=1 pwrite=0 pready=1 paddr=10008004The access starts at cycle 23. PREADY stays 0 until cycle 32, while the slow bus does its own transfer on clk_aon. A write to the same block waits from 35 to 48. Rule 4: a checker built for a block that never waits would report here, on a good chip.
Now the same table runs on a chip with one seeded fault in the AHB matrix. Every transfer to a target starts its first beat as SEQ instead of NONSEQ.
APB 8 psel=1 penable=0 pwrite=1 pready=1 paddr=10004020
APB 9 psel=1 penable=1 pwrite=1 pready=1 paddr=10004020
APB 11 psel=1 penable=0 pwrite=0 pready=1 paddr=10004000
APB 12 psel=1 penable=1 pwrite=0 pready=1 paddr=10004000
RULE trans_change broken at edge 25: SEQ at 0x10004020 with no burst in progress
RULE trans_change broken at edge 28: SEQ at 0x10004000 with no burst in progressThe APB rows look exactly like the good chip's: the bridge still turns each transfer into a legal APB transfer. So the APB checker stays silent, with 0 rules broken. The report comes from the P4 checker on the matrix's port to the bridge, which sees SEQ where no burst is running. Rule 5 at work: the run ended at cycle 16, with 3 AHB rules broken in its last cycles.
wire learner_report;
int learner_reports = 0;
int reports_status = 0;
int reports_putc = 0;
int reports_event = 0;
task automatic emit_checker_reports();
$display("learner_reports=%0d", learner_reports);
$display("reports_status=%0d", reports_status);
$display("reports_putc=%0d", reports_putc);
$display("reports_event=%0d", reports_event);
endtask
learner_checker u_learner(.clk(clk_sys), .resetn(resetn_sys), .psel(dut.u_fabric.bus_psel), .penable(dut.u_fabric.penable), .pwrite(dut.u_fabric.pwrite), .report(learner_report));
always @(posedge clk_sys)
if (resetn_sys && learner_report) begin
learner_reports <= learner_reports + 1;
if (dut.u_fabric.bus_psel && dut.u_fabric.penable && dut.u_fabric.pwrite && dut.u_fabric.bus_pready && !dut.u_fabric.bus_pslverr) begin if (dut.u_fabric.paddr == 32'h10004020) reports_status <= reports_status + 1; else if (dut.u_fabric.paddr == 32'h10004024) reports_putc <= reports_putc + 1; else if (dut.u_fabric.paddr == 32'h10004028) reports_event <= reports_event + 1; end
endThe practice problems put your own checker in that place. It gets four signals of the bus phases, the byte-lane strobes and a report output. The bench counts the edges at which it reports.
Why It Is Built This Way
Why reuse the block team's checkers at all? Because they already encode the rules, they cost nothing to run, and they look at places the chip's tests cannot see. The matrix fault broke an AHB rule that the bridge then hid. Only the checker on the matrix side of the bridge named it, on the first transfer.
Why stop at the first error? Because one broken rule usually breaks ten more, and the first is the cause. A log that keeps going buries it.
Traps
The big trap is a checker that cries wolf. A block bench may never produce waits or back-to-back transfers, so its checker was never tested against them. Bound into the chip, it reports on the slow bridge in the first test, and someone switches it off "for now". Months later the bug it would have caught ships.
The second trap is the wrong clock. A checker of the slow bus clocked on clk_sys samples each slow cycle several times and reports a "stuck" access. Clock every checker on its bus's own clock and reset. In the practice problems you write a checker that stays silent on all of this. Then you repair one that does not.
At Scale
This section looks ahead. ap_soc has 11 bus checkers and 4 block monitors.
Bind files
Large chips keep every checker in bind files, one per block, maintained with the block. A rename inside the block changes its bind file only.
Assertions from the block team
Interface assertions written once at block level are switched on at chip level by bind, often with their own enable per instance.
Noise budget
A checker that fires once on a legal case is fixed or removed the same day. Silence on legal traffic is what makes every report urgent.
Try It
Run it: a passive monitor replays the recorded fast APB bus and counts transfers, wait cycles and back-to-back starts.
It can see PREADY, which the checker of the practice problems cannot. What would it count as a wait without PREADY?
Feed it only the rows of the slow read (the predict question below) before you look at the answer.
transfers 9 (writes 4), wait cycles 22, back to back 1Check Yourself
Common Mistakes
Wrong Bind a block's checker into the chip without running it on legal chip traffic first.
Its block-only assumptions fire on the good chip, and the checker gets switched off.
Fix Run every legal shape of transfer and get zero reports first.
Wrong Give a checker an output that pulls a chip signal to a safe value.
A checker that drives changes the chip under test.
Fix Inputs only; report into the bench's count.
Wrong Clock every checker on clk_sys.
A checker of the slow bus then samples each slow cycle several times.
Fix Clock each checker on its bus's own clock and reset.
Remember
- Block checkers are attached from outside by hierarchical names or bind, and only read.
- Each checker runs on its bus's own clock and reset.
- The fast APB bus of ap_soc makes no-wait, waited, back-to-back and error transfers; a checker must be silent on all of them.
- A checker sees only its own bus. The matrix fault left the APB checker silent; the AHB checker on the bridge's port named it.