This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What is real application of Exclusive access in AXI

Hi,

  What is real time application of AXI exclusive access.

  Is it necessarily to do Exclusive read first then exclusive write.

  May i know the reason is it so?

  • To allow Exclusive instructions (LDREX/STREX/LDXR/STXR) on the processor to non-cached addresses.

    Exclusive accesses are used to implement synchronization primitives, such as mutexes and semaphores.  There are various resources with more detailed descriptions, but a quick summary:

    • Load Exclusive: Read location and "tag" it
    • Store Exclusive: Do this store if, and _only_ if, the location hasn't been written since last I read it using a Load Exclusive.  Returns whether succeeded or not.

    That way software can:

    • Read the location of the lock, to see if it's currently free.
    • If free, attempt to gain the lock by writing to the location.
    • Check if the write succeeded, or not (e.g. because something else got there first).

    Must such locks will be in cacheable memory, so the exclusivity checking can be handled within the processor or as part of cache coherency.  Meaning you wouldn't see any exclusives accesses on the bus.  But, if for example, you're synchronizing with a non-cached/non-cache coherent master (such as a system controller) then you need to the monitoring in the memory system.  And hence need the AXI exclusive accesses.

    For a more detailed description, try the Cortex-A Programmer's Guides.

    Developer Guides and Articles

  • Hi pkoti0583,

    AXI exclusive accesses are used whenever a master needs to do a read-modify-write sequence, during which time it must know if any other master attempted to write to the location it is modifying.

    Exclusive sequences must always start with an exclusive read, and then assuming the read returns a successful EXOKAY response the master can then complete the exclusive sequence with the exclusive write.

    They are always read-then-write sequences, hence the requirement the read happens first.

    Regards,

    JD