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.

Checkers Clipped onto Buses, Driving NothingEach checker is wired to the signals of one port or bus inside the chip. Arrows point one way: from the chip to the checker.
  • Processor
  • Bus
  • Test
  • Result
  • Data
  • Control
Checkers Clipped Onto Buses, Driving NothingEach checker is wired to the signals of one port or bus inside the chip. Arrows point one way: from the chip to the checker. processor Core or seat manager ports 2 and3 bus AHB matrix 4 managers, 5targets bus AHB to APBbridge the fast APB bus bus Slow APB clk_aon test P4 AHB checkers one per port, 9 test P3 APB checkers fast and slow test Block monitors UART0, SPI, timer,DMA result Error count ends the run AHBAHBasync bridgeread onlyread onlyread onlyrules broken
  1. processor Core or seatmanager ports 2 and 3
    • AHB → AHB matrix
  2. bus AHB matrix4 managers, 5 targets
    • AHB → AHB to APB bridge
    • read only → P4 AHB checkers
  3. bus AHB to APB bridgethe fast APB bus
    • async bridge → Slow APB
    • read only → P3 APB checkers
  4. bus Slow APBclk_aon
    • read only → Block monitors
  5. test P4 AHB checkersone per port, 9
  6. test P3 APB checkersfast and slow
    • rules broken → Error count
  7. test Block monitorsUART0, SPI, timer, DMA
  8. result Error countends the run
  1. The chip's buses

    Managers, the matrix, the bridge to the fast APB bus, and the crossing to the slow one.

  2. Checkers clipped on

    A checker on every port and bus, wired from outside the RTL. None of them drives.

  3. 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.

Five questions this page answers
Question
1How does a checker get into the chip without changing the chip's RTL?
2What does "passive" promise, and why does it matter?
3What shapes of transfer does ap_soc's fast APB bus make?
4Why must a checker be silent on the good chip?
5Why 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

New words on this page
WordMeaning
BindTo attach a checker to signals inside a design from outside, without editing its RTL. SystemVerilog has a bind statement for it.
Hierarchical nameThe path of a signal through the design, such as dut.u_fabric.penable.
Setup cycleThe first cycle of an APB transfer: PSEL 1, PENABLE 0.
Access cycleA cycle with PSEL and PENABLE both 1; the transfer completes in the one where PREADY is 1.
Wait stateAn access cycle with PREADY 0: the completer asks for more time.
Back to backA transfer whose setup cycle follows the last access cycle of the one before, with PSEL held.
False alarmA 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.

Legal shapes on one APB bus
ShapeCycles (P E R)Seen on ap_soc
No wait1 0 x, then 1 1 1every register block
Waits1 0 x, then 1 1 0 several times, then 1 1 1the bridge to the slow bus
Back to back1 1 1, then straight to 1 0 xthe seat's queued rows
Error1 0 x, then 1 1 1 with PSLVERRa 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

  1. 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.

  2. 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.

  3. 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.

  4. Rule 4: Silence first.

    Run every legal shape of traffic and get zero reports before you trust a single one.

  5. 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

The P3 APB checker on the fast APB bus (soc_tb.sv). Every port is an input, wired to a name inside the chip.
  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.

A table for the bus-manager seat: reads and writes, two queued reads, the slow bus, a hole.
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 1
The good chip: a read with no wait, then two reads back to back.
APB 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=10004010

A 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.

The good chip: a read of ap_pwrctl across the slow bridge (some rows left out).
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=10008004

The 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.

The faulty chip: the fast APB bus, then the first rule reports of the bench.
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 progress

The 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.

The instance the server generates for a learner's checker at the fast APB site (tools/soc-checker.mjs).
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
  end

The 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

ap_soc~12 blocks
Phone-class SoChundreds of blocks

This section looks ahead. ap_soc has 11 bus checkers and 4 block monitors.

  1. 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.

  2. 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.

  3. 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.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: transfers 9 (writes 4), wait cycles 22, back to back 1

Check Yourself

Predict the outputThe monitor now replays only the read of ap_pwrctl across the slow bridge. What does it print?
`timescale 1ns/1ns
// Cycle by cycle, the fast APB bus of ap_soc v1.5 as a probe recorded it: cycle, PSEL, PENABLE, PWRITE, PREADY.
module tb;
  localparam int N = 11;
  int cycle [N];
  bit psel [N], penable [N], pwrite [N], pready [N];
  int transfers = 0, writes = 0, waits = 0, back_to_back = 0, done_at = -9;
  initial begin
    cycle[0] = 22; psel[0] = 1; penable[0] = 0; pwrite[0] = 0; pready[0] = 0;
    cycle[1] = 23; psel[1] = 1; penable[1] = 1; pwrite[1] = 0; pready[1] = 0;
    cycle[2] = 24; psel[2] = 1; penable[2] = 1; pwrite[2] = 0; pready[2] = 0;
    cycle[3] = 25; psel[3] = 1; penable[3] = 1; pwrite[3] = 0; pready[3] = 0;
    cycle[4] = 26; psel[4] = 1; penable[4] = 1; pwrite[4] = 0; pready[4] = 0;
    cycle[5] = 27; psel[5] = 1; penable[5] = 1; pwrite[5] = 0; pready[5] = 0;
    cycle[6] = 28; psel[6] = 1; penable[6] = 1; pwrite[6] = 0; pready[6] = 0;
    cycle[7] = 29; psel[7] = 1; penable[7] = 1; pwrite[7] = 0; pready[7] = 0;
    cycle[8] = 30; psel[8] = 1; penable[8] = 1; pwrite[8] = 0; pready[8] = 0;
    cycle[9] = 31; psel[9] = 1; penable[9] = 1; pwrite[9] = 0; pready[9] = 0;
    cycle[10] = 32; psel[10] = 1; penable[10] = 1; pwrite[10] = 0; pready[10] = 1;
    // The monitor reads every row and drives nothing.
    for (int i = 0; i < N; i++) begin
      if (psel[i] && !penable[i] && done_at == cycle[i] - 1) back_to_back++;
      if (psel[i] && penable[i] && !pready[i]) waits++;
      if (psel[i] && penable[i] && pready[i]) begin transfers++; if (pwrite[i]) writes++; done_at = cycle[i]; end
    end
    $display("transfers %0d (writes %0d), wait cycles %0d, back to back %0d", transfers, writes, waits, back_to_back);
  end
endmodule
ConceptHow did soc_tb attach its APB checker to the fast APB bus?
ConceptOn the good chip, a read of ap_pwrctl stayed in its access phase from cycle 23 to cycle 32. What is that?
ConceptWhy does soc_tb end a run at the first checker error?
ConceptA block team's APB checker reports on every slow-bus access of the good chip. What is wrong?

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.

Practice

Report a problem with this page