English
Language : 

MCF5282 Datasheet, PDF (107/766 Pages) Freescale Semiconductor, Inc – Microcontroller User’s Manual
Cache
4.3.5 Cache Miss Fetch Algorithm/Line Fills
As discussed in Section 4.1.2, “Introduction,” the cache hardware includes a 16-byte, line-fill buffer for
providing temporary storage for the last fetched line.
With the cache enabled as defined by CACR[CENB], a cacheable fetch that misses in the tag memory and
the line-fill buffer generates an external fetch. For data misses, the size of the external fetch is always 16
bytes. For instruction misses, the size of the external fetch is determined by the value contained in the 2-bit
CLNF field of the CACR and the miss address. Table 4-6 shows the relationship between the CLNF bits,
the miss address, and the size of the external fetch.
Table 4-6. Initial Fetch Offset vs. CLNF Bits
CLNF[1:0]
00
01
1X
Longword Address Bits[3:2]
00
01
10
11
Line
Line
Line
Longword
Line
Line
Longword Longword
Line
Line
Line
Line
Depending on the runtime characteristics of the application and the memory response speed, overall
performance may be increased by programming the CLNF bits to values 00 or 01.
For all cases of a line-sized fetch, the critical longword defined by bits [3:2] of the miss address is accessed
first followed by the remaining three longwords that are accessed by incrementing the longword address
in a modulo-16 fashion as shown below:
if miss address[3:2] = 00
fetch sequence = 0x0, 0x4, 0x8, 0xC
if miss address[3:2] = 01
fetch sequence = 0x4, 0x8, 0xC, 0x0
if miss address[3:2] = 10
fetch sequence = 0x8, 0xC, 0x0, 0x4
if miss address[3:2] = 11
fetch sequence = 0xC, 0x0, 0x4, 0x8
After an external fetch has been initiated and the data is loaded into the line-fill buffer, the cache maintains
a special most-recently-used indicator that tracks the contents of the associated line-fill buffer versus its
corresponding cache location. At the time of the miss, the hardware indicator is set, marking the line-fill
buffer as most recently used. If a subsequent access occurs to the cache location defined by bits [10:4] (or
bits [9:4] for split configurations of the fill buffer address), the data in the cache memory array is now most
recently used, so the hardware indicator is cleared. In all cases, the indicator defines whether the contents
of the line-fill buffer or the memory data array are most recently used. At the time of the next cache miss,
the contents of the line-fill buffer are written into the memory array if the entire line is present, and the
line-fill buffer data is most recently used compared to the memory array.
Generally, longword references are used for sequential instruction fetches. If the processor branches to an
odd word address, a word-sized instruction fetch is generated.
MCF5282 and MCF5216 ColdFire Microcontroller User’s Manual, Rev. 3
Freescale Semiconductor
4-9