Caches and Write Buffer
ARM DDI 0144B
Copyright 1999, 2000 ARM Limited. All rights reserved.
4-3
Each cache comprises four fully-associative 1KB segments that support single-cycle
reads, and either one or two-cycle writes depending on the sequentiality of the access.
Each cache segment consists of 64
Content Addressable Memory
(CAM) rows that each
select one of 64 RAM four-word long lines. During a cache access, a segment is
selected and the access address is compared with the 64 TAGs in the CAM. If a match
occurs (or a
hit
), the matched line is enabled and the data can be accessed. If none of the
TAGs match (a
miss
), then external memory must be accessed, unless the access is a
buffered write, when the write buffer is used.
If a read access from a cachable memory region misses, new data is loaded into one of
the 64 row lines of the selected segment. This is an
allocate on read-miss
replacement
policy. Selection is performed by a randomly clocked target row counter.
Critical or frequently-accessed instructions or data can be locked into the cache by
restricting the range of the target counter. Locked lines cannot be replaced and remain
in the cache until they are unlocked or flushed.
The CAM allows 64 address TAGs to be stored for an address that selects a given
segment (64-way associativity). This reduces the chance of an address sequence in, for
example, a program loop that constantly selects the same segment, from replacing data
that is required again in a later iteration of the loop. The overhead for high associativity
is the requirement to store a larger TAG. In the case of the ARM940T, this is 26 bits per
line.
Figure 4-2 on page 4-3 shows how the 4KB ICache and 4KB DCache are addressed.
Figure 4-2 ARM940T Instruction/data cache addressing
The address bits are assigned as follows:
Bits 31:6
Select an address tag in CAM.
Bits 5:4
Selects one of the four cache segments.
Bits 3:2
Selects a word in the cache line.
31
6 5 4 3 2 1 0
Address TAG in CAM
Seg Word SBZ