Chapter 3. L1 and L2 Cache Operation
3-37
Cache Control
snoop hits are the only operations that can cause a tag state change in a locked data cache.
The setting of the DLOCK bit must be preceded by a
sync
instruction to prevent the data
cache from being locked during a data access.
The MPC7400 treats a load hit to a locked data cache the same as a load hit to an unlocked
data cache. That is, the data cache services the load with the requested data. However, a load
that misses in a locked data cache is passed to the reload buffer and propagated to the L2
cache or system bus as a caching-allowed, 32-byte burst read. But even though the reload
buffer is Tlled with an entire cache block, the data cache is not updated with the new data.
This allows for load miss folding for subsequent accesses to the cache block in the reload
buffer without updating the locked cache.
As with load hits, write-back store hits to a locked data cache are treated the same as
write-back store hits to an unlocked cache. Write-back store misses to a locked data cache
are treated as if they were marked write-through. Note that because write-back store misses
to a locked data cache are treated as write-through, store reordering may occur on the
system bus when the processor is in the MPX bus mode (MSSCR0[EMODE] = 0b1). This
can only occur if snoops are performed to the target address of the store when the address
is not contained in the data cache but is contained in the L2 cache. To prevent this
reordering, software must disable the exclusive and recent types of L2 cache HIT
intervention when the data cache is locked by setting MSSCR0[L2_INTVEN] = 0b
n
00.
The MPC7400 treats snoop hits to a locked data cache the same as snoop hits to an unlocked
data cache. However, any cache block invalidated by a snoop hit remains invalid until the
cache is unlocked.
3.5.1.3 Data Cache Flash Invalidation
The data cache ash invalidate bit, HID0[DCFI], is used to invalidate the entire data cache
in a single operation. Note that there is no broadcast of a Flash invalidate operation and any
modiTed data in the cache will be lost. Individual data cache blocks are invalidated using
the
dcbi
instruction. See Section 3.5.3.7, òData Cache Block Invalidate (dcbi),ó for more
information about the
dcbi
instruction.
DCFI is set through an
mtspr
operation. The MPC7400 automatically clears DCFI in the
clock cycle after it is set (provided that the data cache is enabled in the HID0 register). Note
that some PowerPC microprocessors accomplish data cache ash invalidation by setting
and clearing HID0[DCFI] with two consecutive
mtspr
instructions (that is, the bit is not
automatically cleared by the microprocessor). Software that has this sequence of operations
does not need to be changed to run on the MPC7400.
The data cache is automatically invalidated when the MPC7400 is powered up and during
a hard reset. However, a soft reset does not automatically invalidate the data cache.
Software must set HID0[DCFI] to invalidate the entire data cache after a soft reset.