Tutorials

Protocols

Learn More

AHB5 can support Exclusive Transfers using the Exclusive_Transfers property. Exclusive Transfers support semaphore-style software sequences.

The common sequence is:

  1. Manager performs an Exclusive Read using HEXCL.
  2. Exclusive Access Monitor records the address and Manager identity.
  3. Manager computes a new value.
  4. Manager performs an Exclusive Write to the same address.
  5. Monitor returns success or failure using HEXOKAY.

If another Manager writes the monitored location between the Exclusive Read and Exclusive Write, the Exclusive Write fails and must not update memory. Software usually retries the sequence. Non-exclusive transfers can occur between the Exclusive Read and Exclusive Write.

The monitor must be able to track at least one address for each Exclusive-capable Manager. Its location is implementation defined, but it must observe all address locations that support Exclusive access. Systems can support Exclusive sequences for main memory but fail them for unsupported regions such as many peripheral registers.

Exclusive signals

SignalPhasePurpose
HEXCLAddress phaseMarks an Exclusive Transfer.
HMASTERAddress phaseIdentifies the Manager or thread for monitor tracking. It must be valid for all transfers, not only exclusive transfers.
HEXOKAYData phase responseReports success or failure of an Exclusive Transfer.

Recommended HMASTER widths depend on interface role: Managers implement enough bits for their exclusive-capable threads, interconnect ports often use 4 bits, and Subordinates or monitors often use 8 bits.

HEXOKAY has strict response rules:

RuleMeaning
Assert only with HREADY HIGHExclusive status is valid only when the transfer completes.
Assert only for Exclusive TransfersNon-exclusive transfers must not receive asserted HEXOKAY.
Do not assert with HRESP=ERRORERROR and Exclusive OKAY success cannot be reported together.
Deasserted on failed Exclusive WriteMemory must not be updated on failure.

Exclusive restrictions

RestrictionReason
Exclusive Transfer must be single beatMonitor checks one access at a time.
Burst type must be SINGLE or INCRNo fixed-length multi-beat exclusive bursts.
No BUSY transferThe exclusive access is a single real transfer.
Address aligned to HSIZERequired for matching and atomic behavior.
HPROT must allow monitor visibilityCache/buffer placement can hide accesses from the monitor.
Matching Exclusive Read and Exclusive Write fields must matchHADDRHSIZEHPROTHBURSTHMASTER, and HNONSEC if present.
Exclusive Write without matching Exclusive Read must failHEXOKAY must be deasserted.
A Manager must not have two Exclusive Transfers outstandingDo not issue a new Exclusive address phase while the previous Exclusive data phase is active for the same HMASTER.
 

Exclusive transfer checklist

CheckReason
Exclusive monitor tracks address and Manager identityNeeded to validate the matching write.
Failed Exclusive Write does not update memoryRequired for correct software retry behavior.
HEXOKAY is routed through the interconnectManager must see success or failure.
Illegal exclusive combinations are testedEdge cases often expose monitor bugs.