![](http://datasheet.mmic.net.cn/380000/-PD98501_datasheet_16745028/-PD98501_206.png)
CHAPTER 2 V
R
4120A
206
Preliminary User’s Manual S14767EJ1V0UM00
2.8.2.3 Accessing the caches
Figure 2-81 shows the virtual address (VA) index into the caches. The number of virtual address bits used to index
the instruction and data caches depends on the cache size.
(1) Data cache addressing
Using VA (12:4). The most-significant bit is VA12 because the cache size is 8 Kbytes.
The least-significant bit is VA4 because the line size is 4 words (16 bytes).
(2) Instruction cache addressing
Using VA (13:4). The most-significant bit is VA13 because the cache size is 16 Kbytes.
The least-significant bit is VA4 because the line size is 4 words (16 bytes).
Figure 2-81. Cache Data and Tag Organization
Tags
Tag line
VA (12:4)
for data cache (8 Kbytes)
VA (13:4)
for instruction cache (16 Kbytes)
V Tag W
P
Data
Data line
Data
64
2.8.3 Cache operations
As described earlier, caches provide temporary data storage, and they make the speedup of memory accesses
transparent to the user. In general, the CPU core accesses cache-resident instructions or data through the following
procedure:
1.
The CPU core, through the on-chip cache controller, attempts to access the next instruction or data in the
appropriate cache.
The cache controller checks to see if this instruction or data is present in the cache.
—
If the instruction/data is present, the CPU core retrieves it. This is called a cache hit.
—
If the instruction/data is not present in the cache, the cache controller must retrieve it from memory.
This is called a cache miss.
The CPU core retrieves the instruction/data from the cache and operation continues.
2.
3.