
Caches and Write Buffer
ARM DDI 0144B
Copyright 1999, 2000 ARM Limited. All rights reserved.
4-5
4.2
ICache
The ARM940T has a 4KB ICache comprising four 64-way associative segments of 16
bytes per line per segment. The ICache uses the physical address generated by the
processor core. It uses a policy of
allocate on read-mis
s and is always reloaded one
cache line (four words) at a time, through the external interface.
The ICache is always disabled on reset.
4.2.1
Enabling and disabling the ICache
You can enable the ICache by setting bit 12 of the CP15 control register. You must only
enable the cache if you have already enabled the protection unit, or if you enable them
simultaneously. When the ICache is enabled, a cachable read-miss causes lines to be
placed in the ICache.
You can enable the ICache and protection unit simultaneously with a single write to the
CP15 control register, although you must have programmed at least one protection
region before you enable the protection unit. You can lock critical or
frequently-accessed instructions into the ICache with a granularity of 64 bytes.
Note
nstructions in this lockdown region are not replaced and remain in the ICache although
they are not immune to being flushed.
4.2.2
ICache operation
When enabled, the ICache operation is also controlled by the
Gated Cachable
instruction
(GCi) bit stored in the protection unit. This selectively enables or disables
caching for different memory regions. The GCi bit affects ICache operation as follows:
Successful cache read:
Data is returned to the core regardless of the state of the GCi bit.
Unsuccessful cache read:
If the GCi bit is 1, a cachable code area and protection unit are enabled, and a
linefetch of four words is performed. The data is written into a randomly chosen
line in the ICache. If the GCi bit is 0, a single-word external access is performed
to fetch the requested instruction. The cache is not updated.
Locked down code is always found on ICache searches. Lines containing locked down
code cannot be selected for replacement during a linefetch.