Rev. 1.50, 10/04, page 173 of 448
8.3.6
OC Two-Way Mode
When the OC2W bit in RAMCR is set to 1, OC two-way mode which only uses way 0 and way 1
in the OC is entered. Thus, power consumption can be reduced. In this mode, only way 0 and way
1 are used even if a memory-mapped OC access is made.
The OC2W bit should be modified by a program in the P2 area. At that time, if the valid line has
already been recorded in the OC, data should be written back by software, if necessary, 1 should
be written to the OCI bit in CCR, and all entries in the OC should be invalid before modifying the
OC2W bit.
8.4
Instruction Cache Operation
8.4.1 Read
Operation
When the IC is enabled (ICE = 1 in CCR) and instruction fetches are performed from a cacheable
area, the instruction cache operates as follows:
1. The tag, V bit, U bit and LRU bits on each way are read from the cache line indexed by virtual
address bits [12:5].
2. The tag, read from each way, is compared with bits [28:10] of the physical address resulting
from virtual address translation by the MMU:
•
If there is a way whose tag matches and the V bit is 1, see No. 3.
•
If there is no way whose tag matches and the V bit is 1, see No. 4.
3. Cache hit
The data indexed by virtual address bits [4:2] is read as an instruction from the data field on
the hit way. The LRU bits are updated to indicate the way is the latest one.
4. Cache miss
Data is read into the cache line on the way which selected using LRU bits to replace from the
physical address space corresponding to the virtual address. Data reading is performed, using
the wraparound method, in order from the quad-word data (8 bytes) including the cache-
missed data, and when the corresponding data arrives in the cache, the read data is returned to
the CPU as an instruction. While the remaining one cache line of data is being read, the CPU
can execute the next processing. When reading of one line of data is completed, the tag
corresponding to the physical address is recorded in the cache, and 1 is written to the V bit, the
LRU bits are updated to indicate the way is the latest one.
Summary of Contents for SuperH SH-4A
Page 2: ...Rev 1 50 10 04 page ii of xx ...
Page 8: ...Rev 1 50 10 04 page viii of xx ...
Page 116: ...Rev 1 50 10 04 page 96 of 448 ...
Page 178: ...Rev 1 50 10 04 page 158 of 448 ...
Page 206: ...Rev 1 50 10 04 page 186 of 448 ...
Page 231: ...Rev 1 50 10 04 page 211 of 448 Possible Exceptions Slot illegal instruction exception ...
Page 235: ...Rev 1 50 10 04 page 215 of 448 Possible Exceptions Slot illegal instruction exception ...
Page 238: ...Rev 1 50 10 04 page 218 of 448 Possible Exceptions Slot illegal instruction exception ...
Page 408: ...Rev 1 50 10 04 page 388 of 448 Possible Exceptions Inexact Not generated when FPSCR PR 1 ...
Page 446: ...Rev 1 50 10 04 page 426 of 448 ...
Page 468: ...Rev 1 50 10 04 page 448 of 448 ...
Page 471: ......
Page 472: ...SH 4A Software Manual ...