AMBA AXI · Module 17
Timeout Debugging
Use timeouts systematically to localize where an AXI transaction stalled — per-channel and per-transaction watchdogs that turn a silent hang into a labeled error naming the channel, transaction, and wait condition, how to set thresholds, and how the first timer to fire points nearest the root of any stall, hang, or deadlock.
The hang chapters (17.1, 17.7) all relied on one tool: timeouts. A stalled or deadlocked AXI transaction produces a silent failure — nothing happens, no error fires, the simulation just stops progressing — which is the least debuggable symptom possible. A timeout converts that silence into information: a watchdog that fires when a channel or transaction has been waiting too long, emitting an error that names what stalled, where, and what it was waiting on. Done systematically — per channel, per transaction, per resource — timeouts don't just detect a hang, they localize it: the first timer to fire points nearest the root. This chapter is the instrumentation behind all hang debugging: how timeouts work, where to place them, how to set thresholds, and how to read which-fired-first to find the root of any stall, hang, or deadlock.
1. Why Timeouts: Turning Silence into Information
A liveness failure (something that should happen never does) is invisible by nature — there's no event to catch, the system just freezes. Without instrumentation, you discover it only because the test never finishes, and you're left manually staring at a frozen waveform inferring every party's wait condition. A timeout makes the failure announce itself: a counter increments while a transaction/channel is blocked and, past a threshold, fires an error with context. This is the difference between "the sim hung somewhere" and "the AW channel of master 2 has held VALID without READY for 5000 cycles" — the latter is a localized, actionable finding.
2. Where to Place Timeouts: Per Channel, Per Transaction, Per Resource
Granularity determines how much a timeout localizes. Per-channel watchdogs (each VALID-without-READY, or each request awaiting acceptance) catch stuck handshakes at the channel level. Per-transaction watchdogs (each outstanding transaction from issue to completion) catch a transaction that never completes even if its channels individually progressed — and name the transaction (ID, address). Per-resource watchdogs (each buffer slot, outstanding slot, arbiter grant) catch a resource held too long — supplying the wait-for edges (17.7) needed to reconstruct a deadlock. The finer the instrumentation, the more precisely the firing localizes the problem.
The per-transaction watchdog is the workhorse — it tracks each outstanding transaction and fires if completion takes too long:
// Per-transaction watchdog: start a timer when a transaction is issued,
// clear it on completion, fire if it exceeds the threshold.
foreach (outstanding[i]) begin
if (outstanding[i].active) begin
outstanding[i].age <= outstanding[i].age + 1;
if (outstanding[i].age > TXN_TIMEOUT)
$error("TIMEOUT: txn id=%0d addr=%0h issued @%0t never completed, "
"stalled in phase %s (waiting on %s)",
outstanding[i].id, outstanding[i].addr, outstanding[i].t_issue,
outstanding[i].phase, outstanding[i].waiting_on);
end
end
// The 'phase' and 'waiting_on' fields are what localize the stall.3. Setting the Threshold
A timeout threshold must be long enough to not fire on legitimate backpressure/latency (a false positive that masks real behavior) but short enough to catch a hang promptly. The right value is derived from the worst-case legitimate latency: maximum outstanding depth × per-transaction latency, plus margin — anything beyond the longest a transaction could legitimately take is a hang. Too short → false timeouts on slow-but-correct traffic (and you start ignoring timeouts, the worst outcome); too long → hangs take forever to surface. Set it from the system's real latency bounds, not a guess.
4. Which Fired First: Localizing the Root
The diagnostic power of systematic timeouts is temporal ordering: in any hang, many timers eventually fire (every blocked party times out), but the first to fire is nearest the root, and the later ones are downstream victims waiting on it. So you don't just collect that timeouts fired — you record when each fired and read the earliest. For a single stuck point, the first timeout is the originally-blocked channel; for a deadlock, the set of timers that fire together (with no single first, all interdependent) reveals the cycle. The waveform shows a transaction's age counter climbing past the threshold and the timeout firing at the exact stall point.
Per-transaction timeout firing at the stall point
10 cycles5. Common Misconceptions
6. Debugging Insight
7. Verification Insight
8. Interview Questions
9. Summary
Timeouts are the detection and localization backbone for every liveness failure in AXI — stalls, hangs, and deadlocks are all silent (no event fires; the system just freezes), and a timeout converts that silence into a localized, labeled error: a watchdog increments while a transaction/channel/resource is blocked and, past a threshold, fires naming what stalled, where, and what it waited on. Place them at every granularity — per-channel (stuck handshake), per-transaction (never-completes, the workhorse), and per-resource (held slot/grant, supplying the deadlock wait-for edges) — because granularity is what localizes. Set the threshold from worst-case legitimate latency (max outstanding × per-transaction latency + margin): too short causes false positives that train people to ignore timeouts (the worst outcome), too long delays detection.
The diagnostic power is which-fired-first: in a propagating hang the earliest timer is nearest the root and later ones are downstream victims, while a set firing together with mutual waits and no clear first signals a deadlock cycle — so record fire times, not just the fact of firing, and read the earliest plus its named wait condition. The timeout pattern even classifies the hang (clears → stall; single root → stuck point; mutually-waiting set → deadlock) before you open the waveform. This formalizes the instrumentation that 17.1 and 17.7 assumed. The unifying principle is observability for liveness: safety failures self-announce (catch the event), but liveness failures are silent and must be made observable by bounding time and watching the bound — timeouts are that instrument, which is why they underlie the whole hang-debugging family and belong in silicon too. Next, the final chapter assembles every method in Module 17 into one repeatable waveform-debugging methodology.
10. What Comes Next
You now have the detection backbone; the final chapter assembles the whole method:
- 17.9 — Waveform-Based Debug Methodology (coming next) — a single repeatable method for debugging any AXI waveform, integrating the handshake, burst, response, ID, deadlock, and timeout techniques of Module 17.
Previous: 17.7 — Debugging Deadlock. Related: 17.1 — Stuck VALID / Stuck READY and 17.7 — Debugging Deadlock for the hangs timeouts detect, and 13.2 — Latency Analysis for the latency bounds that set the threshold.
Continue learning
Related tutorials
- Related topic
AMBA — AHB · APB · AXI
ARM's AMBA family — channels, handshakes, ordering rules, and verification strategy.
- Related topic
AXI4 Write Channel — AW, W & B Handshake
The AMBA 5 AXI4 write path — AW/W/B channels, the VALID/READY handshake, channel-dependency rules, and BRESP write-response semantics.
- Related topic
Common Handshake Bugs
A field guide to the recurring AXI handshake bugs — dropped VALID, mutated payload, VALID-waits-for-READY deadlock, ordering violations, and undrained responses — and how to spot each.
- Related topic
Stuck VALID / Stuck READY
Diagnose an AXI channel hung on VALID or READY — the two stuck signatures, the decisive question of which side is waiting on which, the combinational VALID-depends-on-READY deadlock, the cross-channel dependency hang, and the systematic waveform-reading method that localizes a stuck handshake to its root cause.
Standards & specifications
- Governing standard
- Arm AMBA AXI Protocol Specification (IHI 0022)(opens Arm in a new tab)
Defines the AXI channels, handshake and ordering rules. RTL structure, interconnect topology and verification strategy are design choices this specification does not mandate.
This page also covers RTL structure, verification approach and debugging technique. Those are engineering practice built on the standard, not requirements the standard itself imposes.
Where this fits
Part of the AMBA AXI curriculum.
