AMBA AXI · Module 9
Read & Write Ordering
The canonical statement of AXI's per-ID ordering guarantees — same-ARID reads in order, same-AWID writes in order, no order across different IDs, and no inherent order between reads and writes — and how a master enforces ordering for dependencies.
Module 9 sharpens the ordering model that Module 8 introduced operationally. This opening chapter is the canonical reference: a single, precise statement of what AXI guarantees about transaction ordering, organized around the two ordered-stream systems the protocol actually provides — reads ordered by ARID, writes ordered by AWID — and the deliberate gaps between them. Get this matrix exactly right and every dependency, hazard, and barrier question in the rest of Module 9 follows from it. The headline: AXI orders same-ID, same-direction transactions and nothing else — everything beyond that is the master's job.
1. The Two Ordered-Stream Systems
AXI provides ordering through AxID, and reads and writes are separate ID spaces, giving two independent ordered-stream systems:
- Reads: transactions sharing an
ARIDform an ordered read stream — their data returns in issue order. - Writes: transactions sharing an
AWIDform an ordered write stream — theirBresponses return in issue order.
Within each system, same ID = ordered, different ID = independent (Module 8.3/8.4). The two systems run in parallel and unsynchronized — ARID=5 and AWID=5 are different identifiers in different spaces with no relationship. So "ordering" in AXI always means "within one direction, within one ID."
2. The Complete Ordering Matrix
Stated exhaustively, here is everything AXI guarantees — and doesn't:
| Relationship | Ordered? |
|---|---|
Two reads, same ARID | ✅ Yes — data in issue order |
Two writes, same AWID | ✅ Yes — B responses in issue order |
Two reads, different ARID | ❌ No — may complete in any order |
Two writes, different AWID | ❌ No — may complete in any order |
| A read and a write (any IDs, even same value) | ❌ No — separate spaces, no order |
That's the entire guarantee. The two ✅ rows are the only ordering AXI gives you for free; everything else is unordered so the system can reorder for throughput (Module 8.4). Note the last row especially: a read and a write are never ordered by the bus, regardless of their ID values — this is the most commonly mis-assumed entry and the subject of Chapter 9.2.
ordering-rules — same-ID reads ordered; write response independent
7 cycles3. Enforcing Order for Dependencies
Because the bus orders so little, a master with a dependency must enforce the order itself. The universal mechanism is wait for the response:
- Order write → dependent read (read must see the written value): issue the write, wait for its
Bresponse, then issue the read. (Same ID won't help — different spaces.) - Order read → dependent write (write must not clobber until the read is done): issue the read, wait for its final
Rbeat, then issue the write. - Order two same-direction accesses: simpler — give them the same ID (the same-ID rule orders them) or wait, depending on whether you also need them at the same slave (recall same-ID across slaves serializes, 8.3).
So the master's toolkit is exactly two tools: shared ID (for same-direction ordering, free-ish) and response-wait serialization (for read/write ordering and stronger guarantees, costs latency). Choosing where to spend the response-wait — only at genuine dependencies — is the art of a high-performance correct master.
4. Why AXI Orders So Little
The minimalism is deliberate (Module 8.4): every mandatory ordering constraint forces buffering, blocking, or serialization somewhere, costing throughput. By guaranteeing only same-ID same-direction order, AXI lets the interconnect and subordinates reorder everything else — bypassing slow accesses, scheduling across banks, keeping channels busy. The protocol optimizes for the common case (independent, reorderable traffic) and makes the rarer case (true dependencies) the master's explicit responsibility, rather than penalizing all traffic with conservative global ordering.
The practical contract for a correct master: assume no ordering you didn't explicitly create (shared ID or response-wait). Everything else may legally reorder — and one day, on some interconnect or workload, it will.
5. Common Misconceptions
6. Debugging Insight
7. Verification Insight
8. Interview Questions
9. Summary
AXI's ordering model is a short, exact matrix: same-ARID reads complete in order, same-AWID writes complete in order, and nothing else is ordered — not different IDs (either direction), and never a read against a write (separate ID spaces, regardless of ID value). These are two independent ordered-stream systems (reads by ARID, writes by AWID) running in parallel and unsynchronized. The minimalism is deliberate: guaranteeing little lets the system reorder freely for throughput, pushing dependency ordering onto the master.
The master's toolkit is exactly two tools: shared ID for same-direction ordering, and response-wait serialization for read/write dependencies (and stronger guarantees) — spent only where a real dependency exists. Every ordering bug reduces to a matrix-row mismatch: the design needed ✅ where the bus gives ❌, fixed by creating the order. The robust mental model is "assume no ordering you didn't explicitly create" — correct on every compliant implementation and minimal in serialization. Next: a closer look at the read/write independence this chapter introduced — why the two channels are deliberately decoupled and what that enables and demands.
10. What Comes Next
You've got the ordering matrix; next, the read/write decoupling at its center:
- 9.2 — Read/Write Independence (coming next) — why the read and write channels have no inherent ordering, what that decoupling enables, and the hazards it leaves to the master.
- 9.3 — Exclusive Access (coming soon) — the exclusive monitor and
EXOKAYatomic-access mechanism.
Previous: 8.6 — Verification Challenges. Related: 8.3 — Same-ID Ordering Rules and 8.4 — Different-ID & Out-of-Order Completion — the operational basis of this matrix. For the broader protocol catalog, see the AMBA family overview doc.