![](http://datasheet.mmic.net.cn/290000/XPC801ZP25_datasheet_16187868/XPC801ZP25_171.png)
Data Cache
10-8
MPC801 USER’S MANUAL
MOTOROLA
10
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. For more information about reading the address and data of a
line, see
Section 10.5.5 Reading the Data Cache Structures
.
10.4.2 Data Cache Write
The cache operates in either writethrough or copyback mode, depending on how the
memory management unit is programmed. If two logical blocks map to the same physical
block, it is considered a programming error for them to specify different cache write policies.
10.4.2.1 COPYBACK MODE
In copyback mode, write operations do not necessarily update the external memory. For this
reason, the copyback mode is the preferred mode of operation when it is important to keep
bus bandwidth usage and power consumption to a minimum. Data cache operation on a
write to copyback line is as follows:
Write Hit to Modified Line—Data is simply written into the cache with no state transition.
The LRU of the set is updated to point to the way holding the hit data.
Write Hit to Unmodified Line—Data is written into the cache and the line is marked
modified. The LRU of the set is updated to point to the way holding the hit data.
Write Miss—A line in the cache is selected to hold the data that is fetched from memory.
The selection algorithm gives first priority to invalid lines if both lines are invalid 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), it is kept in a special buffer to be written out
(flushed) to memory at 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 (the critical word first), 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 merged with the data to be written. When the line has been
fully received, it is written into the cache. Once the line fill is complete, the new store
data is written into the cache and the line is marked modified-valid (dirty). At this point,
if the machine stalls while waiting for the store to complete, execution is allowed to
resume. The data cache does not support further requests until after the whole line
arrives.
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.
The data cache can support further requests as long as they hit in the cache while
flushing the dirty line to memory. If a bus error is detected during a fetch of the missed
line the cache line is not modified and a machine check interrupt is generated. If a bus
error is detected during the dirty line flush, a machine check interrupt is generated. For
more information about reading the address and data of a line, see
Reading the Cache Structures
.
Section 10.3.3.3