
MOTOROLA
Chapter 4. Instruction and Data Cache Operation
For More Information On This Product,
Go to: www.freescale.com
4-11
Memory Management/Cache Access Mode Bits—W, I, M, and G
flushing the pages that correspond to the changed bits from the caches of all processors in
the system is required, or when the address translations of aliased physical addresses
(referred to as real addresses in the architecture specification) specify different values for
any of the WIM bits). The G2 core considers any of these cases to be a programming error
that may compromise the coherency of memory. These paradoxes can occur within a single
processor or across several devices, as described in Section 4.7.4.1, “Coherency in
Single-Processor Systems.”
The WIMG attributes are programmed by the operating system for each page and block.
The W and I attributes control how the processor performing an access uses its own cache.
The M attribute ensures that coherency is maintained for all copies of the addressed
memory location. The G attribute prevents out-of-order loading and prefetching from the
addressed memory location.
When an access requires coherency, the processor performing the access must inform the
coherency mechanisms throughout the system that the access requires memory coherency.
The M attribute determines the kind of access performed on the bus (global or local).
The WIMG attributes occupy 4 bits in the BAT registers for block address translation and
in the PTEs for page address translation. The WIMG bits are programmed as follows:
The operating system uses the
mtspr
instruction to program the WIMG bits in the
BAT registers for block address translation. The IBAT register pairs do not have a
G bit and all accesses that use the IBAT register pairs are considered not guarded.
The operating system writes the WIMG bits for each page into the PTEs in system
memory as it sets up the page tables.
Note that for accesses performed with direct address translation (MSR[IR] = 0 or
MSR[DR] = 0 for instruction or data access, respectively), the WIMG bits are
automatically generated as 0b0011 (the data is write-back, caching is enabled, memory
coherency is enforced, and memory is guarded).
4.6.1
Write-Through Attribute (W)
When an access is designated as write-through (W = 1), if the data is in the cache, a store
operation updates the cached copy of the data. In addition, the update is written to the
external memory location (as described below).
While the PowerPC architecture permits multiple store instructions to be combined for
write-through accesses except when the store instructions are separated by a
sync
or
eieio
instruction, the G2 core does not implement this ‘combined store’ capability. Note that a
store operation that uses the write-through attribute may cause any part of valid data in the
cache to be written back to main memory.
F
Freescale Semiconductor, Inc.
n
.