L1 Caches
PowerPC e500 Core Family Reference Manual, Rev. 1
Freescale Semiconductor
11-25
11.6.2 L1 Cache Block Replacement
When a new block needs to be placed in the instruction or data cache, the
pseudo–least-recently-used (PLRU) replacement algorithm is used. Note that data cache
replacement selection is performed at reload time and not when the miss occurs. Instruction cache
replacement selection occurs when an instruction cache miss is first recognized.
When a cache line is accessed, it is tagged as the most-recently-used line of the set. When a miss
occurs, if all lines in the set are valid (occupied), the least-recently-used line is replaced with the
new data. The PLRU bits in the cache are updated each time a cache hit occurs based on the
most-recently-used cache line.
Modified data to be replaced is written into a DWB and eventually is written back to main memory.
Data load or write-back store accesses that miss in the L1 data cache function similarly to L1
instruction cache misses. They cause a new line to be allocated on a PLRU basis, provided the
cache is not completely locked or disabled.
Note that modified data in the replacement line of any cache can cause a castout to occur to the
CCB. In all such cases, the castout is not initiated until new data is ready to be loaded.
11.6.2.1 PLRU Replacement
Block replacement is performed using a binary decision tree, PLRU algorithm. There is an
identifying bit for each cache way, L[0–7]. There are seven PLRU bits, B[0–6] for each set in the
cache to determine the line to be cast out (replacement victim). The PLRU bits are updated when
a new line is allocated or replaced and when there is a hit in the set.
This algorithm prioritizes the replacement of invalid entries over valid ones (starting with way 0).
Otherwise, if all ways are valid, one is selected for replacement according to the PLRU bit
encodings shown in
Table 11-8
.
Table 11-8. L1 PLRU Replacement Way Selection
PLRU Bits
Way Selected for Replacement
B0
0
B1
0
B3
0
L0
0
0
1
L1
0
1
B4
0
L2
0
1
1
L3
1
B2
0
B5
0
L4
1
0
1
L5
1
1
B6
0
L6
1
1
1
L7
Содержание PowerPC e500 Core
Страница 1: ...PowerPC e500 Core Family Reference Manual Supports e500v1 e500v2 E500CORERM Rev 1 4 2005...
Страница 36: ...PowerPC e500 Core Family Reference Manual Rev 1 xxxvi Freescale Semiconductor...
Страница 38: ...PowerPC e500 Core Family Reference Manual Rev 1 Part I 2 Freescale Semiconductor...
Страница 316: ...PowerPC e500 Core Family Reference Manual Rev 1 7 18 Freescale Semiconductor Performance Monitor...
Страница 332: ...PowerPC e500 Core Family Reference Manual Rev 1 Part II 2 Freescale Semiconductor...
Страница 362: ...PowerPC e500 Core Family Reference Manual Rev 1 10 26 Freescale Semiconductor Auxiliary Processing Units APUs...
Страница 440: ...PowerPC e500 Core Family Reference Manual Rev 1 A 8 Freescale Semiconductor Programming Examples...
Страница 444: ...PowerPC e500 Core Family Reference Manual Rev 1 B 4 Freescale Semiconductor Guidelines for 32 Bit Book E...
Страница 530: ...Opcode Listings PowerPC e500 Core Family Reference Manual Rev 1 D 50 Freescale Semiconductor...
Страница 534: ...PowerPC e500 Core Family Reference Manual Rev 1 E 4 Freescale Semiconductor Revision History...