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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [hwtests/] [memtest1/] [memtest1.s] - Blame information for rev 239

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

Line No. Rev Author Line
1 14 hellwig
;
2
; memtest1.s -- memory test
3
;
4
 
5
; $2 temporary
6
; $3 tbl address
7
; $4 mem address
8
; $7 character to output
9
; $8 I/O base
10
; $10 reference value
11
 
12
        .set    mem_base,0xC0000000
13
        .set    io_base,0xF0300000
14
 
15
        ;
16
        ; write memory (words)
17
        ;
18
wwrite:
19
        add     $4,$0,mem_base
20
        add     $3,$0,tbl
21
        ldw     $2,$3,0
22
        stw     $2,$4,0
23
        add     $7,$0,'.'
24
        jal     out
25
        ldw     $2,$3,4
26
        stw     $2,$4,4
27
        add     $7,$0,'.'
28
        jal     out
29
        ldw     $2,$3,8
30
        stw     $2,$4,8
31
        add     $7,$0,'.'
32
        jal     out
33
        ldw     $2,$3,12
34
        stw     $2,$4,12
35
        add     $7,$0,'.'
36
        jal     out
37
        add     $7,$0,0x0D
38
        jal     out
39
        add     $7,$0,0x0A
40
        jal     out
41
        ;
42
        ; read memory (words)
43
        ;
44
wread0:
45
        ldw     $10,$3,0
46
        ldw     $2,$4,0
47
        bne     $10,$2,wread0n
48
        add     $7,$0,'.'
49
        jal     out
50
        j       wread1
51
wread0n:
52
        add     $7,$0,'?'
53
        jal     out
54
wread1:
55
        ldw     $10,$3,4
56
        ldw     $2,$4,4
57
        bne     $10,$2,wread1n
58
        add     $7,$0,'.'
59
        jal     out
60
        j       wread2
61
wread1n:
62
        add     $7,$0,'?'
63
        jal     out
64
wread2:
65
        ldw     $10,$3,8
66
        ldw     $2,$4,8
67
        bne     $10,$2,wread2n
68
        add     $7,$0,'.'
69
        jal     out
70
        j       wread3
71
wread2n:
72
        add     $7,$0,'?'
73
        jal     out
74
wread3:
75
        ldw     $10,$3,12
76
        ldw     $2,$4,12
77
        bne     $10,$2,wread3n
78
        add     $7,$0,'.'
79
        jal     out
80
        j       wread4
81
wread3n:
82
        add     $7,$0,'?'
83
        jal     out
84
wread4:
85
        add     $7,$0,0x0D
86
        jal     out
87
        add     $7,$0,0x0A
88
        jal     out
89
        add     $7,$0,0x0D
90
        jal     out
91
        add     $7,$0,0x0A
92
        jal     out
93
        ;
94
        ; write memory (halfwords)
95
        ;
96
hwrite:
97
        add     $4,$0,mem_base
98
        add     $3,$0,tbl
99
        ldhu    $2,$3,16
100
        sth     $2,$4,16
101
        add     $7,$0,'.'
102
        jal     out
103
        ldhu    $2,$3,18
104
        sth     $2,$4,18
105
        add     $7,$0,'.'
106
        jal     out
107
        ldhu    $2,$3,20
108
        sth     $2,$4,20
109
        add     $7,$0,'.'
110
        jal     out
111
        ldhu    $2,$3,22
112
        sth     $2,$4,22
113
        add     $7,$0,'.'
114
        jal     out
115
        add     $7,$0,0x0D
116
        jal     out
117
        add     $7,$0,0x0A
118
        jal     out
119
        ;
120
        ; read memory (halfwords)
121
        ;
122
hread0:
123
        ldhu    $10,$3,16
124
        ldhu    $2,$4,16
125
        bne     $10,$2,hread0n
126
        add     $7,$0,'.'
127
        jal     out
128
        j       hread1
129
hread0n:
130
        add     $7,$0,'?'
131
        jal     out
132
hread1:
133
        ldhu    $10,$3,18
134
        ldhu    $2,$4,18
135
        bne     $10,$2,hread1n
136
        add     $7,$0,'.'
137
        jal     out
138
        j       hread2
139
hread1n:
140
        add     $7,$0,'?'
141
        jal     out
142
hread2:
143
        ldhu    $10,$3,20
144
        ldhu    $2,$4,20
145
        bne     $10,$2,hread2n
146
        add     $7,$0,'.'
147
        jal     out
148
        j       hread3
149
hread2n:
150
        add     $7,$0,'?'
151
        jal     out
152
hread3:
153
        ldhu    $10,$3,22
154
        ldhu    $2,$4,22
155
        bne     $10,$2,hread3n
156
        add     $7,$0,'.'
157
        jal     out
158
        j       hread4
159
hread3n:
160
        add     $7,$0,'?'
161
        jal     out
162
hread4:
163
        add     $7,$0,0x0D
164
        jal     out
165
        add     $7,$0,0x0A
166
        jal     out
167
        add     $7,$0,0x0D
168
        jal     out
169
        add     $7,$0,0x0A
170
        jal     out
171
        ;
172
        ; write memory (bytes)
173
        ;
174
bwrite:
175
        add     $4,$0,mem_base
176
        add     $3,$0,tbl
177
        ldbu    $2,$3,32
178
        stb     $2,$4,32
179
        add     $7,$0,'.'
180
        jal     out
181
        ldbu    $2,$3,33
182
        stb     $2,$4,33
183
        add     $7,$0,'.'
184
        jal     out
185
        ldbu    $2,$3,34
186
        stb     $2,$4,34
187
        add     $7,$0,'.'
188
        jal     out
189
        ldbu    $2,$3,35
190
        stb     $2,$4,35
191
        add     $7,$0,'.'
192
        jal     out
193
        add     $7,$0,0x0D
194
        jal     out
195
        add     $7,$0,0x0A
196
        jal     out
197
        ;
198
        ; read memory (bytes)
199
        ;
200
bread0:
201
        ldbu    $10,$3,32
202
        ldbu    $2,$4,32
203
        bne     $10,$2,bread0n
204
        add     $7,$0,'.'
205
        jal     out
206
        j       bread1
207
bread0n:
208
        add     $7,$0,'?'
209
        jal     out
210
bread1:
211
        ldbu    $10,$3,33
212
        ldbu    $2,$4,33
213
        bne     $10,$2,bread1n
214
        add     $7,$0,'.'
215
        jal     out
216
        j       bread2
217
bread1n:
218
        add     $7,$0,'?'
219
        jal     out
220
bread2:
221
        ldbu    $10,$3,34
222
        ldbu    $2,$4,34
223
        bne     $10,$2,bread2n
224
        add     $7,$0,'.'
225
        jal     out
226
        j       bread3
227
bread2n:
228
        add     $7,$0,'?'
229
        jal     out
230
bread3:
231
        ldbu    $10,$3,35
232
        ldbu    $2,$4,35
233
        bne     $10,$2,bread3n
234
        add     $7,$0,'.'
235
        jal     out
236
        j       bread4
237
bread3n:
238
        add     $7,$0,'?'
239
        jal     out
240
bread4:
241
        add     $7,$0,0x0D
242
        jal     out
243
        add     $7,$0,0x0A
244
        jal     out
245
        add     $7,$0,0x0D
246
        jal     out
247
        add     $7,$0,0x0A
248
        jal     out
249
        ;
250
        ; finally, halt
251
        ;
252
halt:
253
        j       halt
254
 
255
        ;
256
        ; output on terminal
257
        ;
258
out:
259
        add     $8,$0,io_base
260
out1:
261
        ldw     $9,$8,8
262
        and     $9,$9,1
263
        beq     $9,$0,out1
264
        stw     $7,$8,12
265
        jr      $31
266
 
267
        ;
268
        ; table of random values
269
        ;
270
        .align  4
271
tbl:
272
        .byte   0x45,0x23,0x98,0x48,0xDC,0x5C,0x94,0x58
273
        .byte   0x1F,0x7C,0x58,0xD7,0x41,0x1E,0xA9,0xE1
274
        .byte   0x00,0x62,0x08,0x27,0x23,0xE9,0xCD,0x43
275
        .byte   0x0F,0x25,0xF9,0x72,0xC2,0xD7,0xC4,0x07
276
        .byte   0xFB,0x5D,0x50,0xD7,0xBA,0xE4,0x30,0xD9
277
        .byte   0x61,0x89,0xB1,0xA3,0xA8,0x5A,0x84,0xA8
278
        .byte   0xBD,0x8C,0xD0,0xE0,0x76,0x9E,0x24,0x86
279
        .byte   0xC4,0x1D,0xF8,0x86,0xF5,0xBD,0x8D,0xF0
280
        .byte   0x1A,0xDD,0xC8,0xD4,0xC2,0xF8,0xAD,0x23
281
        .byte   0x82,0x5F,0xC6,0x2A,0xB9,0x4A,0xD3,0x77
282
        .byte   0xD7,0xA4,0x58,0x4E,0x42,0x7C,0xD4,0x06
283
        .byte   0x9A,0xCC,0x8D,0x8F,0x89,0x1B,0x7F,0xA4
284
        .byte   0xF9,0x48,0x78,0xBB,0x40,0x26,0xDE,0xC3
285
        .byte   0x85,0xA5,0xED,0x3F,0xF0,0xC1,0xB7,0xC7
286
        .byte   0x65,0x0F,0x15,0xA8,0x8C,0xE9,0xAF,0x26
287
        .byte   0xB6,0x3C,0xB6,0x40,0x57,0x35,0xE4,0x50
288
        .byte   0x7E,0x5D,0x0B,0xBF,0x84,0xEA,0x82,0x0A
289
        .byte   0x8F,0x70,0x4A,0x7F,0x31,0x02,0x47,0x96
290
        .byte   0x12,0x5D,0x3F,0x9E,0x47,0xEE,0xC5,0xFD
291
        .byte   0x2B,0x7B,0x3E,0x82,0xB1,0x23,0xD3,0x2F
292
        .byte   0x81,0xDF,0xEE,0x06,0xCA,0x70,0x11,0x59
293
        .byte   0xE0,0x5B,0xD9,0x11,0x5E,0x21,0xA8,0x70
294
        .byte   0x7E,0xE7,0x0E,0xC5,0xD6,0xD4,0xC3,0x01
295
        .byte   0x4F,0x01,0x84,0x01,0x24,0x57,0x30,0xA5
296
        .byte   0x37,0x1E,0xAC,0x01,0x8F,0xBD,0x5A,0x70
297
        .byte   0x18,0x34,0x82,0x77,0x55,0x2A,0xE7,0xD3
298
        .byte   0x12,0xF6,0x99,0xE8,0xCA,0x5C,0xEA,0x1A
299
        .byte   0x5D,0x6E,0x1B,0x82,0xC5,0x4B,0x28,0xFD
300
        .byte   0x6A,0xD4,0xFE,0xFA,0x91,0x59,0x6A,0xAA
301
        .byte   0x8D,0xEC,0x21,0xE3,0x17,0x09,0xB7,0x29
302
        .byte   0xFF,0x50,0x12,0xC9,0xAC,0xFC,0xE3,0x0A
303
        .byte   0x6B,0xFF,0x8D,0x31,0x4A,0xB5,0x2E,0xB5
304
        .byte   0x8A
305
augment:
306
        .byte   0x45,0x23,0x98

powered by: WebSVN 2.1.0

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