Caches
Copyright © ARM Limited 2000. All rights reserved.
3-11
The value of N is dependent on the cache size, as shown in Table 3-3.
The value of N is derived from the following equation:
Where the number of sets x the line length in bytes is 128.
It is usual to clean the cache before flushing it, so that external memory is updated with
any dirty data. The following code segment shows how you can clean and flush the
entire cache (assuming a 4Kbyte DCache).
MOV
r1, #0
; Initialize segment counter
outer_loop
MOV
r0, #0
; Initialize line counter
inner_loop
ORR
r2, r1, r0
; Generate segment and line address
MCR
p15, 0, r2, c7, c14, 2 ; Clean and flush the line
ADD
r0, r0, #0x20
; Increment to next line
CMP
r0, #0x400
; Complete all entries in one segment?
BNE
inner_loop
; If not branch back to inner_loop
ADD
r1, r1, #0x40000000
; Increment segment counter
CMP
r1, #0x0
; Complete all segments
BNE
outer_loop
; If not branch back to outer_loop
Table 3-3 Calculating index addresses
Cache size
Value of N
4KB
9
8KB
10
16KB
11
32KB
12
64KB
13
128KB
14
256KB
15
512KB
16
1MB
17
N
2
log
cache size
number of sets
line length in bytes
×
---------------------------------------------------------------------------------------
4
+
=
Summary of Contents for ARM946E-S
Page 1: ...ARM DDI 0155A ARM946E S Technical Reference Manual ...
Page 6: ...vi Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A 04 Limited Confidential ...
Page 54: ...Programmer s Model 2 34 Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A ...
Page 70: ...Caches 3 16 Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A ...
Page 78: ...Protection Unit 4 8 Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A ...
Page 112: ...Coprocessor Interface 7 14 Copyright ARM Limited 2000 All rights reserved ARM DDI 0155A ...