OpenCores
URL https://opencores.org/ocsvn/amber/amber/trunk

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [tests/] [cache2.S] - Blame information for rev 49

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 csantifort
/*****************************************************************
2
//                                                              //
3
//  Amber 2 Core Cache Test                                     //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9 35 csantifort
//  Tests simple interaction between cached data and uncached   //
10 2 csantifort
//  instruction accesses.                                       //
11
//                                                              //
12
//  Author(s):                                                  //
13
//      - Conor Santifort, csantifort.amber@gmail.com           //
14
//                                                              //
15
//////////////////////////////////////////////////////////////////
16
//                                                              //
17
// Copyright (C) 2010 Authors and OPENCORES.ORG                 //
18
//                                                              //
19
// This source file may be used and distributed without         //
20
// restriction provided that this copyright statement is not    //
21
// removed from the file and that any derivative work contains  //
22
// the original copyright notice and the associated disclaimer. //
23
//                                                              //
24
// This source file is free software; you can redistribute it   //
25
// and/or modify it under the terms of the GNU Lesser General   //
26
// Public License as published by the Free Software Foundation; //
27
// either version 2.1 of the License, or (at your option) any   //
28
// later version.                                               //
29
//                                                              //
30
// This source is distributed in the hope that it will be       //
31
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
32
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
33
// PURPOSE.  See the GNU Lesser General Public License for more //
34
// details.                                                     //
35
//                                                              //
36
// You should have received a copy of the GNU Lesser General    //
37
// Public License along with this source; if not, download it   //
38
// from http://www.opencores.org/lgpl.shtml                     //
39
//                                                              //
40
*****************************************************************/
41
 
42
#include "amber_registers.h"
43
 
44
        .section .text
45
        .globl  main
46
main:
47
        @ ---------------------
48
        @ Enable the cache
49
        @ ---------------------
50
        mov     r0,  #0xffffffff
51 15 csantifort
        mcr     15, 0, r0, cr3, cr0, 0   @ cacheable area
52 2 csantifort
        mov     r0,  #1
53 15 csantifort
        mcr     15, 0, r0, cr2, cr0, 0   @ cache enable
54 2 csantifort
        nop
55
        nop
56
 
57
        mov     r1, #27
58
        ldr     r2, AdrData
59
        nop
60
        nop
61
        nop
62
        str     r1, [r2]
63
 
64
        nop
65
        nop
66
        nop
67
 
68
        ldr     r3, [r2]
69
        cmp     r1, r3
70
 
71
        movne   r10, #10
72
        bne     testfail
73
 
74
        b       testpass
75
@ ------------------------------------------
76
@ ------------------------------------------
77
 
78
testfail:
79
        ldr     r11, AdrTestStatus
80
        str     r10, [r11]
81
        b       testfail
82
 
83
testpass:
84
        ldr     r11, AdrTestStatus
85
        mov     r10, #17
86
        str     r10, [r11]
87
        b       testpass
88
 
89
 
90
 
91
/* Write 17 to this address to generate a Test Passed message */
92
AdrTestStatus:              .word ADR_AMBER_TEST_STATUS
93
Result:                     .word 3300
94
AdrData:                    .word Data
95
Data:                       .word 0
96
 
97
 
98
 
99
/* ========================================================================= */
100
/* ========================================================================= */
101
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.