Data Cache
10-10
MPC823 USER’S MANUAL
MOTOROLA
DATA
CACHE
10
V—Valid Cache Line
0 = Entry is not valid.
1 = Entry is valid.
Bits 27–31—Reserved
These bits are reserved and should be set to 0.
10.4 OPERATING THE DATA CACHE
The data cache is a three-state design. Two bits are included in each cache line to maintain
the line’s state information. The status bits keep track of whether or not the line is valid or if
it has been modified relative to memory. These modes are invalid, modified-valid, and
unmodified-valid.
10.4.1 Data Cache Read
There are two possible outcomes of a data cache read:
Read Hit—On a cache hit, the requested word is immediately transferred to the
load/store unit and the LRU state of the set is updated. No state transition occurs and
the access time is 1 clock (zero wait state).
Read Miss—A line in the cache is selected to hold the data that will be fetched from
memory. The selection algorithm gives first priority to invalid lines and if both lines are
invalid, the way zero line is selected first. If neither of the two candidate lines in the
selected set is invalid, then one of the lines is selected by the LRU algorithm for
replacement. If the selected line is valid-modified (dirty), then it is kept in a special buffer
to be written out (flushed) to memory or a later time.
Subsequently, the address of the missed entry is sent to the system interface unit with
a request to retrieve the cache line. The system interface unit arbitrates for the bus and
initiates a 4-word burst transfer read request. The transfer begins with the aligned word
containing the missed data, followed by the remaining word in the line, then by the word
at the beginning of the line (wraparound). As the missed word is received from the bus,
it is delivered (forwarded) directly to the load/store unit. When the line has been fully
received, it is written into the cache. The data cache supports further requests as long
as they hit in the cache immediately after the arrival of the critical word.
After the line with the requested data has been brought from memory, the dirty line kept
in the buffer is sent to the system interface unit to be written out (flushed) to memory. If
a bus error is detected during the fetch of the missed “critical word”, a machine check
interrupt is generated. If a bus error occurs on any other word in the line transfer, the
line is marked invalid. On the other hand, if no bus error is encountered, the cache line
is marked unmodified-valid. If a bus error is detected during the dirty line flush, a
machine check interrupt is generated (the dirty line ush error is an imprecise interrupt).
For more information about reading the address and data of a line, see