Epson ARM.POWERED ARM720T User Manual

Page 197

Advertising
background image

11: Test Support

ARM720T CORE CPU MANUAL

EPSON

11-13

Example 11-2 shows sample code for performing software test of the MMU. It contains typical

operations with C15.M.

Example 11-2 MMU test operations

; MMU write, read and check for CAM, RAM1 and RAM2

; Load victim pointer with 0

MOV r0,#0
MCR p15,0,r0,c10,c0,0

; Write pattern 0x5A5A5A50 in CAM
; Write pattern 0x0025A5A5 in RAM1
; Write pattern 0xF0F0F0C0 in RAM2

LDR r2,=0x5A5A5A50
LDR r3,=0x0025A5A5
LDR r4,=0xF0F0F0C0
MOV r5,#64

; Write all 64 lines
loop0

MCR p15,4,r2,c15,c7,0

; write CAM

MCR p15,4,r3,c15,c11,0

; write RAM1

MCR p15,4,r4,c15,c3,1

; write RAM2, pointer auto-incremented here

SUBS r5,r5,#1
BNE loop0

; Now read and check
; Reset victim pointer

MOV r0,#0
MCR p15,0,r0,c10,c0,0
MOV r8,#64

loop1

MCR p15,4,r5,c15,c7,4

; read CAM to C15.M

MRC p15,4,r5,c15,c3,6

; read C15.M to R5

MCR p15,4,r6,c15,c11,4
MRC p15,4,r6,c15,c3,6

; read RAM1 to R6

BIC r5,r5,#0x01c00000

; mask fault/miss bits

MCR p15,4,r7,c15,c3,5
MRC p15,4,r7,c15,c3,6

; read RAM2 to R7

CMP r5,r2
CMPEQ r6,r3
CMPEQ r7,r4
BNE TEST_FAIL

SUBS r8,r8,#1
BNE loop1
B TEST_PASS

Advertising