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

Subversion Repositories Aquarius

[/] [Aquarius/] [trunk/] [verification/] [tools/] [test.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
testalu.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
_testgo:
54
 
55
/*************
56
 EXTU.B Rm, Rn
57
 EXTU.W Rm, Rn
58
 EXTS.B Rm, Rn
59
 EXTS.W Rm, Rn
60
 *************/
61
 mov.l  _p11223344, r0
62
 extu.b r0, r2
63
 extu.w r0, r4
64
 exts.b r0, r6
65
 exts.w r0, r8
66
 mov.l  _p00000044, r1
67
 mov.l  _p00003344, r3
68
 mov.l  _p00000044, r5
69
 mov.l  _p00003344, r7
70
 cmp/eq r1, r2
71
 bf     _extfail
72
 cmp/eq r3, r4
73
 bf     _extfail
74
 cmp/eq r5, r6
75
 bf     _extfail
76
 cmp/eq r7, r8
77
 bf     _extfail
78
 
79
 mov.l  _paabbccdd, r0
80
 extu.b r0, r2
81
 extu.w r0, r4
82
 exts.b r0, r6
83
 exts.w r0, r8
84
 mov.l  _p000000dd, r1
85
 mov.l  _p0000ccdd, r3
86
 mov.l  _pffffffdd, r5
87
 mov.l  _pffffccdd, r7
88
 cmp/eq r1, r2
89
 bf     _extfail
90
 cmp/eq r3, r4
91
 bf     _extfail
92
 cmp/eq r5, r6
93
 bf     _extfail
94
 cmp/eq r7, r8
95
 bf     _extfail
96
 
97
 bra    _extpass
98
 nop
99
_extfail:
100
 jmp    @r13
101
 nop
102
 .align 4
103
_p11223344 : .long 0x11223344
104
_paabbccdd : .long 0xaabbccdd
105
_p00000044 : .long 0x00000044
106
_p00003344 : .long 0x00003344
107
_p000000dd : .long 0x000000dd
108
_p0000ccdd : .long 0x0000ccdd
109
_pffffffdd : .long 0xffffffdd
110
_pffffccdd : .long 0xffffccdd
111
_extpass :
112
 
113
/***********
114
 NEGC Rm, Rn
115
 ***********/
116
 clrt             !negate 64bit value
117
 mov    #0x00, r4 !upper 32bit
118
 mov    #0x01, r2 !lower 32bit
119
 negc   r2, r6
120
 bt     .+6
121
 jmp    @r13
122
 nop
123
 negc   r4, r8
124
 bt     .+6
125
 jmp    @r13
126
 nop
127
 mov    #0xff, r4
128
 mov    #0xff, r2
129
 cmp/eq r8, r4
130
 bt     .+6
131
 jmp    @r13
132
 nop
133
 cmp/eq r6, r2
134
 bt     .+6
135
 jmp    @r13
136
 nop
137
 
138
 clrt
139
 mov    #0x00, r2
140
 negc   r2, r0
141
 bf     .+6
142
 jmp    @r13
143
 nop
144
 cmp/eq #0x00, r0
145
 bt     .+6
146
 jmp    @r13
147
 nop
148
 
149
/**********
150
 NEG Rm, Rn
151
 **********/
152
 mov    #127, r2
153
 neg    r2, r0
154
 cmp/eq #-127, r0
155
 bt     .+6
156
 jmp    @r13
157
 nop
158
 
159
 mov    #-128, r2
160
 neg    r2, r0
161
 mov.l  _p00000080, r4
162
 cmp/eq r4, r0
163
 bt     .+6
164
 jmp    @r13
165
 nop
166
 
167
 bra    _negpass
168
 nop
169
 .align 4
170
_p00000080 : .long 0x00000080
171
_negpass :
172
 
173
/*************
174
 SWAP.B Rm, Rn
175
 SWAP.W Rm, Rn
176
 *************/
177
 mov.l  _p00112233, r2
178
 swap.b r2, r4
179
 swap.w r2, r6
180
 mov.l  _p00113322, r8
181
 mov.l  _p22330011, r10
182
 cmp/eq r8, r4
183
 bt     .+6
184
 jmp    @r13
185
 nop
186
 cmp/eq r10, r6
187
 bt     .+6
188
 jmp    @r13
189
 nop
190
 
191
/**********
192
 NOT Rm, Rn
193
 **********/
194
 mov    #0xaa, r2
195
 not    r2, r0
196
 cmp/eq #0x55, r0
197
 bt     .+6
198
 jmp    @r13
199
 nop
200
 
201
/*********
202
 TAS.B @Rn
203
 *********/
204
 mov.l  _pram0, r1
205
 mov    #0x55, r0
206
 mov.b  r0, @r1
207
 tas.b  @r1
208
 bf     .+6
209
 jmp    @r13
210
 nop
211
 mov.b  @r1, r0
212
 cmp/eq #0xd5, r0
213
 bt     .+6
214
 jmp    @r13
215
 nop
216
 
217
 mov    #0x00, r0
218
 mov.b  r0, @r1
219
 tas.b  @r1
220
 bt     .+6
221
 jmp    @r13
222
 nop
223
 mov.b  @r1, r0
224
 cmp/eq #0x80, r0
225
 bt     .+6
226
 jmp    @r13
227
 nop
228
 
229
/*****
230
 DT Rn
231
 *****/
232
 mov    #0, r2
233
 mov    #10, r6
234
_loop_dt:
235
 add    r6, r2
236
 dt     r6
237
 bf     _loop_dt
238
 mov    r2, r0
239
 cmp/eq #55, r0
240
 bt     .+6
241
 jmp    @r13
242
 nop
243
 
244
/***********
245
 SUBV Rm, Rn
246
 ***********/
247
 mov    #0x7e, r0
248
 mov    #0x7f, r2
249
 subv   r2, r0
250
 bf     .+6
251
 jmp    @r13
252
 nop
253
 cmp/eq #0xff, r0
254
 bt     .+6
255
 jmp    @r13
256
 nop
257
 
258
 mov.l  _p80000000, r0
259
 mov    #0x01, r2
260
 subv   r2, r0
261
 bt     .+6
262
 jmp    @r13
263
 nop
264
 mov.l  _p7fffffff, r2
265
 cmp/eq r2, r0
266
 bt     .+6
267
 jmp    @r13
268
 nop
269
 
270
 mov.l  _p7fffffff, r0
271
 mov    #0xff, r2
272
 subv   r2, r0
273
 bt     .+6
274
 jmp    @r13
275
 nop
276
 mov.l  _p80000000, r2
277
 cmp/eq r2, r0
278
 bt     .+6
279
 jmp    @r13
280
 nop
281
 
282
/***********
283
 SUBC Rm, Rn
284
 ***********/
285
 clrt
286
 mov    #0x01, r0
287
 mov    #0x02, r1
288
 subc   r1, r0
289
 bt     .+6
290
 jmp    @r13
291
 nop
292
 cmp/eq #0xff, r0
293
 bt     .+6
294
 jmp    @r13
295
 nop
296
 
297
 sett
298
 mov    #0x04, r0
299
 mov    #0x02, r1
300
 subc   r1, r0
301
 bf     .+6
302
 jmp    @r13
303
 nop
304
 cmp/eq #0x01, r0
305
 bt     .+6
306
 jmp    @r13
307
 nop
308
 
309
/**********
310
 SUB Rm, Rn
311
 **********/
312
 mov    #86, r0
313
 mov    #127, r1
314
 sub    r1, r0
315
 cmp/eq #(86-127), r0
316
 bt     .+6
317
 jmp    @r13
318
 nop
319
 
320
/************
321
 ADD #imm, R0
322
 ************/
323
 mov    #0x12, r0
324
 add    #0x34, r0
325
 cmp/eq #0x46, r0
326
 bt     .+6
327
 jmp    @r13
328
 nop
329
 add    #1, r0
330
 cmp/eq #0x47, r0
331
 bt     .+6
332
 jmp    @r13
333
 nop
334
 
335
/***********
336
 ADDV Rm, Rn
337
 ***********/
338
 mov    #0xff, r0
339
 mov    #0x01, r2
340
 addv   r2, r0
341
 bf     .+6
342
 jmp    @r13
343
 nop
344
 cmp/eq #0x00, r0
345
 bt     .+6
346
 jmp    @r13
347
 nop
348
 
349
 mov.l  _p7fffffff, r0
350
 mov    #0x01, r2
351
 addv   r2, r0
352
 bt     .+6
353
 jmp    @r13
354
 nop
355
 mov.l  _p80000000, r2
356
 cmp/eq r2, r0
357
 bt     .+6
358
 jmp    @r13
359
 nop
360
 
361
 mov.l  _p80000000, r0
362
 mov    #0xff, r2
363
 addv   r2, r0
364
 bt     .+6
365
 jmp    @r13
366
 nop
367
 mov.l  _p7fffffff, r2
368
 cmp/eq r2, r0
369
 bt     .+6
370
 jmp    @r13
371
 nop
372
 
373
/***********
374
 ADDC Rm, Rn
375
 ***********/
376
 clrt
377
 mov    #0xff, r0
378
 mov    #0x01, r1
379
 addc   r1, r0
380
 bt     .+6
381
 jmp    @r13
382
 nop
383
 cmp/eq #0x00, r0
384
 bt     .+6
385
 jmp    @r13
386
 nop
387
 
388
 sett
389
 mov    #0xfd, r0
390
 mov    #0x01, r1
391
 addc   r1, r0
392
 bf     .+6
393
 jmp    @r13
394
 nop
395
 cmp/eq #0xff, r0
396
 bt     .+6
397
 jmp    @r13
398
 nop
399
 
400
/**********
401
 ADD Rm, Rn
402
 **********/
403
 mov    #89, r0
404
 mov    #-128, r1
405
 add    r1, r0
406
 cmp/eq #(89-128), r0
407
 bt     .+6
408
 jmp    @r13
409
 nop
410
 
411
/************
412
 XTRCT Rm, Rn
413
 ************/
414
 mov.l  _p00112233, r2
415
 mov.l  _p44556677, r4
416
 xtrct  r4, r2
417
 mov.l  _p66770011, r6
418
 cmp/eq r6, r2
419
 bt     .+6
420
 jmp    @r13
421
 nop
422
 
423
/**********
424
 XOR Rm, Rn
425
 **********/
426
 mov    #0xaa, r0
427
 mov    #0x55, r2
428
 xor    r2, r0
429
 tst    #0x00, r0
430
 bt     .+6
431
 jmp    @r13
432
 nop
433
 
434
 mov    #0xaa, r0 ! 1010
435
 mov    #0x77, r2 ! 0111
436
 xor    r2, r0
437
 cmp/eq #0xdd, r0 ! 1101
438
 bt     .+6
439
 jmp    @r13
440
 nop
441
 
442
/************
443
 XOR #imm, R0
444
 ************
445
 mov    #0xaa, r0
446
 extu.b r0, r0
447
 xor    #0x55, r0
448
 cmp/eq #0xff, r0
449
 bt     .+6
450
 jmp    @r13
451
 nop
452
 
453
 mov    #0xaa, r0 ! 1010
454
 xor    #0x77, r0 ! 0111
455
 cmp/eq #0xdd, r0 ! 1101
456
 bt     .+6
457
 jmp    @r13
458
 nop
459
 
460
/**********************
461
 XOR.B #imm, @(R0, GBR)
462
 **********************/
463
 mov.l  _pram0, r1
464
 ldc    r1, gbr
465
 
466
 mov    #0xaa, r0
467
 mov.b  r0, @(7, r1)
468
 mov    #7, r0
469
 xor.b  #0x55, @(r0, gbr)
470
 mov.b  @(7, r1), r0
471
 cmp/eq #0xff, r0
472
 bt     .+6
473
 jmp    @r13
474
 nop
475
!----
476
 mov    #0xaa, r0
477
 mov.b  r0, @(7, r1)
478
 mov    #7, r0
479
 xor.b  #0x77, @(r0, gbr)
480
 mov.b  @(7, r1), r0
481
 cmp/eq #0xdd, r0
482
 bt     .+6
483
 jmp    @r13
484
 nop
485
 
486
/**********
487
 TST Rm, Rn
488
 **********/
489
 mov    #0xaa, r2
490
 mov    #0x55, r4
491
 tst    r4, r2
492
 movt   r0
493
 cmp/eq #0x01, r0
494
 bt     .+6
495
 jmp    @r13
496
 nop
497
 
498
 mov    #0xaa, r2
499
 mov    #0x5d, r4
500
 tst    r4, r2
501
 movt   r0
502
 cmp/eq #0x00, r0
503
 bt     .+6
504
 jmp    @r13
505
 nop
506
 
507
/************
508
 TST #imm, R0
509
 ************/
510
 mov    #0xaa, r0
511
 tst    #0x55, r0
512
 movt   r0
513
 cmp/eq #0x01, r0
514
 bt     .+6
515
 jmp    @r13
516
 nop
517
 
518
 mov    #0xaa, r0
519
 tst    #0xd5, r0
520
 movt   r0
521
 cmp/eq #0x00, r0
522
 bt     .+6
523
 jmp    @r13
524
 nop
525
 
526
/**********************
527
 TST.B #imm, @(R0, GBR)
528
 **********************/
529
 mov.l  _pram0, r1
530
 ldc    r1, gbr
531
 
532
 mov    #0xaa, r0
533
 mov.b  r0, @(9, r1)
534
 
535
 mov    #9, r0
536
 clrt
537
 tst.b  #0x55, @(r0, gbr)
538
 bt     .+6
539
 jmp    @r13
540
 nop
541
 
542
 mov    #0xaa, r0
543
 mov.b  r0, @(11, r1)
544
 
545
 mov    #11, r0
546
 sett
547
 tst.b  #0xd5, @(r0, gbr)
548
 bf     .+6
549
 jmp    @r13
550
 nop
551
 
552
/**********
553
 AND Rm, Rn
554
 **********/
555
 mov    #0x00, r0
556
 mov    #0xff, r1
557
 and    r1, r0
558
 cmp/eq #0x00, r0
559
 bt     .+6
560
 jmp    @r13
561
 nop
562
!----
563
 mov    #0xaa, r0
564
 mov    #0x55, r1
565
 and    r1, r0
566
 cmp/eq #0x00, r0
567
 bt     .+6
568
 jmp    @r13
569
 nop
570
!----
571
 mov    #0x7e, r0 !01111110
572
 mov    #0xdb, r1 !11011011
573
 and    r1, r0
574
 cmp/eq #0x5a, r0 !01011010
575
 bt     .+6
576
 jmp    @r13
577
 nop
578
 
579
/************
580
 AND #imm, R0
581
 ************/
582
 mov    #0x00, r0
583
 and    #0xff, r0
584
 cmp/eq #0x00, r0
585
 bt     .+6
586
 jmp    @r13
587
 nop
588
!----
589
 mov    #0xaa, r0
590
 and    #0x55, r0
591
 cmp/eq #0x00, r0
592
 bt     .+6
593
 jmp    @r13
594
 nop
595
!----
596
 mov    #0x7e, r0 !01111110
597
 and    #0xdb, r0 !11011011
598
 cmp/eq #0x5a, r0 !01011010
599
 bt     .+6
600
 jmp    @r13
601
 nop
602
 
603
/**********************
604
 AND.B #imm, @(R0, GBR)
605
 **********************/
606
 mov.l  _pram0, r1
607
 ldc    r1, gbr
608
 
609
 mov    #0x00, r0
610
 mov.b  r0, @(7, r1)
611
 mov    #7, r0
612
 and.b  #0xff, @(r0, gbr)
613
 mov.b  @(7, r1), r0
614
 cmp/eq #0x00, r0
615
 bt     .+6
616
 jmp    @r13
617
 nop
618
!----
619
 mov    #0xaa, r0
620
 mov.b  r0, @(7, r1)
621
 mov    #7, r0
622
 and.b  #0x55, @(r0, gbr)
623
 mov.b  @(7, r1), r0
624
 cmp/eq #0x00, r0
625
 bt     .+6
626
 jmp    @r13
627
 nop
628
!----
629
 mov    #0x7e, r0         !01111110
630
 mov.b  r0, @(7, r1)
631
 mov    #7, r0
632
 and.b  #0xdb, @(r0, gbr) !11011011
633
 mov.b  @(7, r1), r0
634
 cmp/eq #0x5a, r0         !01011010
635
 bt     .+6
636
 jmp    @r13
637
 nop
638
 
639
/*********
640
 OR Rm, Rn
641
 *********/
642
 mov    #0x00, r0
643
 mov    #0xff, r1
644
 or     r1, r0
645
 cmp/eq #0xff, r0
646
 bt     .+6
647
 jmp    @r13
648
 nop
649
!----
650
 mov    #0xaa, r0
651
 mov    #0x55, r1
652
 or     r1, r0
653
 cmp/eq #0xff, r0
654
 bt     .+6
655
 jmp    @r13
656
 nop
657
!----
658
 mov    #0x55, r0 !01010101
659
 mov    #0x5a, r1 !01011010
660
 or     r1, r0
661
 cmp/eq #0x5f, r0 !01011111
662
 bt     .+6
663
 jmp    @r13
664
 nop
665
 
666
/***********
667
 OR #imm, R0
668
 ***********/
669
 mov    #0x00, r0
670
 or     #0xff, r0
671
 mov.w  _p00ff, r2
672
 cmp/eq r2, r0
673
 bt     .+6
674
 jmp    @r13
675
 nop
676
!----
677
 mov    #0xaa, r0
678
 or     #0x55, r0
679
 mov.w  _pffff, r2
680
 cmp/eq r2, r0
681
 bt     .+6
682
 jmp    @r13
683
 nop
684
!----
685
 mov    #0x55, r0 !01010101
686
 or     #0x5a, r0 !01011010
687
 cmp/eq #0x5f, r0 !01011111
688
 bt     .+6
689
 jmp    @r13
690
 nop
691
 
692
/*********************
693
 OR.B #imm, @(R0, GBR)
694
 *********************/
695
 mov.l  _pram0, r1
696
 ldc    r1, gbr
697
 
698
 mov    #0x00, r0
699
 mov.b  r0, @(7, r1)
700
 mov    #7, r0
701
 or.b  #0xff, @(r0, gbr)
702
 mov.b  @(7, r1), r0
703
 cmp/eq #0xff, r0
704
 bt     .+6
705
 jmp    @r13
706
 nop
707
!----
708
 mov    #0xaa, r0
709
 mov.b  r0, @(7, r1)
710
 mov    #7, r0
711
 or.b  #0x55, @(r0, gbr)
712
 mov.b  @(7, r1), r0
713
 cmp/eq #0xff, r0
714
 bt     .+6
715
 jmp    @r13
716
 nop
717
!----
718
 mov    #0x55, r0
719
 mov.b  r0, @(7, r1)
720
 mov    #7, r0
721
 or.b  #0x5a, @(r0, gbr)
722
 mov.b  @(7, r1), r0
723
 cmp/eq #0x5f, r0
724
 bt     .+6
725
 jmp    @r13
726
 nop
727
 
728
/********
729
 CLRT
730
 SETT
731
 MOVT Rn
732
 ********/
733
 sett
734
 movt   r0
735
 cmp/eq #0x01, r0
736
 bt     .+6
737
 jmp    @r13
738
 nop
739
 clrt
740
 movt   r0
741
 cmp/eq #0x00, r0
742
 bt     .+6
743
 jmp    @r13
744
 nop
745
 
746
/**************
747
 Constant Table
748
 **************/
749
 bra    _constantend
750
 nop
751
.align 4
752
_pram0     : .long _ram0
753
_p7fffffff : .long 0x7fffffff
754
_p80000000 : .long 0x80000000
755
_p00112233 : .long 0x00112233
756
_p44556677 : .long 0x44556677
757
_p66770011 : .long 0x66770011
758
_p00113322 : .long 0x00113322
759
_p22330011 : .long 0x22330011
760
.align 2
761
_p00ff: .word 0x00ff
762
_pffff: .word 0xffff
763
.align 2
764
_constantend:
765
 
766
/*********************************************************
767
 Move to another Next ROM area to check hardware operation
768
 *********************************************************/
769
 mov.l _pbranch_table, r13
770
 add r14, r13
771
 mov.l @r13, r12
772
 jmp @r12
773
 add #4, r14
774
.align 4
775
_pbranch_table: .long _branch_table
776
_branch_table:
777
 .long _rom1+_test
778
 .long _rom2+_test
779
 .long _rom3+_test
780
 .long _rom0+_pass
781
 
782
/**************
783
 Congraturation
784
 **************/
785
_pass:
786
 mov.l _ppass_value, r0
787
 mov.l _ppass_value, r1
788
 mov.l r0, @r1
789
 bra   _pass
790
 nop
791
.align 4
792
_ppass_value: .long 0x12345678
793
 
794
/**********
795
 You Failed
796
 **********/
797
_fail:
798
 mov.l _pfail_value, r0
799
 mov.l _pfail_value, r1
800
 bra   _fail
801
 nop
802
.align 4
803
_pfail_value: .long 0x88888888
804
 
805
.end
806
 
807
 

powered by: WebSVN 2.1.0

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