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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [tests/] [stm_stream.S] - Blame information for rev 87

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

Line No. Rev Author Line
1 15 csantifort
/*****************************************************************
2
//                                                              //
3
//  Amber 2 Core Instruction Test                               //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
//  Generates as dense a stream of writes as possible to check  //
10
//  that the memory subsystem can cope with this worst case.    //
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 36 csantifort
#include "amber_macros.h"
44 15 csantifort
 
45
        .section .text
46
        .globl  main
47
main:
48
        @ ---------------------
49
        @ Enable the cache
50
        @ ---------------------
51
        @ The instruction space is cached and the data space is not.
52
        @ So when the written data is read back, it comes from
53
        @ main memory and not the dcache.
54
        mov     r0,  #0x1
55
        mcr     15, 0, r0, cr3, cr0, 0   @ cacheable area
56
        mov     r0,  #1
57
        mcr     15, 0, r0, cr2, cr0, 0   @ cache enable
58
 
59
        mov     r14, #3
60
 
61
loop:   mov     r0, #0x1000000
62
        add     r1, r14, #0x1
63
        add     r2, r14, #0x2
64
        add     r3, r14, #0x3
65
        add     r4, r14, #0x4
66
        add     r5, r14, #0x5
67
        add     r6, r14, #0x6
68
        add     r7, r14, #0x7
69
        add     r8, r14, #0x8
70
 
71
        @ ---------------------
72
        @ write 1024 bytes
73
        stm     r0!, {r1-r8}
74
        stm     r0!, {r1-r8}
75
        stm     r0!, {r1-r8}
76
        stm     r0!, {r1-r8}
77
        stm     r0!, {r1-r8}
78
        stm     r0!, {r1-r8}
79
        stm     r0!, {r1-r8}
80
        stm     r0!, {r1-r8}
81
        stm     r0!, {r1-r8}
82
        stm     r0!, {r1-r8}
83
        stm     r0!, {r1-r8}
84
        stm     r0!, {r1-r8}
85
        stm     r0!, {r1-r8}
86
        stm     r0!, {r1-r8}
87
        stm     r0!, {r1-r8}
88
        stm     r0!, {r1-r8}
89
        stm     r0!, {r1-r8}
90
        stm     r0!, {r1-r8}
91
        stm     r0!, {r1-r8}
92
        stm     r0!, {r1-r8}
93
        stm     r0!, {r1-r8}
94
        stm     r0!, {r1-r8}
95
        stm     r0!, {r1-r8}
96
        stm     r0!, {r1-r8}
97
        stm     r0!, {r1-r8}
98
        stm     r0!, {r1-r8}
99
        stm     r0!, {r1-r8}
100
        stm     r0!, {r1-r8}
101
        stm     r0!, {r1-r8}
102
        stm     r0!, {r1-r8}
103
        stm     r0!, {r1-r8}
104
        stm     r0!, {r1-r8}
105
 
106
        @ Read back and check
107
        mov     r0, #0x1000000
108
        mov     r13, #320
109
1:      mov     r9, r14
110
2:      add     r9, r9, #1
111
        ldr     r12, [r0], #4
112 36 csantifort
        compare r12, r9, __LINE__
113 15 csantifort
        add     r10, r14, #8
114
        cmp     r9, r10
115
        bne     2b
116
 
117
        subs    r13, r13, #10
118
        bne     1b
119
 
120
        subs    r14, r14, #1
121
        bne     loop
122
 
123
        b       testpass
124
 
125
testfail:
126
        ldr     r11, AdrTestStatus
127
        str     r10, [r11]
128
        b       testfail
129
 
130
testpass:
131
        ldr     r11, AdrTestStatus
132
        mov     r10, #17
133
        str     r10, [r11]
134
        b       testpass
135
 
136
 
137
/* Write 17 to this address to generate a Test Passed message */
138
AdrTestStatus:  .word  ADR_AMBER_TEST_STATUS
139
Data1:          .word  Data2
140
Data2:          .word  0xff
141
 
142
/* ========================================================================= */
143
/* ========================================================================= */
144
 

powered by: WebSVN 2.1.0

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