Performance Checks and Interconnect Coverage

A fabric can be right and still too slow, and a test suite can pass and still leave routes untried. Read latency and throughput off a real run, and turn a latency requirement into a checker. Then build the coverage model of a fabric: who reached where.

You Will Be Able To

  • Read latency and throughput of each manager from a recorded run.
  • Turn a measured worst case into a latency budget and a checker that runs in every test.
  • Describe the coverage model of a fabric as a cross of managers and targets.
  • Read a coverage report of a fabric and say which routes no test has driven.
Lesson
V7.7
Time
26 min
Runs on
Your browser
Check
5 questions

Every test of a fabric can pass while one manager quietly waits too long, or one route is never driven at all. Neither shows up as a failure. One needs a performance check; the other needs coverage.

Latency and Throughput Read off a WaveformThe seat's port, one value per cycle, while it reads SRAM back to back beside a DMA copy. Each transfer starts where hready is high with an address phase and ends at the next high hready.
012345678910111213141516171819202122232425262728293031system cycle6162636465666768697071727374757677787980818283848586878889909192htransNSEQhreadylatency.2.31.2.31.2.31.2.31.2.31.system cycle 61
Scroll horizontally ↔
  1. Cycle 0

    System cycle 61: an address phase is taken (hready high, NSEQ). The latency row shows each transfer's latency at the cycle it ends.

  2. Cycle 2

    A transfer of 2 cycles: hready is low for one cycle while a DMA read goes first.

  3. Cycle 5

    A transfer of 3 cycles, then one of 1. The 3 is a DMA write that went first, plus the cycle SRAM waits when a read follows a write.

  4. Cycle 31

    Over the full window of 64 cycles the seat finished 31 transfers: a throughput of 48 per 100 cycles.

Recorded on ap_soc v1.5, Verilator 5.052 2026-09-05, +core=bfm, from the bench's sample window (record-v7-labs.mjs, section perf). The lab's table is the one of lesson V7.4.

Before You Start

Read Error Paths, Throughput, Latency and Back-Pressure and Functional Coverage: What Was Tested first.

Five questions this page answers
Question
1What are latency and throughput of a fabric, and how are they read off a run?
2How does a latency requirement become a check that runs in every test?
3How is a latency budget chosen?
4What does a coverage model of a fabric cross?
5What can a coverage report of a fabric not tell you?

The Idea: Fast Enough, and Tried Everywhere

A fabric has two jobs beyond being right. It must be fast enough: each manager's transfers must finish in time, and enough of them must get through. And the tests must have tried it everywhere: every manager on every route it can take.

Latency is the time one transfer takes, from its address phase to the end of its data phase. Throughput is how many finish in a stretch of time. A performance check states a requirement on one of them and watches it. A checker that watches latency on every transfer turns a performance requirement into a check that runs in every test.

Coverage answers the other question. A fabric's coverage model crosses who asked with where it went: manager by target. A hole in that cross is a route no test has driven, however green the regression is.

Where Performance Monitors and Coverage SitPassive observers at each manager port measure latency and throughput; the coverage build counts which manager reached which target.
  • Manager
  • Interconnect
  • Memory
  • Monitor
  • Measure
  • Report
  • Data
  • Analysis
Where Performance Monitors and Coverage SitPassive observers at each manager port measure latency and throughput; the coverage build counts which manager reached which target. manager Manager ports seat, DMA, debug interconnect Fabric decode, arbitrate,route memory Targets ROM, SRAM, bridges,... monitor Latency monitor per transfer, permanager measure Throughput transfers per window report Coverage manager × target bins transfersrouteswatchescountswho reached where
  1. manager Manager portsseat, DMA, debug
    • transfers → Fabric
  2. interconnect Fabricdecode, arbitrate, route
    • routes → Targets
    • who reached where → Coverage
  3. memory TargetsROM, SRAM, bridges, ...
  4. monitor Latency monitorper transfer, per manager
    • watches → Manager ports
    • counts → Throughput
  5. measure Throughputtransfers per window
  6. report Coveragemanager × target bins
  1. Transfers flow

    Each manager's transfers cross the fabric to their targets.

  2. Latency and throughput

    A monitor at a manager port times each transfer and counts how many finish per window.

  3. Coverage

    The coverage build counts each manager's accepted address phases by target: the cross of who and where.

Read the diagram as text
  • Manager ports: seat, DMA, debug
  • Fabric: decode, arbitrate, route
  • Targets: ROM, SRAM, bridges, ...
  • Latency monitor: per transfer, per manager
  • Throughput: transfers per window
  • Coverage: manager × target bins
  • Manager ports → Fabric: transfers
  • Fabric → Targets: routes
  • Latency monitor → Manager ports: watches
  • Latency monitor → Throughput: counts
  • Fabric → Coverage: who reached where

The latency checker of problem V7.7.1 sits at the seat's port; the coverage bins are the chip's plan of stage E11.

A Coverage Model of the Fabric
CrossBins on ap_socOne hit is
Manager × targetvisit.<seat, dma, debug, core>.<rom, clint, plic, sram, uart, gpio, timer, sysctl, spi, dma, watchdog, pwrctl, unmapped>an accepted address phase of that manager in that window
DMA writes × targetdma.write.<same targets>a write of the DMA into that window
Mode × targetwindow.<cpu, bfm>.<same targets>an accepted address phase while the processor, or the seat, owns the core's port
DMA overlap × targetdma.core_overlap.<same targets>a core data access to a window the running DMA job uses

From the chip's coverage plan (docs/soc/chip-coverage.md, stage E11; tools/soc/ap_soc/bench/soc_tb/README.md, "Chip coverage (E11)"). Direction (read or write) is a dimension only for the DMA's writes; other kinds are not bins of this plan.

Read that model with care. It says which manager reached which target, and nothing about how. A full fabric model would cross manager by target by kind: read or write, size, OKAY or ERROR. It would add bins for collisions and for who waited behind whom. ap_soc's plan has direction only for the DMA's writes.

What This Model Leaves Out
A dimension a full fabric model would haveIn ap_soc's plan?What a missing bin can hide
Read against write, for every managerOnly the DMA's writesA route that works for reads and loses writes
Transfer size: byte, half-word, wordNoA wrong byte lane on one route
Answer: OKAY against ERROR, per managerNo; an ERROR still counts as a visitA hole that answers OKAY to one manager
Collisions: two managers at one target in one cycleNo: dma.core_overlap counts a core access during a DMA job, not a meeting in one cycleEvery concurrency bug of lessons V7.3 to V7.5
Arbitration outcomes: who waited behind whomNoA fairness check that never saw anyone wait behind more than one transfer

MEHTA-DV 14.6 lists bus-cycle types and crosses between initiators among an interconnect's coverage. The plan of ap_soc covers part of that; the rest would be new bins.

New Words

New words on this page
WordMeaning
ThroughputHow many transfers finish in a given time, here per 100 cycles.
Latency budgetThe most cycles a transfer may take; a requirement a checker can watch.
Performance monitorA passive observer that measures latency or throughput during a run.
Coverage modelThe list of things a test suite must have made happen, as named bins.
CrossBins for every pair of values of two things, such as manager and target.
Coverage holeA bin no test has hit.

The Smallest Example: Numbers from a List of Transfers

A monitor needs only two numbers per transfer: the cycle its address phase was taken and the cycle its data phase ended. Here are four of the seat's transfers from the run at the top.

Four transfers, by hand
Address phase takenData phase endedLatency
61632
63663
66671
67692

The example below computes the same for all the transfers in the window.

Latency is end minus start for each transfer; the worst of these four is 3. Throughput is the count over the time: 31 transfers in a window of 64 cycles is 48 per 100 cycles. The two trade off: here the seat waited longer exactly when the DMA took its turn.

The Rules

  1. Rule 1: Measure latency per transfer and throughput per window, per manager.

    A total for the whole fabric hides the one manager that is starved or slow.

  2. Rule 2: Turn a requirement into a checker, not a one-off measurement.

    A monitor that checks the budget on every transfer of every test sees traffic no single measurement made.

  3. Rule 3: Set a budget from the measured worst case, with a margin.

    Measure the good chip under heavy traffic, then add room. A budget below the worst case cries wolf; one far above hides real slowness.

  4. Rule 4: Report when the budget is passed, not when the transfer ends.

    A transfer that never ends never reaches its end. Count while it waits.

  5. Rule 5: Model fabric coverage as a cross of managers and targets.

    Each cell is a route. Add the kinds that matter, such as the DMA's writes, and the modes.

  6. Rule 6: Read holes as untested routes, and close them on purpose.

    A hole is not a bug; it is a place no test has looked. Coverage counts transfers, not correctness, so the checks still decide pass or fail.

Sources for These Rules

Performance analysis of an interconnect: bandwidth and latency targets, cycle-accurate models, keeping one block from dominating (MEHTA-DV 14.2.1).

The coverage of an interconnect: code coverage, bus-cycle types, crosses between initiators, protocol cover, registers and state machines (MEHTA-DV 14.6).

The chip's coverage plan and its visit, window, dma.write and dma.core_overlap bins: docs/soc/chip-coverage.md (stage E11). See also the bench README, "Chip coverage (E11)". The coverage option of a graded problem: README, "Grading chip coverage and power sequences (E15)".

Vendor interconnect verification products exist and are named in MEHTA-DV 14.7 and 14.8; this page does not describe them.

The Lab: Three Managers, Measured

The run at the top is the table of lesson V7.4. It has a DMA copy inside SRAM, three debug reads and 512 back-to-back seat reads. A probe counted every transfer of every manager.

Each manager over the whole run
ManagerTransfersWorst latencyMean latencyPer 100 cycles
Seat52031.5718
DMA192117
Debug manager3110

2,742 cycles in all, on the same bench on Icarus with a probe in soc_tb (record-v7-labs.mjs, section perf). The site's Verilator bench gave the same result block: pass, 2742 cycles.

The seat finished 520 transfers, 18 per 100 cycles, with a worst latency of 3 (rule 1). The DMA finished 192, a read and a write for each of 96 bytes, each in 1 cycle. The debug manager finished 3. Each of its reads costs hundreds of cycles at the JTAG pads, but one cycle on the fabric.

Problem V7.7.1 sets a latency budget for the seat. Its traffic mixes SRAM, the fast APB and the slow APB beside the other managers. Under that traffic the worst latency measured on the good chip was 15 cycles, at ap_pwrctl STATUS on the slow APB. The budget is 40: 25 cycles of margin. It is well below the 96 wait cycles at which the bench's APB checker gives up (rule 3).

Now coverage. A small lab table read CHIP_ID, SRAM and MSIP from the seat and made one DMA copy inside SRAM. It ran on the coverage build of the bench, against the fabric bins of problem V7.7.3.

The lab table (record-v7-labs.mjs, section perf).
core r 10004000 00000000 ffffffff 2a5310c5 0 1
core r 80003000 00000000 00000000 00000000 0 1
core r 02000000 00000000 00000001 00000000 0 1
dma copy 80003000 80003040 00000004 00000002 0 1
The fabric bins it hit and the holes it left
HitHoles
visit.seat.clintvisit.seat.rom
visit.seat.sramvisit.seat.plic
visit.seat.sysctlvisit.seat.uart
visit.dma.sramvisit.seat.pwrctl
dma.write.sramvisit.seat.unmapped
visit.dma.sysctl
visit.dma.uart
dma.write.uart
visit.debug.sram
visit.debug.sysctl
visit.debug.clint

From the coverage report of one sample run.

5 bins hit, 11 holes. The holes read like a to-do list: the seat never reached ROM, ap_plic, UART0, ap_pwrctl or a hole of the map. The DMA never wrote into UART0, and the debug manager drove no route at all (rule 6). Every check of the table passed: the bench wrote its pass word, 0x0000900D. The holes are routes it never tried.

Why It Is Built This Way

Why a checker for latency rather than a test that measures it? A test measures the traffic it makes. A checker bound to the port measures every test's traffic, including the stress tests and the error tests. It reports the first transfer that breaks the budget, wherever it happens.

Why does the coverage plan count accepted address phases, not finished transfers? An access that ends in ERROR still exercised its route: the decoder chose, the default subordinate answered. Counting it keeps the hole of the map coverable.

Traps

The average trap: the fabric's mean latency is fine, so performance "passes". One manager's worst case is ten times the mean, and that is the one that misses its deadline. Watch the worst case, per manager.

The check-at-the-end trap: a latency monitor computes latency when the data phase ends. A transfer that never ends is never measured, so a hang passes the performance check. Count while it waits.

The green-regression trap: every test passes, so the fabric is "done". The coverage report shows the debug manager never drove a route. Coverage is how you know what a passing suite did not do.

The cost-blind trap: coverage is closed with the debug manager's reads, hundreds of cycles each, where a seat read would do. Close each hole with the cheapest manager that reaches it, and keep the expensive one for its own routes.

The full-cross trap: every bin of manager by target is hit, so the fabric is "covered". But the model had no reads against writes and no collisions. A route that loses only writes, or an arbiter bug that needs two managers in one cycle, sits outside every bin. A full report says only that its own bins were hit.

At Scale

ap_soc~12 blocks
Phone-class SoChundreds of blocks

This section looks ahead. ap_soc's fabric has four managers and a coverage plan of a few hundred bins.

  1. Performance models

    Big fabrics are sized with cycle-accurate models before RTL, then checked against the RTL with the same traffic. The two must agree on latency and throughput.

  2. Bandwidth per window

    Requirements are stated as bytes per microsecond per manager, under named traffic profiles, and checked by monitors on every port.

  3. Coverage at scale

    Crosses of hundreds of managers and targets are generated from the same map as the fabric, and merged across thousands of tests.

Try It

Run it: the monitor turns the recorded transfers into latency and throughput.

Keep only the first half of the transfers (the predict question below). Which number changes, and which does not?

Why does the worst latency matter more to a manager with a deadline than the mean?

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: transfers: 31 in a window of 64 cycles latency: worst 3 cycles, mean 2.00 throughput: 48 transfers per 100 cycles

Check Yourself

Predict the outputThe monitor now gets only the first half of the transfers, over the same window. What is the last line printed?
// 16 transfers of one manager, recorded on ap_soc v1.5: the cycle its address phase was accepted and the
// cycle its data phase ended. A performance monitor turns them into latency and throughput.
module tb;
  localparam int N = 16;
  int start [N], stop [N];
  int worst = 0, total = 0;
  initial begin
    start[0] = 61; stop[0] = 63;
    start[1] = 63; stop[1] = 66;
    start[2] = 66; stop[2] = 67;
    start[3] = 67; stop[3] = 69;
    start[4] = 69; stop[4] = 72;
    start[5] = 72; stop[5] = 73;
    start[6] = 73; stop[6] = 75;
    start[7] = 75; stop[7] = 78;
    start[8] = 78; stop[8] = 79;
    start[9] = 79; stop[9] = 81;
    start[10] = 81; stop[10] = 84;
    start[11] = 84; stop[11] = 85;
    start[12] = 85; stop[12] = 87;
    start[13] = 87; stop[13] = 90;
    start[14] = 90; stop[14] = 91;
    start[15] = 91; stop[15] = 93;
    for (int i = 0; i < N; i++) begin
      total += stop[i] - start[i];
      if (stop[i] - start[i] > worst) worst = stop[i] - start[i];
    end
    $display("transfers: %0d in a window of 64 cycles", N);
    $display("latency: worst %0d cycles, mean %0d.%02d", worst, total / N, (total * 100 / N) % 100);
    $display("throughput: %0d transfers per 100 cycles", N * 100 / 64);
  end
endmodule
ConceptIn the lab, how was the latency budget of problem V7.7.1 chosen?
ConceptA fabric coverage report shows visit.debug.sram as a hole. What does it mean?
ConceptWhy is the debug manager's throughput so low in the lab, though its fabric latency is 1?
ConceptWhich belongs in a coverage model of a fabric?

Common Mistakes

Wrong Judge performance by the mean latency of the whole fabric.

One manager's worst case can miss its deadline behind a good mean.

Fix Measure the worst case per manager, and check it against a budget.

Wrong Measure latency when a transfer ends.

A transfer that never ends is never measured.

Fix Count while it waits and report as soon as the budget is passed.

Wrong Treat a passing regression as complete.

Passing says nothing about routes never driven.

Fix Read the fabric's coverage holes and close them on purpose.

Remember

  • Latency is per transfer, throughput per window; measure both per manager.
  • A latency checker turns a requirement into a check that runs in every test; set its budget from the measured worst case.
  • Report a passed budget while the transfer waits, so a hang cannot pass.
  • A fabric's coverage model crosses managers with targets; its holes are routes no test has driven.

Practice

Report a problem with this page