Barrier Transactions in ACE

Can somebody please explain how barrier transactions in ACE work?

Thanks in advance.

Parents
  • Can you please tell me the difference between memory barrier and synchronization barrier?

    The key difference between a memory barrier and a synchronisation barrier is what exact guarantee is given relative to the other instructions.

    A memory barrier guarantees that transactions after the barrier can observe transactions before the barrier.

    A synchronisation barrier guarantees that when the barrier completes, then all the transactions before the barrier will be visible.

    This is similar to the difference between a DMB and DSB within the Arm Architecture.  A DMB ensures accesses before the DMB are ordered ahead of accesses after the DMB.  A DSB ensures memory accesses before the DSB have completed before the DSB completes.  So with an example:

    STR

    DMB

    Send Interrupt

    In this case, the memory barrier is not adequate to ensure that the store is visible before the interrupt is sent as it doesn't require that STR has completed before the interrupt is sent.  A synchronisation barrier instead of the memory would ensure this, as it wouldn't complete until after the store has completed.

    However, if we only needed order between transactions, then a memory barrier would be appropriate.

    Are memory barriers expected to order transaction to memory such as L2 Cache or DMC only  and not transactions to peripherals?

    No, they would order both.  

    [AXI4 - C8.1 Page C8-248] " A synchronization barrier is issued by a master to guarantee that all transactions issued before the barrier are observable by every master in the appropriate domain when the barrier completes." Since barriers from one master are not fed to other masters, how can this be done?

    This would be the responsibility of the interconnect.  It would need to ensure that the transactions have propagated through to a point in the system where it would be guaranteed that if another master made an access to the same location, then the master would observe this transaction.  Only then can the interconnect return a completion response to the barrier.

Reply
  • Can you please tell me the difference between memory barrier and synchronization barrier?

    The key difference between a memory barrier and a synchronisation barrier is what exact guarantee is given relative to the other instructions.

    A memory barrier guarantees that transactions after the barrier can observe transactions before the barrier.

    A synchronisation barrier guarantees that when the barrier completes, then all the transactions before the barrier will be visible.

    This is similar to the difference between a DMB and DSB within the Arm Architecture.  A DMB ensures accesses before the DMB are ordered ahead of accesses after the DMB.  A DSB ensures memory accesses before the DSB have completed before the DSB completes.  So with an example:

    STR

    DMB

    Send Interrupt

    In this case, the memory barrier is not adequate to ensure that the store is visible before the interrupt is sent as it doesn't require that STR has completed before the interrupt is sent.  A synchronisation barrier instead of the memory would ensure this, as it wouldn't complete until after the store has completed.

    However, if we only needed order between transactions, then a memory barrier would be appropriate.

    Are memory barriers expected to order transaction to memory such as L2 Cache or DMC only  and not transactions to peripherals?

    No, they would order both.  

    [AXI4 - C8.1 Page C8-248] " A synchronization barrier is issued by a master to guarantee that all transactions issued before the barrier are observable by every master in the appropriate domain when the barrier completes." Since barriers from one master are not fed to other masters, how can this be done?

    This would be the responsibility of the interconnect.  It would need to ensure that the transactions have propagated through to a point in the system where it would be guaranteed that if another master made an access to the same location, then the master would observe this transaction.  Only then can the interconnect return a completion response to the barrier.

Children