3-44
MPC7400 RISC Microprocessor Users Manual
Cache Control
The function of this instruction is independent of the WIMG bit settings of the block or PTE
containing the effective address. However, if the address is marked memory-coherency-
required, the execution of
dcbi
broadcasts an address-only kill transaction on the system
bus. Execution of a
dcbi
instruction does not affect data cache or L2 cache if they are
disabled.
A BAT or TLB protection violation for a
dcbi
translation generates a DSI exception.
3.5.3.8 Instruction Cache Block Invalidate (icbi)
The
icbi
instruction invalidates a matching entry in the instruction cache. During execution,
the effective address for the instruction is translated through the data MMU, and broadcasts
on the system bus using the memory-coherency attribute from translation. The MPC7400
always snoops global
icbi
transactions from the bus (even if it is the bus master that is
broadcasting) and sends it to the instruction cache for cache block address comparison and
invalidation. The MPC7400 snoops its own
icbi
broadcast regardless of the state of the
GBL signal. The
icbi
instruction invalidates a matching cache entry regardless of whether
the instruction cache is disabled or locked. The L2 cache is not affected by the
icbi
instruction.
An
icbi
instruction should always be followed by a
sync
and an
isync
instruction. This
ensures that the effects of the
icbi
are seen by the instruction fetches following the
icbi
itself. For self-modifying code, the following sequence should be used to synchronize the
instruction stream:
1.
dcbst
(push new code from data cache and L2 cache out to memory)
2.
sync
(wait for the
dcbst
to complete)
3.
icbi
(invalidate the old instruction cache entry in this processor and, by broadcasting
the
icbi
to the bus, invalidate the entry in all snooping processors)
4.
sync
(wait for the
icbi
to complete its bus operation)
5.
isync
(re-sync this processors instruction fetch)
The second
sync
instruction ensures completion of all prior
icbi
instructions. Note that the
second
sync
instruction is not shown in Section 5.1.5.2, òInstruction Cache Instructions,ó
in
The Programming Environments
Manual
. This
sync
is required on the MPC7400.
Since the
sync
instruction strongly serializes the MPC7400s memory subsystem,
performance of code containing several
icbi
instructions can be improved by batching the
icbi
instructions together such that only one
sync
instruction is used to synchronize all the
icbi
instructions in the batch.