Cache
6-10
Freescale Semiconductor
Figure 6-6. Data-Caching Operation
The following steps determine if a data-cache line for a given address is allocated:
1. The cache set index, A[11:4], selects one cache set.
2. A[31:12] and the cache set index are used as a tag reference or to update the cache line tag field.
A[31:12] can specify 20 possible address lines that can be mapped to one of the four ways.
3. The four tags from the selected cache set are compared with the tag reference. A cache hit occurs
if a tag matches the tag reference and the V bit is set, indicating that the cache line contains valid
data. If a cacheable write access hits in a valid cache line, the write can occur to the cache line
without loading it from memory.
If the memory space is copyback, the updated cache line is marked modified (M = 1), because the
new data made the data in memory stale. If the memory location is write-through, the write is
passed to system memory and the M bit is not used. The tag does not have TT or TM bits.
To allocate a cache entry, the cache set index selects one of the cache’s 256 sets. The cache control logic
looks for an invalid cache line to use for the new entry. If none are available, the cache controller uses a
pseudo-round-robin replacement algorithm to choose the line to be deallocated and replaced. First, the
cache controller looks for an invalid line, with way 0 the highest priority. If all lines have valid data, a 2-bit
replacement counter chooses the way. After a line is allocated, the pointer increments to point to the next
way.
Cache lines from ways 0 and 1 can be protected from deallocation by enabling half-cache locking. If
CACR[DHLCK,IHLCK] are set, the replacement pointer is restricted to way 2 or 3.
0
3
4
31
Index
Tag Data/Tag Reference
MUX
Comparator
0
1
2
3
Logical OR
Hit 3
Hit 2
Hit 1
Hit 0
Hit
Line Select
Set 0
Set 1
•
•
•
Address
A[31:12]
Way 0
Way 1
Way 2
Way 3
TAG
STATUS LW0 LW1 LW2 LW3
TAG
STATUS LW0 LW1 LW2 LW3
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Address
Set Select
A[11:4]
Data
Set 255
12 11
Summary of Contents for MCF54455
Page 33: ...xxviii Freescale Semiconductor ...
Page 67: ...Freescale Semiconductor 1 ...
Page 125: ...Freescale Semiconductor 1 ...
Page 145: ...Enhanced Multiply Accumulate Unit EMAC 5 21 Freescale Semiconductor ...
Page 173: ...Cache 6 28 Freescale Semiconductor ...
Page 179: ...Static RAM SRAM 7 6 Freescale Semiconductor ...
Page 207: ...Power Management 9 16 Freescale Semiconductor ...
Page 323: ...Reset Controller Module 13 8 Freescale Semiconductor ...
Page 389: ...Pin Multiplexing and Control 16 44 Freescale Semiconductor ...
Page 575: ...PCI Bus Controller 22 58 Freescale Semiconductor ...
Page 600: ...Advanced Technology Attachment ATA Freescale Semiconductor 23 25 ...
Page 601: ...Freescale Semiconductor 1 ...
Page 842: ...I2 C Interface Freescale Semiconductor 33 16 ...
Page 843: ...Freescale Semiconductor 1 ...
Page 921: ...Revision History A 6 Freescale Semiconductor ...