![](http://datasheet.mmic.net.cn/110000/ML674001TC_datasheet_3507949/ML674001TC_129.png)
ML674001 Series/ML675001 Series User’s Manual
Chapter 9
CACHE MEMORY
9-10
9.5.3 Example of Lock Setting Procedure
An example of the procedure (example of locking in Way 0) for locking instruction codes (up to 2048
contiguous bytes) in the cache is explained below.
(1) Make cacheable setting for the bit in the cacheable register corresponding to the bank in which the
instruction codes to be locked are stored.
(2) Set F = “1” and BNK= “00” (Way 0) in the cache lock control register.
(3) Carry out a data read operation for the addresses in which the instruction codes are stored.
This causes
the instruction codes to be locked to be loaded in Way 0.
(Since the reading is done in units of 16 bytes, make sure that the total number of bytes is 2kB or less
including the data before and after the starting address and the ending address of the data read operation.
Example:
When the starting address of data read is 0
×4000_000C, the address for loading will be
0
×4000_0000.)
(4) After the data reading in (3) is completed, the target instruction codes are locked in Way 0 by setting F =
“0” and LCK = “01” in the cache lock control register.
An example is shown below of the procedure (example of locking in Way 0 and Way 1) of locking in the cache
the instruction codes (contiguous, 2049 bytes or more but less than or equal to 4096 bytes).
(1) Make cacheable setting for the bit in the cacheable register corresponding to the bank in which the
instruction codes to be locked are stored.
(2) Set F = “1” and BNK = “00” (Way 0) in the cache lock control register.
(3) Carry out a data read operation for the addresses corresponding to the first 2k bytes among the addresses
storing the instruction codes.
This causes the instruction codes to be locked to be loaded in Way 0.
(Since the reading is done in units of 16 bytes, make sure that the total number of bytes is 2k bytes or less
including the data before and after the starting address and the ending address of the data read operation.
Example:
When the starting address of data read is 0
×4000_000C, the address for loading will be
0
×4000_0000.)
(4) After the data reading in (3) is completed, set F = “1” and BNK = “01” (Way 1) in the cache lock control
register.
(5) Carry out a data read operation (the addresses corresponding to the remaining instruction codes) for the
addresses in which the instruction codes are stored.
This causes the instruction codes to be locked to be
loaded in Way 1.
(Since the reading is done in units of 16 bytes, make sure that the total number of bytes is 2k bytes or less
including the data before and after the starting address and the ending address of the data read operation.
Example:
When the starting address of data read is 0
×4000_080C, the address for loading will be
0
×4000_0800.)
(6) After the data reading in (5) is completed, the target instruction codes are locked in Way 0 and Way 1 by
setting F = “0” and LCK = “10” in the cache lock control register.
An example is shown below of the procedure (example of locking in Way 0, Way 1, and Way 2) of locking in
the cache the instruction codes (contiguous, 4097 bytes or more but less than or equal to 6144 bytes).
(1) Make cacheable setting for the bit in the cacheable register corresponding to the bank in which the
instruction codes to be locked are stored.
(2) Set F = “1” and BNK = “00” (Way 0) in the cache lock control register.
(3) Carry out a data read operation for the addresses corresponding to the first 2k bytes among the addresses
storing the instruction codes.
This causes the instruction codes to be locked to be loaded in Way 0.
(Since the reading is done in units of 16 bytes, make sure that the total number of bytes is 2k bytes or less
including the data before and after the starting address and the ending address of the data read operation.
Example:
When the starting address of data read is 0
×4000_000C, the address for loading will be
0
×4000_0000.)
(4) After the data reading in (3) is completed, set F = “1” and BNK = “01” (Way 1) in the cache lock control
register.
(5) Carry out a data read operation for the addresses corresponding to the next 2K bytes among the addresses
in which the instructions codes are stored.
This causes the instruction codes to be locked to be loaded in
Way 1.