Level 1 Memory System
ARM DDI 0500D
Copyright © 2013-2014 ARM. All rights reserved.
6-4
ID021414
Non-Confidential
6.2.5
Data cache coherency
The Cortex-A53 processor uses the MOESI protocol to maintain data coherency between
multiple cores.
MOESI describes the state that a shareable line in a L1 Data cache can be in:
M
Modified/
UniqueDirty
(UD). The line is in only this cache and is dirty.
O
Owned/
SharedDirty
(SD). The line is possibly in more than one cache and is
dirty.
E
Exclusive/
UniqueClean
(UC). The line is in only this cache and is clean.
S
Shared/
SharedClean
(SC). The line is possibly in more than one cache and is
clean.
I
Invalid/
Invalid
(I). The line is not in this cache.
The DCU stores the MOESI state of the cache line in the tag and dirty RAMs.
Note
Data coherency is enabled only when the CPUECTLR.SMPEN bit is set. You must set the
SMPEN bit before enabling the data cache. If you do not, then the cache is not coherent with
other cores and data corruption could occur.
Read allocate mode
The L1 Data cache supports only a Write-Back policy. It normally
allocates a cache line on either a read miss or a write miss, although you
can alter this by changing the inner cache allocation hints in the page
tables.
However, there are some situations where allocating on writes is not
wanted, such as executing the C standard library
memset()
function to clear
a large block of memory to a known value. Writing large blocks of data
like this can pollute the cache with unnecessary data. It can also waste
power and performance if a linefill must be performed only to discard the
linefill data because the entire line was subsequently written by the
memset()
.
To prevent this, the BIU includes logic to detect when a full cache line has
been written by the processor before the linefill has completed. If this
situation is detected on a threshold number of consecutive linefills, it
switches into read allocate mode.
When in read allocate mode, loads behave as normal and can still cause
linefills, and writes still lookup in the cache but, if they miss, they write
out to L2 rather than starting a linefill.
Note
More than the specified number of linefills might be observed on the ACE
or CHI master interface, before the BIU detects that three full cache lines
have been written and switches to read allocate mode.
The BIU continues in read allocate mode until it detects either a cacheable
write burst to L2 that is not a full cache line, or there is a load to the same
line as is currently being written to L2.
A secondary read allocate mode applies when the L2 cache is integrated.
After a threshold number of consecutive cache line sized writes to L2 are
detected, L2 read allocate mode is entered.