User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 72
UG585 (v1.11) September 27, 2016
Chapter 3: Application Processing Unit
See the Cache Policies of ARM architecture, for information on these attributes.
The Cortex-A9 CPU also provides independent cacheability attributes for normal memory for two
conceptual levels of cache, the inner and the outer cacheable. Inner refers to the innermost caches,
and always includes the lowest level of cache, that is, L1 cache. Outer cache refers to L2 cache. No
cache controlled by the inner cacheability attributes can lie outside a cache controlled by the outer
cacheability attributes.
Memory Barriers
A memory barrier is an instruction or sequence of instructions that forces synchronization events by
a processor with respect to retiring load/store instructions. Cortex-A9 CPU requires three explicit
memory barriers to support the memory order model. They are:
Data memory barrier
Data synchronization barrier
Instruction synchronization barrier
These barriers provide the functionality to order and complete load/store instructions. This also
helps in context synchronization.
Data Memory Barrier (DMB)
In a program, the use of the DMB instruction ensures that all of the instructions that access memory
should be completed/observed in the system before any memory access instructions that come up
after the DMB instruction. It does not affect the ordering of any other instructions executing on the
processor, or of instruction fetches.
Example: Weakly Ordered Message Passing Problem
Consider the following instructions executing on processor P1 and P2:
P1:
STR R5, [R1] ; set new data
STR R0, [R2] ; send flag indicating data ready
P2:
WAIT ([R2]==1) ; wait on flag
LDR R5, [R1] ; read new data
Here, the order of memory accesses seen by the other processor might not be the order that appears
in the program, for either loads or stores. The addition of barriers ensures that the observed order of
both the reads and the writes allow transfer of data correctly.
P1:
STR R5, [R1] ; set new data
DMB ; ensure that all observers see data before the flag
STR R0, [R2] ; send flag indicating data ready
P2:
WAIT ([R2]==1) ; wait on flag
DMB ; ensure that the load of data is after the flag has been observed
LDR R5, [R1]