
5-4
MCF5249UM
MOTOROLA
Instruction Cache Operation
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 is shown in the following example code:
if miss address[3:2] = 00
fetch sequence = {$0, $4, $8, $C}
if miss address[3:2] = 01
fetch sequence = {$4, $8, $C, $0}
if miss address[3:2] = 10
fetch sequence = {$8, $C, $0, $4}
if miss address[3:2] = 11
fetch sequence = {$C, $0, $4, $8}
Once an external fetch has been initiated and the data loaded into the line-fill buffer, the instruction cache
maintains a special “most-recently-used” indicator that tracks the contents of the fill buffer versus its
corresponding cache location. At the time of the miss, the hardware indicator is set, marking the fill buffer
as “most recently used.” If a subsequent access occurs to the cache location defined by bits [8:4] 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 fill buffer data is still most recently used
compared to the memory array.
The fill buffer can also be used as temporary storage for line-sized bursts of non-cacheable references
under control of CACR[10]. With this bit set, a noncacheable instruction fetch is processed as defined by
Table 5-2. For this condition, the fill buffer is loaded and subsequent references can hit in the buffer, but
the data is never loaded into the memory array.
The following table shows the relationship between CACR bits 31 and 10 and the type of instruction fetch.
Table 5-1 Initial Fetch Offset vs. CLNF Bits
CLNF[1:0]
LONGWORD ADDRESS BITS
00
01
10
11
00
Line
Longword
01
Line
Longword
1X
Line
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.