
MOTOROLA
Chapter 4. Instruction and Data Cache Operation
For More Information On This Product,
Go to: www.freescale.com
4-23
Cache Control Instructions
to memory are visible to the instruction fetching mechanism. Although the instructions to
enforce coherency vary among implementations and, hence, operating systems should
provide a system service for this function, the following sequence is typical:
1.
dcbst
(update memory)
2.
sync
(wait for update)
3.
icbi
(invalidate copy in cache)
4.
isync
(invalidate copy in own instruction buffer)
These operations are necessary because the processor does not maintain instruction
memory coherent with data memory. Software is responsible for enforcing coherency of
instruction caches and data memory. Since instruction fetching may bypass the data cache,
changes made to items in the data cache may not be reflected in memory until after the
instruction fetch completes.
The PowerPC architecture defines instructions for controlling both the instruction and data
caches when they exist. The G2 core interprets the cache control instructions (
icbi
,
dcbi
,
dcbt
,
dcbz
, and
dcbst
) as if they pertain only to the G2 core caches. They are not intended
for use in managing other caches in the system.
The
dcbz
instruction causes an address-only broadcast on the bus if the contents of the
block are from a page marked global through the WIMG bits. This broadcast is performed
for coherency reasons; the
dcbz
instruction is the only cache control instruction that can
allocate and take new ownership of a line. Note that if the HID0[ABE] bit is set on a G2
core processor, the execution of the
dcbf
,
dcbi
, and
dcbst
instructions will also cause an
address-only broadcast. The
dcbz
instruction is also the only cache operation that is
snooped by the G2 core. The cache instructions are intended primarily for the management
of the on-chip cache, and do not perform address-only broadcasts for the maintenance of
other caches in the system. The ability of the G2 core to optionally perform address-only
broadcasts when executing the
dcbi
,
dcbf
, and the
dcbst
instructions allows the coherency
management of an external copy-back L2 cache. Note that the
dcbi
instruction should never
be used on the G2 core.
The other instructions do not broadcast either for the purpose of invalidating or flushing
other caches in the system or for managing system resources. Any bus activity caused by
these instructions is the direct result of performing the operation in the G2 core cache. Note
that a data access exception is generated if the effective address of a
dcbi
,
dcbst
,
dcbf
, or
dcbz
instruction cannot be translated due to the lack of a TLB entry. (Note that exceptions
are referred to as interrupts in the architecture specification.)
Note that in the PowerPC architecture, the term ‘cache block’ or ‘block,’ when used in the
context of cache implementations, refers to the unit of memory at which coherency is
maintained. For the G2 core, this is the eight-word cache line. This value may be different
for other implementations that support the PowerPC architecture. In-depth descriptions of
F
Freescale Semiconductor, Inc.
n
.