AMBA AXI · Module 4
BRESP & Write Response Timing
Decode the AXI write response — OKAY, EXOKAY, SLVERR, DECERR — what each means, SLVERR vs DECERR localization, and exactly when B may arrive.
The B channel (4.3) carries one signal that decides whether a write succeeded: BRESP. This chapter decodes its four values — OKAY, EXOKAY, SLVERR, DECERR — and, just as importantly, teaches what each tells you about where a write went wrong. The SLVERR-vs-DECERR distinction alone localizes a failure to "inside the target" versus "no target at all," saving hours of debugging. We also pin down the timing: when B is allowed to arrive (after the write data, never before) and that there's no upper bound on how long it may take. BRESP shares its encoding with the read channel's RRESP, so this decode applies to both.
1. The Response Decides Success
A write isn't successful because the data went out — it's successful because BRESP says so. BRESP is a 2-bit code returned once per write transaction (4.3), and it is the manager's only authoritative statement that the write reached its target and was accepted. Ignoring it (treating every write as OKAY) is the silent-corruption bug class from earlier chapters; decoding it is how a robust master knows what actually happened.
2. The Four BRESP Codes
BRESP | Code | Meaning |
|---|---|---|
OKAY | 2'b00 | Normal access succeeded |
EXOKAY | 2'b01 | Exclusive access succeeded (only for exclusive writes) |
SLVERR | 2'b10 | Slave error — a real target was reached but it failed the access |
DECERR | 2'b11 | Decode error — no target exists at that address |
Two are success (OKAY, EXOKAY) and two are failure (SLVERR, DECERR). The same encoding is used for the read channel's RRESP, so learning it here covers both directions.
// Conceptual — act on the write response code.
case (bresp)
2'b00: /* OKAY */ ; // normal success — done
2'b01: /* EXOKAY */ mark_exclusive_ok(); // exclusive write succeeded
2'b10: /* SLVERR */ handle_slave_error(); // target rejected — look inside the slave
2'b11: /* DECERR */ handle_decode_error(); // no slave at addr — fix address / map
endcase3. OKAY and EXOKAY
OKAY is the normal-success response — the write reached its target, was accepted, and completed. The overwhelming majority of writes return OKAY.
EXOKAY is the success response specifically for an exclusive access. Exclusive accesses (the AXI mechanism for atomic read-modify-write, covered in Module 9) ask "did my exclusive write succeed without another agent intervening?" — and EXOKAY is the "yes, exclusively" answer. Critically, a normal (non-exclusive) write must never return EXOKAY; it returns OKAY. Seeing EXOKAY on a transaction that wasn't an exclusive access is itself a bug. So EXOKAY is not "extra okay" — it's a narrow, exclusive-access-only signal.
4. SLVERR vs DECERR — Where the Write Died
The two error codes are the most valuable diagnostic in AXI, because they tell you where the failure happened:
DECERR(decode error) — the interconnect could not route the address to any subordinate. The target address falls in a hole in the memory map, so the interconnect's default slave answers withDECERR. Meaning: no target exists there. Fix: the address or the memory map — the transaction was aimed at nothing.SLVERR(slave error) — the address decoded to a real subordinate, but that subordinate rejected the access: writing a read-only register, an unsupported transfer size, a FIFO overflow, an internal fault. Meaning: the target exists but said no. Fix: look inside that subordinate.
The one-line mnemonic: DECERR → fix the address/map (nothing's there); SLVERR → fix the target (it's there but unhappy). A manager that lumps both into "error" loses this localization; keep them distinct.
5. When B May Arrive
BRESP rides the B handshake, and its timing is bounded on one side only:
- Earliest: B may assert only after the write data is accepted — i.e., after the
WLASTbeat'sWhandshake (the B-after-W rule, Module 3.5). The very soonest a subordinate can driveBVALIDis the cycle afterWLASTis accepted; it must not be same-cycle-or-earlier, and certainly not before the data. - Latest: there is no fixed upper bound. A subordinate may take as long as it needs (a slow memory, a busy controller) before responding; the manager waits. This is normal — write latency lives here.
6. The Response on a Waveform
A write that targets an unmapped address: the data is accepted, then the default slave returns DECERR on B.
B response — DECERR on an unmapped write
8 cyclesThe handshake itself is indistinguishable from a successful one — BVALID/BREADY behave identically. Only the code differs, which is exactly why a master must read BRESP rather than assume success from a completed handshake.
7. Acting on the Code
A robust master routes each code to the right action:
8. Common Misconceptions
9. Debugging Insight
10. Verification Insight
11. Interview Questions
12. Summary
BRESP is the 2-bit verdict on a write, returned once per transaction: OKAY (normal success), EXOKAY (exclusive-access success only — never for normal writes), SLVERR (a real target rejected the access), and DECERR (no target at that address; the interconnect's default slave answered). The error pair is the key diagnostic: DECERR → fix the address/map (nothing's there); SLVERR → fix the target (it's there but refused). The same encoding serves the read channel's RRESP.
Timing is bounded below and open above: B may assert only after the write data is accepted (B-after-W) and may then come the next cycle or arbitrarily later — a slow B is latency, not a bug; only a B before WLAST, or one that never arrives, is wrong. Because the B handshake looks identical regardless of code, a master must read BRESP (a completed handshake ≠ success), and verification must negatively test each code rather than only the happy path. With the response decoded, Module 4 closes by assembling the whole write on annotated waveforms.
13. What Comes Next
The write path's mechanics are complete; next, see them all together:
- 4.6 — Write Transaction Waveforms (coming next) — annotated end-to-end write waveforms: single, burst, and stalled.
Previous: 4.4 — Write Ordering & WLAST. For the broader protocol catalog, see the AMBA family overview doc.