![](http://datasheet.mmic.net.cn/230000/79RC32438-200BB_datasheet_15568909/79RC32438-200BB_144.png)
IDT MIPS32 4Kc Processor Core
Caches
79RC32438 User Reference Manual
2 - 82
November 4, 2002
Notes
Cacheability Attributes
The 4Kc processor core supports the following cacheability attributes:
–
Uncached: Addresses in a memory area indicated as uncached are not read from the cache.
Stores to such addresses are written directly to main memory, without changing cache contents.
–
Write-through: Loads and instruction fetches first search the cache, reading main memory only if
the desired data does not reside in the cache. On data store operations, the cache is first searched
to see if the target address is cache resident. If it is resident, the cache contents are updated, and
main memory is also written. If the cache lookup misses on a store, only main memory is written.
Hence, the allocation policy on a cache miss is read-allocate only.
Some segments of memory employ a fixed caching policy; for example the kseg1 is always uncache-
able. Other segments of memory allow the caching policy to be selected by software. Generally, the cache
policy for these programmable regions is defined by a cacheability attribute field associated with that region
of memory. For additional information, see the Memory Management section earlier in this chapter.
Replacement Policy
The replacement policy refers to how a way is chosen to hold an incoming cache line on a miss which
will result in a cache fill, when a cache is at least two-way set associative. In a direct mapped cache (one-
way set associative), the replacement policy is irrelevant since there is only one way available. The replace-
ment policy is least recently filled (LRF), first considering invalid ways and excluding any locked ways. On a
cache miss, the valid, lock and LRF bits for each tag entry of the selected line may be used to determine the
way which will be chosen. The number of tag entries which are looked at depends on the set associativity of
the cache.
First the valid bits are inspected. If an invalid way is available, as determined by all 4 of the valid bits in a
tag being zero, then that way will be selected. If more than one invalid way is available, then the first one
found starting from way0 will be selected.
If all ways are valid, then any locked ways will be excluded from consideration for replacement. If all
ways are locked, then no replacement can occur to that line. For the unlocked ways, the LRF bits from each
tag are used to identify the way which has been filled least recently, and that way is selected for replace-
ment. When the new tag is written during the line fill, its LRF bit is modified to indicate that way is no longer
the least recently filled.
Instruction Cache
The instruction cache is a memory block of 16 KBytes. The virtually indexed, physically tagged cache
allows the virtual-to-physical address translation to occur in parallel with the cache access rather than
having to wait for the physical address translation.
The 4Kc core supports instruction cache-locking. Cache locking allows critical code or data segments to
be locked into the cache on a “per-line” basis, enabling the system programmer to maximize the efficiency
of the system cache. The cache locking function is always enabled on all instruction cache entries. Entries
can then be marked as locked or unlocked on a per entry basis using the CACHE instruction.
Data Cache
The data cache is a memory block of 16 KBytes. The virtually indexed, physically tagged cache allows
the virtual-to-physical address translation to occur in parallel with the cache access rather than having to
wait for the physical address translation.
The core also supports a data cache locking mechanism identical to the instruction cache. Critical data
segments to be locked into the cache on a “per-line” basis. The locked contents can be updated on a store
hit, but cannot be selected for replacement on a miss.
The cache locking function is always enabled on all data cache entries. Entries can then be marked as
locked or unlocked on a per entry basis using the CACHE instruction.