Tutorials
Protocols
Learn More
Exclusive accesses
Exclusive accesses provide semaphore-like behavior without locking a connection to one Manager. The mechanism uses an exclusive read followed later by an exclusive write. Between those two requests, the Subordinate or monitor tracks whether another write has updated the monitored location.
Exclusive accesses are useful when software wants to implement lock-free synchronization. They are not the same as atomic transactions. An exclusive sequence can fail and require retry; an atomic transaction sends the operation itself to the target.
Exclusive access signaling
Exclusive intent is signaled with AWLOCK and ARLOCK, collectively called AxLOCK.
| Signal | Width | Default | Meaning |
|---|---|---|---|
AWLOCK | 1 | 0b0 | HIGH marks an exclusive write request. |
ARLOCK | 1 | 0b0 | HIGH marks an exclusive read request. |
Exclusive_Accesses | Default | Meaning |
|---|---|---|
True | Yes | Exclusive accesses are supported; AWLOCK and ARLOCK are present. |
False | No | Exclusive accesses are not supported; AWLOCK and ARLOCK are absent. |
| Manager support | Subordinate support | Compatibility |
|---|---|---|
False | False | Compatible. |
False | True | Compatible; lock signals are tied LOW. |
True | False | Not compatible for useful exclusive behavior; exclusive accesses continually fail but the interface does not deadlock. |
True | True | Compatible. |
Exclusive access sequence
The basic sequence is:
- The Manager issues an exclusive read from an address.
- If the Subordinate can monitor the location, it returns
EXOKAYand records the address andARID. - Later, the Manager issues an exclusive write to the same address using
AWIDmatching the earlierARID. - If no other Manager wrote the monitored location, the write succeeds, updates memory, and returns
EXOKAY. - If another write occurred, or the monitor no longer matches this address and ID, the exclusive write fails, returns
OKAY, and must not update memory.
| Step | Manager view | Subordinate or monitor view |
|---|---|---|
| Exclusive read | Starts the sequence. | Records the address and ARID if the read can be monitored. |
| Normal writes by other agents | Not controlled by the Manager. | Any write to the monitored location can invalidate the monitor. |
| Exclusive write | Attempts to complete the sequence. | Checks address and AWID against the monitored entry. |
EXOKAY write response | Lock-style update succeeded. | Memory is updated. |
OKAY write response | Lock-style update failed. | Memory is not updated for a supported exclusive monitor. |
If a Manager does not complete the write part of an exclusive sequence, the monitor can continue tracking the address until another exclusive read with the same transaction ID resets the monitored address.
Manager perspective
A Manager starts with an exclusive read. If the read response is EXOKAY, the Manager knows that the Subordinate has recorded the address for exclusivity. If the exclusive read returns OKAY, the data is valid, but the location is not being monitored for exclusive behavior. The Manager should normally treat this as unsupported exclusive access and avoid issuing the matching exclusive write.
A Manager must not start the write part of the sequence until the read part is complete. The write uses a matching ID and matching attributes. If the write returns EXOKAY, the update succeeded. If it returns OKAY, the Manager usually retries the full read-modify-write sequence.
| Response | Exclusive read meaning | Exclusive write meaning |
|---|---|---|
EXOKAY | Read succeeded and the monitor recorded the location. | Write succeeded and updated the location. |
OKAY | Read data is valid, but exclusives are not supported or not monitored. | Write failed the exclusive check and did not update the location, when exclusives are supported. |
Subordinate perspective
A Subordinate that supports exclusive accesses must have monitor hardware. A common implementation has a monitor entry for each exclusive-capable Manager ID. When an exclusive read arrives, the monitor records the address and ARID. It keeps monitoring until a write to the monitored location occurs or until another exclusive read with the same ARID resets the monitored address.
If the Subordinate can process the exclusive read, it returns EXOKAY for every read data transfer. If it cannot process the exclusive read, it must not mix OKAY and EXOKAY responses within one read transaction.
When the exclusive write arrives, the monitor checks whether the address is still monitored with the matching AWID. If the check passes, the write updates memory and returns EXOKAY. If the check fails, the write must not update memory and returns OKAY.
If a Subordinate that does not support exclusive accesses receives an exclusive write, it responds with OKAY and the location is updated. This is why Manager/Subordinate capability matching matters.
Exclusive access restrictions
Exclusive access restrictions include:
| Restriction | Reason |
|---|---|
| Address aligned to total bytes in the transaction. | Monitor behavior depends on the full accessed region. |
| Total bytes are a power of two: 1, 2, 4, 8, 16, 32, 64, or 128 bytes. | Keeps monitor granularity bounded. |
| Length must not exceed 16 transfers. | Matches the exclusive access limit. |
| Domain must not be Shareable. | Exclusive access behavior is not defined for Shareable Domain. |
Opcode must be ReadExclusive or WriteExclusive. | Exclusive intent must match the request opcode. |
AWTAGOP must not be Match. | MTE Match is not allowed with exclusive access. |
Failure to observe these restrictions causes unpredictable behavior.
For an exclusive sequence to succeed, the request attributes must be consistent enough for the read and write to reach the same monitor. The specification lists signals that should match between the exclusive read and write. A compact checklist is:
| Signal group | Signals that should match |
|---|---|
| ID and address | AxID, AxADDR, AxREGION, AxSUBSYSID, AxDOMAIN |
| Shape and lock | AxLEN, AxSIZE, AxBURST, AxLOCK, AxCACHE[1:0] |
| Protection and address space | AxPROT, AxNSE, AxPAS, AxINST, AxPRIV |
| Opcode and translation | AxSNOOP, AxMMUVALID, AxMMUATST, AxMMUFLOW, AxMMUPASUNKNOWN, AxMMUPM, AxMMUSECSID, AxMMUSID, AxMMUSSID, AxMMUSSIDV |
The minimum monitored range is Size * Length. A Subordinate can monitor a larger range, up to 128 bytes. Monitoring a larger range is legal, but it can cause a sequence to fail because a neighboring byte changed even though the exact requested bytes did not.
AXI Protocol