AMBA AXI · Module 4
Write Ordering & WLAST
How AXI ties the write channels together — WLAST as the data-phase terminator, AW↔W ordering, and the AXI3→AXI4 WID change that removed write-data interleaving.
The three write channels are decoupled — but a write is still one transaction, so something must tie AW, W, and B back together. Two mechanisms do it: WLAST, which terminates the data phase and tells the subordinate where one write's data ends, and the ordering rule, which pairs each W burst to its AW even though the channels run independently. This chapter details WLAST timing, how AW and W relate in time (independent, but paired by order), and the AXI3→AXI4 WID change that removed write-data interleaving — a favorite interview topic and a real bridge headache. It builds on the AW/W/B channels (4.1–4.3); the response codes are next.
1. WLAST — The Data-Phase Terminator
WLAST answers a question the W channel must answer for every burst: where does this write's data end? Because the channels are decoupled and (in AXI4) carry no per-beat ID, the subordinate can't know the burst length from the W channel alone — so the manager asserts WLAST on the final beat to mark the boundary.
WLAST has three jobs, and all three depend on it being on the right beat:
- It ends the data phase. The subordinate now has all the write data and may proceed to respond.
- It gates B. Per the B-after-W ordering (Module 3.5),
BVALIDmay assert only after theWLASTbeat is accepted. - It must match
AWLEN.WLASTmust land on beat numberAWLEN+1— the count declared on AW. If it lands early or late, the subordinate and the AW disagree on the burst length, malforming the transaction.
So WLAST is the W channel's self-description of its own length, and it must agree with what AW promised.
2. WLAST Timing
On the waveform, WLAST is high for exactly the final beat's transfer and low for all earlier beats.
WLAST — asserted on the final beat only
7 cyclesA subtle but common bug: a burst whose WLAST never asserts (off-by-one length logic, or a counter that misses) leaves the subordinate waiting forever for the data phase to end — so it never drives B and the write hangs. WLAST isn't optional bookkeeping; it's the terminator the whole transaction depends on.
3. AW ↔ W Ordering — Independent, but Paired by Order
AW and W are independent channels (Chapter 2.4): in AXI4 the write data may arrive before, with, or after the write address. A manager that already has data ready can stream W beats before the AW handshake; another can send AW first and W later. The subordinate must accept either timing.
But independent timing does not mean arbitrary pairing. Because AXI4 has no WID, the subordinate pairs them by order: the first AW pairs with the first complete W burst (the one ending in its WLAST), the second with the second, and so on. So the rule is: addresses are issued in order, write-data bursts are delivered in order, and the Nth burst belongs to the Nth address — regardless of the relative timing of the two channels.
4. The Write-Data Ordering Rule
Stated precisely for AXI4: a manager must deliver its write-data bursts in the same order it issued the addresses, one complete burst at a time. No interleaving — a transaction's beats (through WLAST) all come before the next transaction's first beat. This is what lets the subordinate pair W to AW by order without any ID.
In subordinate terms, this is a clean queue — no per-ID reassembly:
// Conceptual — AXI4 pairs the Nth write-data burst to the Nth address, in order.
// (No WID: write data is NOT interleaved, so just collect one full burst at a time.)
always @(posedge aclk) begin
if (awvalid && awready) aw_q.push('{awid, awaddr, awlen}); // addresses in order
if (wvalid && wready) begin
cur_burst.push(wdata, wstrb);
if (wlast) begin
txn = aw_q.pop(); // this completed burst belongs to the oldest AW
apply_write(txn, cur_burst); // pair by order — no ID matching needed
cur_burst.clear();
end
end
end5. AXI3 → AXI4: The WID Change
This is where the history matters. AXI3 had a WID signal on the write-data channel, and it existed for one purpose: to allow write-data interleaving — beats from different outstanding write transactions could be mixed together on the W channel, each beat tagged with the WID of the transaction it belonged to, so the subordinate could sort them out.
AXI4 removed WID and forbade write-data interleaving. Write data must now be sent in address order, one full burst at a time — exactly the rule above. The trade was deliberate: interleaving added significant complexity to subordinates (per-ID write-data reassembly buffers) for little real-world benefit, since most masters didn't interleave anyway. Removing it makes AXI4 write subordinates much simpler.
The practical fallout: bridging AXI3 → AXI4 requires de-interleaving the WID-tagged write data into contiguous, in-order bursts (and dropping WID); bridging the other way may need to add it. It's one of the specific behaviours a generation converter must reconcile (Chapter 2.5).
6. Common Misconceptions
7. Debugging Insight
8. Verification Insight
9. Interview Questions
10. Summary
A write is decoupled across three channels but remains one transaction, tied together by WLAST and ordering. WLAST terminates the data phase: it must assert on beat AWLEN+1, it tells the subordinate the data is complete, and it gates B (B-after-W). A missing or mis-placed WLAST either hangs the write or makes the burst length disagree with AW. AW and W are independent in time — in AXI4 the data may precede, accompany, or follow the address — but they are paired by order: the Nth complete W burst belongs to the Nth address, because AXI4 has no WID and forbids write-data interleaving.
That last point is the AXI3→AXI4 change: AXI3's WID allowed interleaved write data (requiring per-ID reassembly in the subordinate); AXI4 removed it for simplicity, mandating contiguous, in-order bursts — so an AXI3→AXI4 bridge must de-interleave. Debug by checking WLAST position against AWLEN and confirming W bursts are contiguous and in issue order; verify with WLAST-alignment and no-interleaving assertions plus all-three AW/W timings. With ordering and WLAST settled, the last write topic is decoding the response itself.
11. What Comes Next
The write path is nearly complete; only the response semantics remain:
- 4.5 — BRESP & Write Response Timing (coming next) — decoding
BRESP(OKAY/EXOKAY/SLVERR/DECERR) and exactly when B may arrive. - 4.6 — Write Transaction Waveforms (coming soon) — annotated end-to-end write waveforms (single, burst, stalled).
Previous: 4.3 — The Write Response (B) Channel. For the broader protocol catalog, see the AMBA family overview doc.