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

Subversion Repositories Aquarius

[/] [Aquarius/] [trunk/] [verification/] [sha_testsource/] [testmov2.src] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 thorn_aitc
/*
2
===================
3
test source program
4
testmov2.src
5
 
6
Mar.08 2003
7
===================
8
 
9
address           size wait width device
10
00000000-00001FFF  8K  0    32    ROM
11
00010000-00011FFF  8K  3    32    ROM
12
00020000-00021FFF  8K  0    16    ROM
13
00030000-00031FFF  8K  3    16    ROM
14
ABCD0000-ABCD0003   4  3    32    PIO
15
ABCD0100-ABCD0103   4  3    32    UART
16
ABCD0200-ABCD0207   8  3    32    SYS
17
FFFCE000-FFFCFFFF  8K  0    32    RAM
18
FFFDE000-FFFDFFFF  8K  3    32    RAM
19
FFFEE000-FFFEFFFF  8K  0    16    RAM
20
FFFFE000-FFFFFFFF  8K  3    16    RAM
21
*/
22
 
23
.equ _rom0, 0x00000000
24
.equ _rom1, 0x00010000
25
.equ _rom2, 0x00020000
26
.equ _rom3, 0x00030000
27
.equ _pio,  0xabcd0000
28
.equ _uart, 0xabcd0100
29
.equ _sys,  0xabcd0200
30
.equ _ram0, 0xfffce000
31
.equ _ram1, 0xfffde000
32
.equ _ram2, 0xfffee000
33
.equ _ram3, 0xffffe000
34
 
35
.org _rom0
36
.long _rom0 + _init - _rom0
37
.long _ram0 + 0x02000
38
 
39
.org 0x0400
40
 
41
/**************
42
 Initialization
43
 **************/
44
_init:
45
_start:
46
 mov    #0, r14
47
_test:
48
 mov.l  _pfail, r13 !fail address
49
 bra    _testgo
50
 nop
51
_pfail: .long _fail
52
_testgo:
53
 
54
/********************
55
 MOVA @(disp, PC), R0
56
 ********************/
57
 mov     #0xaa, r1
58
 mova    _mova_target, r0
59
 jmp     @r0
60
 nop
61
 jmp     @r13
62
 nop
63
 jmp     @r13
64
 nop
65
 jmp     @r13
66
 nop
67
_mova_target:
68
 bra     _mova_target2
69
 mova    _mova_target3, r0
70
 jmp     @r13
71
 nop
72
_mova_target2:
73
 jmp     @r0       ! jmp _mova_target4
74
 nop
75
_mova_target3:
76
 mov     #0x55, r1 ! should be skipped
77
 jmp     @r13      ! should be skipped
78
_mova_target4:
79
 nop
80
 mov     r1, r0
81
 cmp/eq  #0xaa, r0
82
 bt      .+6
83
 jmp     @r13
84
 nop
85
 
86
/**********************
87
 MOV.L R0, @(disp, GBR)
88
 MOV.W R0, @(disp, GBR)
89
 MOV.B R0, @(disp, GBR)
90
 MOV.L @(disp, GBR), R0
91
 MOV.W @(disp, GBR), R0
92
 MOV.B @(disp, GBR), R0
93
 **********************/
94
 mov.l   _pram0, r1
95
 ldc     r1, gbr
96
 
97
 mov.l   _p11223344, r0
98
 mov.l   r0, @(4, gbr)
99
 mov.w   r0, @(10, gbr)
100
 mov.b   r0, @(13, gbr)
101
 
102
 mov     #0xff, r0
103
 cmp/eq  #0xff, r0
104
 bt      .+6
105
 jmp     @r13
106
 nop
107
 
108
 mov.l   @(4, r1), r0
109
 mov.l   _p11223344, r2
110
 cmp/eq  r2, r0
111
 bt      .+6
112
 jmp     @r13
113
 nop
114
 
115
 mov.w   @(10, r1), r0
116
 mov.l   _p00003344, r2
117
 cmp/eq  r2, r0
118
 bt      .+6
119
 jmp     @r13
120
 nop
121
 
122
 mov.b  @(13, r1), r0
123
 mov.l  _p00000044, r2
124
 cmp/eq  r2, r0
125
 bt      .+6
126
 jmp     @r13
127
 nop
128
 
129
 mov.l   @(4, gbr), r0
130
 mov.l   _p11223344, r2
131
 cmp/eq  r2, r0
132
 bt      .+6
133
 jmp     @r13
134
 nop
135
 
136
 mov.w   @(10, gbr), r0
137
 mov.l   _p00003344, r2
138
 cmp/eq  r2, r0
139
 bt      .+6
140
 jmp     @r13
141
 nop
142
 
143
 mov.b  @(13, gbr), r0
144
 mov.l  _p00000044, r2
145
 cmp/eq  r2, r0
146
 bt      .+6
147
 jmp     @r13
148
 nop
149
 
150
/*********************
151
 MOV.L Rm, @(disp, Rn)
152
 MOV.W R0, @(disp, Rn)
153
 MOV.B R0, @(disp, Rn)
154
 *********************/
155
 mov.l   _pram0,     r1
156
 mov.l   _p11223344, r2
157
 mov.l   _pram0_16,  r3
158
 
159
 mov.l   r2, @(16, r1)
160
 mov.l   @r3, r0
161
 cmp/eq  r2, r0
162
 bt      .+6
163
 jmp     @r13
164
 nop
165
 
166
 mov     #0xff, r0
167
 mov.l   r0, @(8, r1)
168
 mov.l   _p11223344, r0
169
 mov.w   r0, @(8, r1)
170
 mov     r1, r5
171
 add     #8, r5
172
 mov.b   @(0, r5), r0
173
 cmp/eq  #0x33, r0
174
 bt      .+6
175
 jmp     @r13
176
 nop
177
 mov.b   @(1, r5), r0
178
 cmp/eq  #0x44, r0
179
 bt      .+6
180
 jmp     @r13
181
 nop
182
 mov.w   @(2, r5), r0
183
 cmp/eq  #0xff, r0
184
 bt      .+6
185
 jmp     @r13
186
 nop
187
 
188
 mov     #0xff, r0
189
 mov.l   r0, @(4, r1)
190
 mov.l   _p11223344, r0
191
 mov.b   r0, @(4, r1)
192
 mov     r1, r5
193
 add     #4, r5
194
 mov.b   @(0, r5), r0
195
 cmp/eq  #0x44, r0
196
 bt      .+6
197
 jmp     @r13
198
 nop
199
 mov.b   @(1, r5), r0
200
 cmp/eq  #0xff, r0
201
 bt      .+6
202
 jmp     @r13
203
 nop
204
 mov.w   @(2, r5), r0
205
 cmp/eq  #0xff, r0
206
 bt      .+6
207
 jmp     @r13
208
 nop
209
 
210
/*********************
211
 MOV.L @(disp, Rm), Rn
212
 MOV.W @(disp, Rm), R0
213
 MOV.B @(disp, Rm), R0
214
 *********************/
215
 mov.l   _pram0_16,  r1
216
 mov.l   _p11223344, r2
217
 mov.l   r2, @r1
218
 mov.l   _pram0,     r3
219
 
220
 mov.l   @(16, r3), r4
221
 cmp/eq  r4, r2
222
 bt      .+6
223
 jmp     @r13
224
 nop
225
 
226
 mov.w   @(16, r3), r0
227
 mov.l   _p00001122, r4
228
 cmp/eq  r4, r0
229
 bt      .+6
230
 jmp     @r13
231
 nop
232
 
233
 add     #4, r3
234
 mov.b   @(16-4, r3), r0
235
 mov.l   _p00000011, r4
236
 cmp/eq  r4, r0
237
 bt      .+6
238
 jmp     @r13
239
 nop
240
 
241
/*******************
242
 MOV.B @(R0, Rm), Rn
243
 *******************/
244
 mov.l   _pram0,     r1
245
 mov.l   _p04050607, r0
246
 mov.l   _p11223344, r2
247
 mov.l   r0,  @(0, r1)
248
 mov.l   r2,  @(4, r1)
249
 
250
 mov.b   @(0, r1), r0
251
 mov.l   _pram0, r3
252
 mov.b   @(r0, r3), r4
253
 mov.l   _p00000011, r0
254
 cmp/eq  r4, r0
255
 bt     .+6
256
 jmp    @r13
257
 nop
258
 
259
/*******************
260
 MOV.W @(R0, Rm), Rn
261
 *******************/
262
 mov.l   _pram0,     r1
263
 mov.l   _p04050607, r0
264
 mov.l   _p11223344, r2
265
 mov.l   r0,  @(0, r1)
266
 mov.l   r2,  @(4, r1)
267
 
268
 mov.b   @(0, r1), r0
269
 mov.l   _pram0, r3
270
 mov.w   @(r0, r3), r4
271
 mov.l   _p00001122, r0
272
 cmp/eq  r4, r0
273
 bt     .+6
274
 jmp    @r13
275
 nop
276
 
277
/*******************
278
 MOV.L @(R0, Rm), Rn
279
 *******************/
280
 mov.l   _pram0,     r1
281
 mov.l   _p04050607, r0
282
 mov.l   _p11223344, r2
283
 mov.l   r0,  @(0, r1)
284
 mov.l   r2,  @(4, r1)
285
 
286
 mov.b   @(0, r1), r0
287
 mov.l   _pram0, r3
288
 mov.l   @(r0, r3), r4
289
 mov.l   _p11223344, r0
290
 cmp/eq  r4, r0
291
 bt     .+6
292
 jmp    @r13
293
 nop
294
 
295
 mov.l   _pram0, r3
296
 mov.b   @(0, r1), r0
297
 mov.l   @(r0, r3), r4
298
 mov.l   _p11223344, r0
299
 cmp/eq  r4, r0
300
 bt     .+6
301
 jmp    @r13
302
 nop
303
 
304
/*******************
305
 MOV.B Rm, @(R0, Rn)
306
 *******************/
307
 mov.l   _pram0,     r1
308
 mov.l   _pram0_16,  r3
309
 mov.l   _p00010203, r0
310
 mov.l   _p04050607, r2
311
 mov.l   r0,  @(0, r1)
312
 mov.l   r2,  @(4, r1)
313
 mov     #0xff, r0
314
 mov.l   r0,  @(4, r3)
315
 
316
 mov.l   _p01234567, r2
317
 mov.b   @(4, r1), r0   ! r0=4
318
 mov.b   r2, @(r0, r3)
319
 mov     r3, r5
320
 add     #4, r5
321
 mov.b   @(0, r5), r0
322
 cmp/eq  #0x67, r0
323
 bt     .+6
324
 jmp    @r13
325
 nop
326
 mov.b   @(1, r5), r0
327
 cmp/eq  #0xff, r0
328
 bt     .+6
329
 jmp    @r13
330
 nop
331
 mov.w   @(2, r5), r0
332
 cmp/eq  #0xff, r0
333
 bt     .+6
334
 jmp    @r13
335
 nop
336
 
337
/*******************
338
 MOV.W Rm, @(R0, Rn)
339
 *******************/
340
 mov.l   _pram0,     r1
341
 mov.l   _pram0_16,  r3
342
 mov.l   _p00010203, r0
343
 mov.l   _p04050607, r2
344
 mov.l   r0,  @(0, r1)
345
 mov.l   r2,  @(4, r1)
346
 mov     #0xff, r0
347
 mov.l   r0,  @(4, r3)
348
 
349
 mov.l   _p01234567, r2
350
 mov.b   @(4, r1), r0   ! r0=4
351
 mov.w   r2, @(r0, r3)
352
 mov     r3, r5
353
 add     #4, r5
354
 mov.b   @(0, r5), r0
355
 cmp/eq  #0x45, r0
356
 bt     .+6
357
 jmp    @r13
358
 nop
359
 mov.b   @(1, r5), r0
360
 cmp/eq  #0x67, r0
361
 bt     .+6
362
 jmp    @r13
363
 nop
364
 mov.w   @(2, r5), r0
365
 cmp/eq  #0xff, r0
366
 bt     .+6
367
 jmp    @r13
368
 nop
369
 
370
/***********************
371
 MOV.L Rm, @(R0, Rn)
372
 ***********************/
373
 mov.l   _pram0,     r1
374
 mov.l   _pram0_16,  r3
375
 mov.l   _p00010203, r0
376
 mov.l   _p04050607, r2
377
 mov.l   r0,  @(0, r1)
378
 mov.l   r2,  @(4, r1)
379
 mov     #0xff, r0
380
 mov.l   r0,  @(4, r3)
381
 
382
 mov.l   _p01234567, r2
383
 mov.b   @(4, r1), r0   ! r0=4
384
 mov.l   r2, @(r0, r3)
385
 mov     r3, r5
386
 add     #4, r5
387
 mov.l   @r5, r4
388
 cmp/eq  r2, r4
389
 bt     .+6
390
 jmp    @r13
391
 nop
392
 
393
 mov.b   @(4, r1), r0   ! r0=4
394
 mov.l   _p01234567, r2
395
 mov.l   r2, @(r0, r3)
396
 mov     r3, r5
397
 add     #4, r5
398
 mov.l   @r5, r4
399
 cmp/eq  r2, r4
400
 bt     .+6
401
 jmp    @r13
402
 nop
403
 
404
 mov.l   _p01234567, r2
405
 mov.b   @(4, r1), r0   ! r0=4
406
 mov.l   _pram0_16,  r3
407
 mov.l   r2, @(r0, r3)
408
 mov     r3, r5
409
 add     #4, r5
410
 mov.l   @r5, r4
411
 cmp/eq  r2, r4
412
 bt     .+6
413
 jmp    @r13
414
 nop
415
 
416
/**************
417
 Constant Table
418
 **************/
419
 bra    _constantend
420
 nop
421
.align 4
422
_pram0    : .long _ram0
423
_pram0_4  : .long _ram0+4
424
_pram0_12 : .long _ram0+16-4
425
_pram0_16 : .long _ram0+16
426
_p01234567: .long 0x01234567
427
_p89abcdef: .long 0x89abcdef
428
_p55aa55aa: .long 0x55aa55aa
429
_p11223344: .long 0x11223344
430
_p00001122: .long 0x00001122
431
_p00000011: .long 0x00000011
432
_p00003344: .long 0x00003344
433
_p00000044: .long 0x00000044
434
_paabbccdd: .long 0xaabbccdd
435
_pffffaabb: .long 0xffffaabb
436
_pffffffaa: .long 0xffffffaa
437
_pccdd    : .long 0xffffccdd
438
_p000003f3: .long 0x000003f3
439
_p00010203: .long 0x00010203
440
_p04050607: .long 0x04050607
441
_paabb    : .word 0xaabb
442
.align 2
443
_constantend:
444
 
445
/*********************************************************
446
 Move to another Next ROM area to check hardware operation
447
 *********************************************************/
448
 mov.l _pbranch_table, r13
449
 add r14, r13
450
 mov.l @r13, r12
451
 jmp @r12
452
 add #4, r14
453
.align 4
454
_pbranch_table: .long _branch_table
455
_branch_table:
456
 .long _rom1+_test
457
 .long _rom2+_test
458
 .long _rom3+_test
459
 .long _rom0+_pass
460
 
461
/**************
462
 Congraturation
463
 **************/
464
_pass:
465
 mov.l _ppass_value, r0
466
 mov.l _ppass_value, r1
467
 mov.l r0, @r1
468
 bra   _pass
469
 nop
470
.align 4
471
_ppass_value: .long 0x12345678
472
 
473
/**********
474
 You Failed
475
 **********/
476
_fail:
477
 mov.l _pfail_value, r0
478
 mov.l _pfail_value, r1
479
 bra   _fail
480
 nop
481
.align 4
482
_pfail_value: .long 0x88888888
483
 
484
.end
485
 

powered by: WebSVN 2.1.0

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