AMBA AXI · Module 17
Wrong WSTRB
Diagnose byte-level data corruption from bad WSTRB — strobes that write bytes they shouldn't (clobbering neighbors) or mask bytes they should write (dropping data), and strobes inconsistent with the address/size. Why wrong WSTRB is a silent, byte-granular corruption that the burst structure hides, and the byte-level cross-check that catches it.
The previous debugging chapters dealt with bursts that hang or are the wrong shape. Wrong WSTRB is different: the burst is perfectly well-formed — right handshakes, right LAST, right LEN/SIZE — and the data beats all transfer, but individual bytes are written incorrectly. WSTRB is the per-byte write-enable: each bit says "write this byte lane." When it's wrong, the slave either writes bytes it shouldn't (clobbering neighbors that should have been preserved) or masks bytes it should write (silently dropping intended data), or the strobes are inconsistent with the address/size (an illegal combination). This is the most byte-granular and most silent of the data bugs — nothing hangs, the burst looks valid, and the corruption hides inside otherwise-correct transactions. This chapter diagnoses it: the failure modes, why they're invisible at the burst level, and the byte-level cross-check that catches them.
1. What WSTRB Does and How It Goes Wrong
WSTRB has one bit per data byte (DATA_W/8 bits); a set bit means "write the corresponding byte lane," a clear bit means "leave that byte unchanged." It exists for partial-word and byte-granular writes — writing one field of a register, a sub-word store, an unaligned transfer. It goes wrong in three ways: extra strobes (bits set that shouldn't be → writes bytes that should have been preserved, clobbering neighbors), missing strobes (bits clear that should be set → intended bytes never written, silently dropped), and inconsistent strobes (a strobe pattern that doesn't match the address/SIZE — e.g. a strobe on a lane outside the transfer's active byte range — which is an illegal combination).
2. Extra Strobes: Clobbering Neighbors
The classic corruption: a write intended to update only some bytes of a word asserts more strobe bits than it should, so the slave overwrites bytes that should have been preserved. The neighbors are clobbered with whatever was on those byte lanes (often stale or zero), silently corrupting adjacent fields. The waveform shows a write whose WSTRB is wider than the intended field, overwriting bytes that should have kept their old values.
Extra WSTRB strobe clobbers a neighbor
7 cyclesThe deceptive part: the response is OKAY, the burst is valid, the intended byte was written correctly — only the neighbor is wrong, and that surfaces only when something reads it back. Nothing in the write transaction itself looks abnormal.
3. Missing Strobes and Inconsistent Strobes
Missing strobes are the inverse: a strobe bit that should be set is clear, so an intended byte is never written — the data is silently dropped and a later read returns the stale value. Inconsistent strobes are an illegal-combination bug: the strobe pattern doesn't match the transfer's active byte lanes implied by the address and SIZE. For a narrow or unaligned transfer, only certain lanes are valid; a strobe asserted outside that range (or a pattern that contradicts the size/alignment) violates the protocol. Unlike extra/missing strobes (wrong-but-legal corruption), inconsistent strobes are a legality violation a protocol checker can catch.
4. The Byte-Level Cross-Check
Because a wrong-but-legal WSTRB produces a perfectly valid-looking burst, catching it requires a byte-granular check: the reference model must apply the observed WSTRB exactly as the slave should, byte by byte, and the scoreboard then compares the resulting memory state — including the neighbor bytes that should have been preserved — against the intended result. A whole-word data comparison isn't enough; the corruption is at byte granularity, so the check must be too. The protocol assertion catches the inconsistent (illegal) strobes; the scoreboard's byte-level model catches the wrong-but-legal extra/missing strobes by verifying every byte, written and preserved.
5. Common Misconceptions
6. Debugging Insight
7. Verification Insight
8. Interview Questions
9. Summary
Wrong WSTRB is byte-level data corruption inside a perfectly well-formed burst — right handshakes, LAST, LEN/SIZE, and an OKAY response — making it the most silent of the data bugs. WSTRB is the per-byte write-enable, and it fails three ways: extra strobes (write bytes that should have been preserved → clobber neighbors), missing strobes (don't write intended bytes → silently drop data), and inconsistent strobes (a pattern that doesn't match the address/SIZE active lanes → an illegal combination). The extra/missing cases are wrong-but-legal and silent at write time; they surface only on read-back, when a corrupted neighbor or a stale dropped byte is read.
Catching them requires byte-granular checking: the reference model applies the observed WSTRB byte-by-byte (mirroring the slave) and the scoreboard compares every resulting byte — including the preserved neighbors — against intent, because a whole-word check can't see a single corrupted byte and the corruption isn't visible at write time. Protocol assertions catch only the inconsistent (illegal) strobes; the wrong-but-legal extra/missing strobes need the byte-level scoreboard — the compliance-vs-correctness split at byte granularity. Verification must sweep all strobe patterns across narrow and unaligned transfers (where the byte-lane/strobe-alignment logic, the usual culprit, is exercised) and use write-then-read as the detector. This completes the burst-bug hierarchy — 17.1 (beat won't transfer) → 17.2 (burst ends wrong) → 17.3 (burst is wrong shape) → 17.4 (bytes within a correct burst are wrong) — each finer-grained and more hidden, each needing the check to descend one level, ending at the individual byte and read-back. Next, we turn from data to the response signals: interpreting and tracing BRESP/RRESP errors.
10. What Comes Next
You can now catch byte-level data corruption; next, the response signals:
- 17.5 — BRESP / RRESP Errors (coming next) — interpreting
SLVERR/DECERRon the response channels and tracing them back to their root cause (bad address, read-only write, faulting slave, interconnect decode).
Previous: 17.3 — Wrong LEN / Wrong SIZE. Related: 6.7 — Write Strobes (WSTRB) for the strobe semantics, 7.7 — Narrow & Unaligned Transfers for the byte-lane logic where strobe bugs hide, and 16.4 — AXI Scoreboards for the byte-level reference model.