
7-22
G2 PowerPC Core Reference Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Memory Performance Considerations
7.5
Memory Performance Considerations
Due to the G2 core instruction throughput of three instructions per clock cycle, lack of data
bandwidth can become a performance bottleneck. For the G2 core to approach its potential
performance levels, it must be able to read and write data quickly and efficiently. If there
are many processors in a system environment, one processor may experience long memory
latencies while another bus master (for example, a direct-memory access controller) is
using the external bus.
To alleviate this possible contention, the G2 core provides three memory update
modes—copy-back, write-through, and cache-inhibit. Each page of memory is specified to
be in one of these modes. If a page is in copy-back mode, data being stored to that page is
written only to the on-chip cache. If a page is in write-through mode, writes to that page
update the on-chip cache on hits and always update main memory. If a page is
cache-inhibited, data in that page will never be stored in the on-chip cache. All three of
these modes of operation have advantages and disadvantages. A decision as to which mode
to use depends on the system environment as well as the application.
The following sections describe how performance is impacted by each memory update
mode. For details about the operation of the on-chip cache and the memory update modes,
see Chapter 4, “Instruction and Data Cache Operation.”
7.5.1
Copy-Back Mode
When data is stored in a location marked as copy back, store operations for cacheable data
do not necessarily cause an external bus cycle to update memory. Instead, memory updates
only occur on modified line replacements, cache flushes, or when another processor
attempts to access a specific address for which there is a corresponding modified cache
entry. For this reason, copy-back mode may be preferred when external bus bandwidth is a
potential bottleneck—for example, in a multiprocessor environment. Copy-back mode is
also well suited for data that is closely coupled to a processor, such as local variables.
If more than one device uses data stored in a page marked as copy back, snooping must be
enabled to allow copy-back operations and cache invalidations of modified data. The G2
core implements snooping hardware to prevent other devices from accessing invalid data.
When bus snooping is enabled, depending on the device integration, the processor can
monitor the transactions of the other devices. For example, if another device accesses a
memory location and its memory-coherent (M) bit is set and the G2 core on-chip cache has
a modified value for that address, the processor preempts the bus transaction and updates
memory with the cache data. If the cache contents associated with the snooped address are
unmodified, the G2 core invalidates the cache block. The other device can then attempt an
access to the updated address. See Chapter 4, “Instruction and Data Cache Operation.”
Copy-back mode provides complete cache/memory coherency as well as maximizing
available external bus bandwidth.
F
Freescale Semiconductor, Inc.
n
.