Tutorials

Protocols

Learn More

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.

SignalWidthDefaultMeaning
AWLOCK10b0HIGH marks an exclusive write request.
ARLOCK10b0HIGH marks an exclusive read request.
Exclusive_AccessesDefaultMeaning
TrueYesExclusive accesses are supported; AWLOCK and ARLOCK are present.
FalseNoExclusive accesses are not supported; AWLOCK and ARLOCK are absent.
Manager supportSubordinate supportCompatibility
FalseFalseCompatible.
FalseTrueCompatible; lock signals are tied LOW.
TrueFalseNot compatible for useful exclusive behavior; exclusive accesses continually fail but the interface does not deadlock.
TrueTrueCompatible.

Exclusive access sequence

The basic sequence is:

  1. The Manager issues an exclusive read from an address.
  2. If the Subordinate can monitor the location, it returns EXOKAY and records the address and ARID.
  3. Later, the Manager issues an exclusive write to the same address using AWID matching the earlier ARID.
  4. If no other Manager wrote the monitored location, the write succeeds, updates memory, and returns EXOKAY.
  5. 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.
StepManager viewSubordinate or monitor view
Exclusive readStarts the sequence.Records the address and ARID if the read can be monitored.
Normal writes by other agentsNot controlled by the Manager.Any write to the monitored location can invalidate the monitor.
Exclusive writeAttempts to complete the sequence.Checks address and AWID against the monitored entry.
EXOKAY write responseLock-style update succeeded.Memory is updated.
OKAY write responseLock-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.

ResponseExclusive read meaningExclusive write meaning
EXOKAYRead succeeded and the monitor recorded the location.Write succeeded and updated the location.
OKAYRead 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:

RestrictionReason
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 groupSignals that should match
ID and addressAxID, AxADDR, AxREGION, AxSUBSYSID, AxDOMAIN
Shape and lockAxLEN, AxSIZE, AxBURST, AxLOCK, AxCACHE[1:0]
Protection and address spaceAxPROT, AxNSE, AxPAS, AxINST, AxPRIV
Opcode and translationAxSNOOP, 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.