Chapter 3. L1 and L2 Cache Operation
3-51
Cache Operations
be used to simplify software ushing of the data cache. See Section 3.6.9, òL1 Cache
Invalidation and Flushing,ó for more information. HID0[DCFA] does not affect instruction
cache replacement selection. If any of the valid bits (L[0D7]) for a given set in the
instruction cache are invalid, the Trst invalid entry (from L0 to L7) is always chosen as the
replacement way.
During power-up or hard reset, all the valid bits of the ways are cleared and the PLRU bits
are cleared to point to way L0 of each set. Note that this is also the state of the data or
instruction cache after setting their respective ash invalidate bits (HID0[DCFI] or
HID0[ICFI]).
Each time a cache block is accessed, it is tagged as the most recently used way of the set
(unless accessed by the AltiVec LRU instructions; refer to Section 7.1.2.1, òLRU
Instructionsó). For every hit in the cache or when a new block is reloaded, the PLRU bits
for the set are updated using the rules speciTed in Table 3-9.
Note that only three PLRU bits are updated for any given access.
3.6.8.1 AltiVec LRU Instruction Support
The data cache fully supports the AltiVec LRU instructions (
lvxl
,
stvxl
). If one of these
instructions causes a hit in the data cache, then the PLRU bits are updated such that the way
which hit is marked as least-recently-used by using the PLRU update rules shown in
Table 3-10. If no other hit to the cache index occurs, this way is victimized upon the next
data cache reload. Similarly, if an
lvxl
or
stvxl
instruction misses in the cache, the PLRU
bits are updated as shown in Table 3-10 when that cache block reloads the data cache. Note
that the instruction cache is not subject to any AltiVec LRU accesses.
Table 3-9. PLRU Bit Update Rules
If the
current
access is
to:
Then the PLRU bits in the set are changed to:
B0
B1
B2
B3
B4
B5
B6
L0
1
1
x
1
x
x
x
L1
1
1
x
0
x
x
x
L2
1
0
x
x
1
x
x
L3
1
0
x
x
0
x
x
L4
0
x
1
x
x
1
x
L5
0
x
1
x
x
0
x
L6
0
x
0
x
x
x
1
L7
0
x
0
x
x
x
0
x = Does not change