
ML674001 Series/ML675001 Series User’s Manual
Chapter 9
CACHE MEMORY
9-7
In general, in the cache memory, while there is the action of shortening the average access time of
instructions and data, it also has the nature of lengthening the access time in the worst case when considered
in the instantaneous behaviour.
This is because accesses occur that are not intended by the software, such as
the occurrence of a read access of one block when there is a cache read miss, or the occurrence of a write
access due to a write back operation when there is a cache write miss.
In the case of programs in which the timing is very critical, such as in some types of interrupt servicing, this
instantaneous increase in the access time can create problems.
The lock function is used to reduce the effect
of such problems.
The lock function puts a part of the cache memory in the locked state so that the instructions and data in that
part of the cache memory is retained.
Since such locked instructions and data will always result in a cache hit operation, it is possible to carry out
high speed access at all times.
While the cache memory is divided into four ways (storage locations), it is possible to lock the contents of
the cache memory in units of a way by setting the LCK bits.
Further, using the BNK[1:0] and F bits, it is
possible to load instructions or data to a locked way.
Caution:
The load operation is given priority when the target way of the load operation has been locked.
(Example:
When BNK = “00”, F = “1”, and LCK = “01”, the target way (Way 0) of the load operation will be
the same as the target way (Way 0) of the lock operation.)
Note that Way 3 cannot be locked.
9.3.5 Load Mode
The load mode is that of storing data in the specified way of the cache memory by accessing the data in the
main memory.
All instruction fetch accesses will be non-cacheable accesses.
On the other hand, the operations for all data accesses will be made in the normal manner according to the
setting of the cacheable register (cacheable or non-cacheable).
All storing to the cache memory is made forcibly to the way selected by BNK[1:0] by the setting of the F bit.
By setting the BNK[1:0] and F bits of the cache lock control register (CON), it is possible to load data into a
way that is to be locked.
The data so loaded can be handled as instructions or data.
9.3.6 Flushing Function
The flushing function initializes the control information within the cache memory.
The cache memory is
flushed by writing any data in the FLUSH register.
Since the cache memory is flushed by this flushing
operation, after this operation, there will be no instructions or data in the cache memory.
Since no write
back operation is made during flushing, the cache memory will be initialized without writing back the latest
instructions and data present in the cache memory into the actual memory.
Further, since the cache memory is not initialized (flushed) at the time this LSI is reset, be sure to flush the
cache memory by software after resetting the LSI.
(See “Examples of setting” Section.)