Epson ARM720T Core Cpu Manual page 191

Revision 4 (amba ahb bus interface version)
Table of Contents

Advertisement

Example 11-1 shows sample code for performing software test of the cache. It contains typical
operations with register C15.C.
; CAM write, read and check for segment 2
; Write cache victim pointer with index 0, segment 2
MOV r0,#0
ORR r1,r0,#2 :SHL: 0x5
MCR p15,0,r1,c9,c1,0
; Write pattern in 0xFFFFFF9E in all 64 CAM lines
MVN r2,#1
BIC r2,r2,#0x20
MOV r8,#64
loop0
MCR p15,2,r2,c15,c7,6 ; write CAM, index auto-incremented
SUBS r8,r8,#1
BNE loop0
; Now read and check
; Reset victim pointer to index 0, segment 2
MOV r0,#0
ORR r1,r0,#2 :SHL:0x5
MCR p15,0,r1,c9,c1,0
MOV r8,#64
MOV r3,#0x40
BIC r2,r2,#0x60
loop1
MCR p15,3,r0,c15,c3,0
MCR p15,2,r3,c15,c7,2
MRC p15,3,r4,c15,c3,0
BIC r4,r4,#1
CMP r4,r2
BNE TEST_FAIL
SUBS r8,r8,#1
BNE loop1
B TEST_PASS
; RAM write, read and check for segment 1
; Write cache victim pointer with index 0, segment 1
MOV r0,#0
ORR r1,r0,#1 :SHL: 0x5
MCR p15,0,r1,c9,c1,0
; Write pattern 0x5A5A5A5A in RAM line (eight words)
LDR r0,=0x5A5A5A5A
MOV r8,#8
MOV r2,#0x10
MCR p15,3,r0,c15,c3,0
loop0
MCR p15,2,r2,c15,c11,6
ADD r2,r2,#0x04
SUBS r8,r8,#1
BNE loop0
ARM720T CORE CPU MANUAL
Example 11-1 Cache test operations
; bit 0 should be '0'
; write segment 2
; read segment 2
; clear bit 5 and 6 (always read as '0')
; write C15.C to '0'
; read CAM to C15.C
; read C15.C to R4
; clear LFSR bit
;write segment 1,word 0
; write RAM data in C15.C
; write RAM
; next word
EPSON
11: Test Support
11-7

Advertisement

Table of Contents
loading

Table of Contents