
4-16
G2 PowerPC Core Reference Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Cache Coherency—MEI Protocol
The G2 core cache coherency protocol is a coherent subset of the standard MESI four-state
cache protocol that omits the shared state. Since data cannot be shared, the G2 core signals
all cache block fills as if they were write misses (read-with-intent-to-modify), flushing the
corresponding copies of the data in all caches external to the G2 core prior to the G2 core
cache block fill operation. Following the cache block load, the G2 core is the exclusive
owner of the data and may write to it without a bus broadcast transaction.
To maintain this coherency, all global reads observed on the bus by the G2 core are snooped
as if they are writes, causing the G2 core to write a modified cache block back to memory
and invalidate the cache block, or simply invalidate the cache block if it is unmodified. The
exception to this rule occurs when a snooped transaction is a caching-inhibited read (either
burst or single-beat, where core_tt[0:4] = 0x1010; see Table 8-6 for clarification), in which
case the G2 core does not invalidate the snooped cache block. If the cache block is
modified, the block is written back to memory, and the cache block is marked exclusive
unmodified. If the cache block is marked exclusive unmodified when snooped, no bus
action is taken, and the cache block remains in the exclusive unmodified state. This
treatment of caching-inhibited reads decreases the possibility of data thrashing by allowing
noncaching devices to read data without invalidating the entry from the G2 core data cache.
4.7.1
MEI State Definitions
The G2 core data cache characterizes each 32-byte block it contains as being in one of three
MEI states. Addresses presented to the cache are indexed into the cache directory with bits
A20:A26, and the upper-order 20 bits from the physical address translation (PA0–PA19) are
compared against the indexed cache directory tags. If neither of the indexed tags matches,
the result is a cache miss. If a tag matches, a cache hit occurred and the directory indicates
the state of the cache block through two state bits kept with the tag. The three possible states
for a cache block in the cache are the modified state (M), the exclusive state (E), and the
invalid state (I). The three MEI states are defined in Table 4-2.
4.7.2
MEI State Diagram
The G2 core provides dedicated hardware to provide memory coherency by snooping bus
transactions. The address retry capability of the G2 core enforces the MEI protocol, as
shown in Figure 4-4. Figure 4-4 assumes that the WIM bits for the page or block are set to
001; that is, write-back, caching-not-inhibited, and memory coherency enforced.
Table 4-2. MEI State Definitions
MEI State
Definition
Modified (M)
The addressed cache block is valid only in the cache. The cache block is modified with respect to
system memory—that is, the modified data in the cache block has not been written back to memory.
Exclusive (E)
The addressed block is in this cache only. The data in this cache block is consistent with system
memory.
Invalid (I)
This state indicates that the addressed cache block is not resident in the cache.
F
Freescale Semiconductor, Inc.
n
.