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

Subversion Repositories Aquarius

[/] [Aquarius/] [trunk/] [verification/] [sha_testsource/] [testbra.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
testbra.src
5
 
6
Sep.16 2002
7
Nov.02 2002
8
===================
9
 
10
address           size wait width device
11
00000000-00001FFF  8K  0    32    ROM
12
00010000-00011FFF  8K  3    32    ROM
13
00020000-00021FFF  8K  0    16    ROM
14
00030000-00031FFF  8K  3    16    ROM
15
ABCD0000-ABCD0003   4  3    32    PIO
16
ABCD0100-ABCD0103   4  3    32    UART
17
ABCD0200-ABCD0207   8  3    32    SYS
18
FFFCE000-FFFCFFFF  8K  0    32    RAM
19
FFFDE000-FFFDFFFF  8K  3    32    RAM
20
FFFEE000-FFFEFFFF  8K  0    16    RAM
21
FFFFE000-FFFFFFFF  8K  3    16    RAM
22
*/
23
 
24
.equ _rom0, 0x00000000
25
.equ _rom1, 0x00010000
26
.equ _rom2, 0x00020000
27
.equ _rom3, 0x00030000
28
.equ _pio,  0xabcd0000
29
.equ _uart, 0xabcd0100
30
.equ _sys,  0xabcd0200
31
.equ _ram0, 0xfffce000
32
.equ _ram1, 0xfffde000
33
.equ _ram2, 0xfffee000
34
.equ _ram3, 0xffffe000
35
 
36
.org _rom0
37
.long _rom0 + _init - _rom0
38
.long _ram0 + 0x02000
39
 
40
.org 0x0400
41
 
42
/**************
43
 Initialization
44
 **************/
45
_init:
46
_start:
47
 mov    #0, r14
48
_test:
49
 mov.l  _pfail, r13 !fail address
50
 bra    _testgo
51
 nop
52
_pfail: .long _fail
53
.align 4
54
_testgo:
55
 
56
/***********************
57
 BRA and load contention
58
 ***********************/
59
 mov    #0x8b, r0
60
 mov.l  _pram0, r1
61
 mov.l  r0, @r1
62
 
63
 nop
64
 bra _bracont
65
 mov.l  @r1, r2
66
 
67
_bracont:
68
 mov    #-4, r1
69
 and    r1, r2
70
 
71
 mov    r2, r0
72
 cmp/eq #0x88, r0
73
 bt     .+6
74
 jmp    @r13
75
 nop
76
 
77
/************************
78
 RTS and write contention
79
 ************************/
80
 mov.l  _prts_target, r1
81
 lds    r1, pr
82
 mov    #0xab, r0
83
 
84
 mov.l  r0, @-r15
85
 mov.l  r0, @-r15
86
 mov.l  r0, @-r15
87
 mov.l  r0, @-r15
88
 mov.l  r0, @-r15
89
 mov.l  r0, @-r15
90
 mov.l  r0, @-r15
91
 mov.l  r0, @-r15
92
 sts.l  pr, @-r15
93
 
94
 lds    r0, pr
95
 
96
 lds.l  @r15+, pr
97
 mov.l  @r15+, r1
98
 mov.l  @r15+, r2
99
 mov.l  @r15+, r3
100
 mov.l  @r15+, r4
101
 mov.l  @r15+, r5
102
 mov.l  @r15+, r6
103
 mov.l  @r15+, r7
104
 rts
105
 mov.l  @r15+, r8
106
 
107
.align 4
108
_prts_target: .long _rts_target
109
 
110
_rts_target:
111
 mov    #0x12, r8
112
 mov    r8, r0
113
 cmp/eq #0x12, r0
114
 bt     .+6
115
 jmp    @r13
116
 nop
117
 
118
/********
119
 BRA disp
120
 BSR disp
121
 ********/
122
 mov    #126, r0
123
 
124
 bra    _bratarget
125
 add    #1, r0
126
 
127
_brareturn:
128
 cmp/eq #0xaa, r0
129
 bt     .+6
130
 jmp    @r13
131
 nop
132
 
133
 mov    #123, r0
134
 bsr    _bsrtarget
135
 add    #2, r0
136
 
137
 cmp/eq #0x55, r0
138
 bt     .+6
139
 jmp    @r13
140
 nop
141
 
142
 bra    _endbrabsr
143
 nop
144
 
145
_bratarget:
146
 cmp/eq #127, r0
147
 bt     .+6
148
 jmp    @r13
149
 nop
150
 bra    _brareturn
151
 mov    #0xaa, r0
152
 
153
_bsrtarget:
154
 cmp/eq #125, r0
155
 bt     .+6
156
 jmp    @r13
157
 nop
158
 rts
159
 mov    #0x55, r0
160
 
161
_endbrabsr:
162
 
163
/*******
164
 JMP @Rn
165
 JSR @Rn
166
 *******/
167
 mov.l  _pjmptarget, r1
168
 mov.l  _pjsrtarget, r3
169
 mov    #126, r0
170
 
171
 jmp    @r1
172
 add    #1, r0
173
 
174
_jmpreturn:
175
 cmp/eq #0xaa, r0
176
 bt     .+6
177
 jmp    @r13
178
 nop
179
 
180
 mov    #123, r0
181
 jsr    @r3
182
 add    #2, r0
183
 
184
 cmp/eq #0x55, r0
185
 bt     .+6
186
 jmp    @r13
187
 nop
188
 
189
 bra    _endjmpjsr
190
 nop
191
 
192
_jmptarget:
193
 cmp/eq #127, r0
194
 bt     .+6
195
 jmp    @r13
196
 nop
197
 bra    _jmpreturn
198
 mov    #0xaa, r0
199
 
200
_jsrtarget:
201
 cmp/eq #125, r0
202
 bt     .+6
203
 jmp    @r13
204
 nop
205
 rts
206
 mov    #0x55, r0
207
 
208
.align 4
209
_pjmptarget: .long _jmptarget
210
_pjsrtarget: .long _jsrtarget
211
 
212
_endjmpjsr:
213
 
214
/*********
215
 BT/S disp
216
 BF/S disp
217
 *********/
218
 mov.l  _pram0, r1
219
 mov    #0xa0, r0
220
 mov.b  r0, @(0, r1)
221
 add    #1, r0
222
 mov.b  r0, @(1, r1)
223
 add    #1, r0
224
 mov.b  r0, @(2, r1)
225
 add    #1, r0
226
 mov.b  r0, @(3, r1)
227
 
228
 clrt
229
 bt/s   _btsfail
230
 mov.b  @(0, r1), r0
231
 cmp/eq #0xa0, r0
232
 bf     _btsfail
233
 
234
 clrt
235
 bf/s   _bts1
236
 mov.b  @(1, r1), r0
237
 bra    _btsfail
238
 nop
239
_bts1:
240
 cmp/eq #0xa1, r0
241
 bf     _btsfail
242
 
243
 sett
244
 bf/s   _btsfail
245
 mov.b  @(2, r1), r0
246
 cmp/eq #0xa2, r0
247
 bf     _btsfail
248
 
249
 sett
250
 bt/s   _bts2
251
 mov.b  @(3, r1), r0
252
 bra    _btsfail
253
 nop
254
_bts2:
255
 cmp/eq #0xa3, r0
256
 bt     _btspass
257
 
258
_btsfail:
259
 jmp    @r13
260
 nop
261
_btspass:
262
 
263
/*********************
264
 Branch Subroutine Far
265
 *********************/
266
 mov    #(target_bsrf - origin_bsrf), r0
267
 mov    #0xab, r1
268
 mov.l  _pram0, r2
269
 bsrf   r0
270
 mov.l  r1, @r2
271
origin_bsrf:
272
 nop
273
 nop
274
 nop
275
 mov.l  @r2, r0
276
 cmp/eq #0xac, r0
277
 bt     .+6
278
 jmp    @r13
279
 nop
280
 bra    _bsrfend
281
 nop
282
target_bsrf:
283
 mov.l  @r2, r1
284
 add    #1,  r1
285
 rts
286
 mov.l  r1,  @r2
287
_bsrfend:
288
 
289
/**********
290
 Branch Far
291
 **********/
292
 mov    #(target_braf - origin_braf), r0
293
 mov    #0xab, r1
294
 mov.l  _pram0, r2
295
 braf   r0
296
 mov.l  r1, @r2
297
origin_braf:
298
 nop
299
 nop
300
 nop
301
 nop
302
 nop
303
 nop
304
 jmp    @r13
305
 nop
306
target_braf:
307
 mov.l  @r2, r0
308
 cmp/eq #0xab, r0
309
 bt     .+6
310
 jmp    @r13
311
 nop
312
 
313
/******************************
314
 Subroutine : Generic Operation
315
 ******************************/
316
_subroutine:
317
 bsr    _subtest
318
 mov    #0x12, r0
319
 cmp/eq #0x12, r0
320
 bt     .+6
321
 jmp    @r13
322
 nop
323
 bra    _subroutineend
324
 nop
325
!----
326
_subtest:
327
 mov.l  r0, @-r15
328
 sts.l  pr, @-r15
329
 bsr    _subtest2
330
 mov    #0xab, r0
331
 lds.l  @r15+, pr
332
 rts
333
 mov.l  @r15+, r0
334
!----
335
_subtest2:
336
 mov.l  r0, @-r15
337
 sts.l  pr, @-r15
338
 mov    #0x88, r0
339
 lds.l  @r15+, pr
340
 rts
341
 mov.l  @r15+, r0
342
!----
343
_subroutineend:
344
 
345
/*****************
346
 Compare and BT/BF
347
 *****************/
348
_cmpbtbf:
349
 mov.l  _p12345678, r0
350
 mov.l  _p89abcdef, r1
351
 cmp/eq r1, r0
352
 bt     .+4
353
 bf     .+6
354
 jmp    @r13
355
 nop
356
!----
357
 mov.l  _p12345678, r1
358
 cmp/eq r1, r0
359
 bf     .+4
360
 bt     .+6
361
 jmp    @r13
362
 nop
363
 
364
/**************
365
 Full CMP check
366
 **************/
367
_compare:
368
 mov #0xab, r0
369
 cmp/eq #0xab, r0 !T=1
370
 bf     _cmpfail
371
 cmp/eq #0xac, r0 !T=0
372
 bt     _cmpfail
373
!----
374
 mov.l _p5a5a5a5a, r4
375
 mov.l _p5a5a5a5a, r5
376
 cmp/eq r5, r4 !T=1
377
 bf     _cmpfail
378
 cmp/eq r4, r5 !T=1
379
 bf     _cmpfail
380
 cmp/hs r5, r4 !T=1
381
 bf     _cmpfail
382
 cmp/hs r4, r5 !T=1
383
 bf     _cmpfail
384
 cmp/ge r5, r4 !T=1
385
 bf     _cmpfail
386
 cmp/ge r4, r5 !T=1
387
 bf     _cmpfail
388
 cmp/hi r5, r4 !T=0
389
 bt     _cmpfail
390
 cmp/hi r4, r5 !T=0
391
 bt     _cmpfail
392
 cmp/gt r5, r4 !T=0
393
 bt     _cmpfail
394
 cmp/gt r4, r5 !T=0
395
 bt     _cmpfail
396
!----
397
 mov.l _p5a5a5a5a, r4
398
 mov.l _paa5a5a5a, r5
399
 cmp/eq r5, r4 !T=0
400
 bt     _cmpfail
401
 cmp/eq r4, r5 !T=0
402
 bt     _cmpfail
403
 cmp/hs r5, r4 !T=0
404
 bt     _cmpfail
405
 cmp/hs r4, r5 !T=1
406
 bf     _cmpfail
407
 cmp/ge r5, r4 !T=1
408
 bf     _cmpfail
409
 cmp/ge r4, r5 !T=0
410
 bt     _cmpfail
411
 cmp/hi r5, r4 !T=0
412
 bt     _cmpfail
413
 cmp/hi r4, r5 !T=1
414
 bf     _cmpfail
415
 cmp/gt r5, r4 !T=1
416
 bf     _cmpfail
417
 cmp/gt r4, r5 !T=0
418
 bt     _cmpfail
419
!----
420
 mov.l   _p12345678, r4
421
 mov.l   _pabcd56ef, r5
422
 cmp/str r5, r4 !T=1
423
 bf      _cmpfail
424
 mov.l   _p12345678, r4
425
 mov.l   _pabcdef01, r5
426
 cmp/str r5, r4 !T=0
427
 bt      _cmpfail
428
!----
429
 mov    #0, r4
430
 mov    #1, r5
431
 mov    #-1, r6
432
 cmp/pz r4 !T=1
433
 bf     _cmpfail
434
 cmp/pz r5 !T=1
435
 bf     _cmpfail
436
 cmp/pz r6 !T=0
437
 bt     _cmpfail
438
 cmp/pl r4 !T=0
439
 bt     _cmpfail
440
 cmp/pl r5 !T=1
441
 bf     _cmpfail
442
 cmp/pl r6 !T=0
443
 bt     _cmpfail
444
!----
445
 bra   _cmpgood
446
 nop
447
_cmpfail:
448
 jmp   @r13
449
 nop
450
_cmpgood:
451
 
452
/**************
453
 Constant Table
454
 **************/
455
 bra    _constantend
456
 nop
457
.align 4
458
_p12345678: .long 0x12345678
459
_p89abcdef: .long 0x89abcdef
460
_p5a5a5a5a: .long 0x5a5a5a5a
461
_paa5a5a5a: .long 0xaa5a5a5a
462
_pabcd56ef: .long 0xabcd56ef
463
_pabcdef01: .long 0xabcdef01
464
_pram0    : .long _ram0
465
.align 2
466
_constantend:
467
 
468
/*********************************************************
469
 Move to another Next ROM area to check hardware operation
470
 *********************************************************/
471
 mov.l _pbranch_table, r13
472
 add r14, r13
473
 mov.l @r13, r12
474
 jmp @r12
475
 add #4, r14
476
.align 4
477
_pbranch_table: .long _branch_table
478
_branch_table:
479
 .long _rom1+_test
480
 .long _rom2+_test
481
 .long _rom3+_test
482
 .long _rom0+_pass
483
 
484
/**************
485
 Congraturation
486
 **************/
487
_pass:
488
 mov.l _ppass_value, r0
489
 mov.l _ppass_value, r1
490
 mov.l r0, @r1
491
 bra   _pass
492
 nop
493
.align 4
494
_ppass_value: .long 0x12345678
495
 
496
/**********
497
 You Failed
498
 **********/
499
_fail:
500
 mov.l _pfail_value, r0
501
 mov.l _pfail_value, r1
502
 bra   _fail
503
 nop
504
.align 4
505
_pfail_value: .long 0x88888888
506
 
507
.end

powered by: WebSVN 2.1.0

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