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

Subversion Repositories Aquarius

[/] [Aquarius/] [trunk/] [verification/] [sha_testsource/] [testmul.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
testmul.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
 MAC.L @Rm+, @Rn+ : basic
57
 ************************/
58
_macl:
59
 mov    #0, r0
60
 ldc    r0, sr !S=0
61
 mov    #0x02, r0
62
 clrmac
63
 mov.l  _pmacldata1, r1
64
 mov.l  _pmacldata2, r2
65
 mac.l  @r2+, @r1+
66
 ldc    r0, sr !S=1, no effect to MAC operation
67
 sts    mach, r3
68
 sts    macl, r4
69
 mov.l  _pmacldata3, r5
70
 mov.l  @r5+, r6
71
 mov.l  @r5+, r7
72
!----
73
 cmp/eq r6, r3
74
 bt     .+6
75
 jmp    @r13
76
 nop
77
!----
78
 cmp/eq r7, r4
79
 bt     .+6
80
 jmp    @r13
81
 nop
82
!----
83
 mov    #0, r0
84
 ldc    r0, sr !S=0
85
 mac.l  @r2+, @r1+
86
 clrmac !only check clear timing
87
!----
88
 mac.l  @r2+, @r1+
89
 mac.l  @r2+, @r1+
90
 mac.l  @r2+, @r1+
91
 mac.l  @r2+, @r1+
92
 sts    macl, r4
93
 sts    mach, r3
94
 mov.l  @r5+, r6
95
 mov.l  @r5+, r7
96
!----
97
 cmp/eq r6, r3
98
 bt     .+6
99
 jmp    @r13
100
 nop
101
!----
102
 cmp/eq r7, r4
103
 bt     .+6
104
 jmp    @r13
105
 nop
106
!----
107
 bra    _maclend
108
 nop
109
 .align 4
110
_macldata1:
111
 .long 0x01234567 !19088743
112
 .long 0xfffffffd !dummy (-3)
113
 .long 0x00000002
114
 .long 0x00000003
115
 .long 0x00000004
116
 .long 0x00000005
117
_macldata2:
118
 .long 0x89abcdef !-1985229329
119
 .long 0x00000002 !dummy (2)
120
 .long 0x00000006
121
 .long 0x00000007
122
 .long 0x00000008
123
 .long 0x00000009
124
_macldata3:
125
 .long 0xff795e36 !-37895532457343447
126
 .long 0xc94e4629
127
 .long 0x00000000 !(2x6)+(3x7)+(4x8)+(5x9)=12+21+28+45=110
128
 .long 0x0000006e
129
.align 4
130
_pmacldata1: .long _macldata1
131
_pmacldata2: .long _macldata2
132
_pmacldata3: .long _macldata3
133
_maclend:
134
 
135
/***********************************
136
 MAC.L @Rm+, @Rn+ : value dependency
137
 ***********************************/
138
_macl_value:
139
 mov.l _pmaclsbit, r1
140
 mov.l _pmaclinih, r2
141
 mov.l _pmaclinil, r3
142
 mov.l _pmaclval1, r4
143
 mov.l _pmaclval2, r5
144
 mov.l _pmaclmach, r6
145
 mov.l _pmaclmacl, r7
146
 mov.l _pmaclcount, r8
147
 
148
_mac_value1:
149
 mov.l @r1+, r0
150
 ldc   r0, sr
151
 mov.l @r2+, r0
152
 lds   r0, mach
153
 mov.l @r3+, r0
154
 lds   r0, macl
155
 mac.l @r5+, @r4+
156
 sts   mach, r9
157
 sts   macl, r10
158
!----
159
 mov.l @r6+, r0
160
 cmp/eq r0, r9
161
 bt     .+6
162
 jmp    @r13
163
 nop
164
!----
165
 mov.l @r7+, r0
166
 cmp/eq r0, r10
167
 bt     .+6
168
 jmp    @r13
169
 nop
170
!----
171
 add   #-1, r8
172
 cmp/pl r8
173
 bt    _mac_value1
174
!----
175
 bra    _macl_value_end:
176
 nop
177
 
178
 .align 4
179
!-----------------------------
180
! S=0 00000000 x 00000000
181
 
182
! S=0 00000001 x 7fffffff
183
! S=0 7fffffff x 00000001
184
! S=0 ffffffff x 7fffffff
185
! S=0 7fffffff x ffffffff
186
 
187
! S=0 00000001 x 80000000
188
! S=0 80000000 x 00000001
189
! S=0 ffffffff x 80000000
190
! S=0 80000000 x ffffffff
191
 
192
! S=0 7fffffff x 7fffffff
193
! S=0 80000000 x 80000000
194
! S=1 7fffffff x 7fffffff
195
! S=1 80000000 x 80000000
196
 
197
! S=0 7fffffff x 80000000
198
! S=0 80000000 x 7fffffff
199
! S=1 7fffffff x 80000000
200
! S=1 80000000 x 7fffffff
201
 
202
! S=0 00000001 x 00000001 + 00007fff:ffffffff
203
! S=0 00000001 x ffffffff + ffff8000:00000000
204
 
205
! S=1 00000001 x 00000001 + 00007fff:ffffffff
206
! S=1 00000001 x ffffffff + ffff8000:00000000
207
 
208
! S=1 00000001 x 00000001 + 0007ffff:ffffffff
209
! S=1 00000001 x ffffffff + fff80000:00000000
210
 
211
_maclsbit: ! R1
212
 .long 0x00000000 ! S=0
213
 
214
 .long 0x00000000 ! S=0
215
 .long 0x00000000 ! S=0
216
 .long 0x00000000 ! S=0
217
 .long 0x00000000 ! S=0
218
 
219
 .long 0x00000000 ! S=0
220
 .long 0x00000000 ! S=0
221
 .long 0x00000000 ! S=0
222
 .long 0x00000000 ! S=0
223
 
224
 .long 0x00000000 ! S=0
225
 .long 0x00000000 ! S=0
226
 .long 0x00000002 ! S=1
227
 .long 0x00000002 ! S=1
228
 
229
 .long 0x00000000 ! S=0
230
 .long 0x00000000 ! S=0
231
 .long 0x00000002 ! S=1
232
 .long 0x00000002 ! S=1
233
 
234
 .long 0x00000000 ! S=0
235
 .long 0x00000000 ! S=0
236
 
237
 .long 0x00000002 ! S=1
238
 .long 0x00000002 ! S=1
239
 
240
 .long 0x00000002 ! S=1
241
 .long 0x00000002 ! S=1
242
 
243
_maclinih: ! R2
244
 .long 0x00000000
245
 
246
 .long 0x00000000
247
 .long 0x00000000
248
 .long 0x00000000
249
 .long 0x00000000
250
 
251
 .long 0x00000000
252
 .long 0x00000000
253
 .long 0x00000000
254
 .long 0x00000000
255
 
256
 .long 0x00000000
257
 .long 0x00000000
258
 .long 0x00000000
259
 .long 0x00000000
260
 
261
 .long 0x00000000
262
 .long 0x00000000
263
 .long 0x00000000
264
 .long 0x00000000
265
 
266
 .long 0x00007fff
267
 .long 0xffff8000
268
 
269
 .long 0x00007fff
270
 .long 0xffff8000
271
 
272
 .long 0x0007ffff
273
 .long 0xfff80000
274
 
275
_maclinil: ! R3
276
 .long 0x00000000
277
 
278
 .long 0x00000000
279
 .long 0x00000000
280
 .long 0x00000000
281
 .long 0x00000000
282
 
283
 .long 0x00000000
284
 .long 0x00000000
285
 .long 0x00000000
286
 .long 0x00000000
287
 
288
 .long 0x00000000
289
 .long 0x00000000
290
 .long 0x00000000
291
 .long 0x00000000
292
 
293
 .long 0x00000000
294
 .long 0x00000000
295
 .long 0x00000000
296
 .long 0x00000000
297
 
298
 .long 0xffffffff
299
 .long 0x00000000
300
 
301
 .long 0xffffffff
302
 .long 0x00000000
303
 
304
 .long 0xffffffff
305
 .long 0x00000000
306
 
307
_maclval1: ! R4
308
 .long 0x00000000
309
 
310
 .long 0x00000001
311
 .long 0x7fffffff
312
 .long 0xffffffff
313
 .long 0x7fffffff
314
 
315
 .long 0x00000001
316
 .long 0x80000000
317
 .long 0xffffffff
318
 .long 0x80000000
319
 
320
 .long 0x7fffffff
321
 .long 0x80000000
322
 .long 0x7fffffff
323
 .long 0x80000000
324
 
325
 .long 0x7fffffff
326
 .long 0x80000000
327
 .long 0x7fffffff
328
 .long 0x80000000
329
 
330
 .long 0x00000001
331
 .long 0x00000001
332
 
333
 .long 0x00000001
334
 .long 0x00000001
335
 
336
 .long 0x00000001
337
 .long 0x00000001
338
 
339
_maclval2: ! R5
340
 .long 0x00000000
341
 
342
 .long 0x7fffffff
343
 .long 0x00000001
344
 .long 0x7fffffff
345
 .long 0xffffffff
346
 
347
 .long 0x80000000
348
 .long 0x00000001
349
 .long 0x80000000
350
 .long 0xffffffff
351
 
352
 .long 0x7fffffff
353
 .long 0x80000000
354
 .long 0x7fffffff
355
 .long 0x80000000
356
 
357
 .long 0x80000000
358
 .long 0x7fffffff
359
 .long 0x80000000
360
 .long 0x7fffffff
361
 
362
 .long 0x00000001
363
 .long 0xffffffff
364
 
365
 .long 0x00000001
366
 .long 0xffffffff
367
 
368
 .long 0x00000001
369
 .long 0xffffffff
370
 
371
_maclmach: ! R6
372
 .long 0x00000000
373
 
374
 .long 0x00000000
375
 .long 0x00000000
376
 .long 0xffffffff
377
 .long 0xffffffff
378
 
379
 .long 0xffffffff
380
 .long 0xffffffff
381
 .long 0x00000000
382
 .long 0x00000000
383
 
384
 .long 0x3fffffff
385
 .long 0x40000000
386
 .long 0x00007fff
387
 .long 0x00007fff
388
 
389
 .long 0xc0000000
390
 .long 0xc0000000
391
 .long 0xffff8000
392
 .long 0xffff8000
393
 
394
 .long 0x00008000
395
 .long 0xffff7fff
396
 
397
 .long 0x00007fff
398
 .long 0xffff8000
399
 
400
 .long 0x00007fff
401
 .long 0xffff8000
402
 
403
_maclmacl: ! R7
404
 .long 0x00000000
405
 
406
 .long 0x7fffffff
407
 .long 0x7fffffff
408
 .long 0x80000001
409
 .long 0x80000001
410
 
411
 .long 0x80000000
412
 .long 0x80000000
413
 .long 0x80000000
414
 .long 0x80000000
415
 
416
 .long 0x00000001
417
 .long 0x00000000
418
 .long 0xffffffff
419
 .long 0xffffffff
420
 
421
 .long 0x80000000
422
 .long 0x80000000
423
 .long 0x00000000
424
 .long 0x00000000
425
 
426
 .long 0x00000000
427
 .long 0xffffffff
428
 
429
 .long 0xffffffff
430
 .long 0x00000000
431
 
432
 .long 0xffffffff
433
 .long 0x00000000
434
 
435
!-----------------------------
436
.align 4
437
_pmaclsbit: .long _maclsbit
438
_pmaclinih: .long _maclinih
439
_pmaclinil: .long _maclinil
440
_pmaclval1: .long _maclval1
441
_pmaclval2: .long _maclval2
442
_pmaclmach: .long _maclmach
443
_pmaclmacl: .long _maclmacl
444
_pmaclcount: .long (_maclinih - _maclsbit)/4
445
_macl_value_end:
446
 
447
/*********************************************************
448
 Move to another Next ROM area to check hardware operation
449
 *********************************************************/
450
 mov.l _pbranch_table, r13
451
 add r14, r13
452
 mov.l @r13, r12
453
 jmp @r12
454
 add #4, r14
455
.align 4
456
_pbranch_table: .long _branch_table
457
_branch_table:
458
 .long _rom1+_test
459
 .long _rom2+_test
460
 .long _rom3+_test
461
 .long _rom0+_pass
462
 
463
/**************
464
 Congraturation
465
 **************/
466
_pass:
467
 mov.l _ppass_value, r0
468
 mov.l _ppass_value, r1
469
 mov.l r0, @r1
470
 bra   _pass
471
 nop
472
.align 4
473
_ppass_value: .long 0x12345678
474
 
475
/**********
476
 You Failed
477
 **********/
478
_fail:
479
 mov.l _pfail_value, r0
480
 mov.l _pfail_value, r1
481
 bra   _fail
482
 nop
483
.align 4
484
_pfail_value: .long 0x88888888
485
 
486
.end

powered by: WebSVN 2.1.0

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