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

Subversion Repositories Aquarius

[/] [Aquarius/] [trunk/] [verification/] [sha_testsource/] [testmulu.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
testmulu.src
5
 
6
Jan.03 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
 MULU.L Rm, Rn
56
 ************************/
57
 mov.l  _ptestvalue1, r1
58
 mov.l  _ptestvalue2, r2
59
 mov    #0xff, r0
60
 lds    r0, mach
61
 
62
 mulu.w r2, r1
63
 mulu.w r1, r2
64
 mulu.w r2, r1
65
 mulu.w r1, r2 !You should check mult contention,here.
66
 
67
_testloop:
68
 mov.l  @r1+, r3
69
 mov.l  @r1+, r4
70
 mov.l  @r1+, r5
71
 mov.l  @r1+, r6
72
 
73
 mulu.w r4, r3
74
 
75
 sts    mach, r3 !You should check mult contention,here.
76
 sts    macl, r4
77
 
78
!----
79
 cmp/eq r5, r3
80
 bt     .+6
81
 jmp    @r13
82
 nop
83
!----
84
 cmp/eq r6, r4
85
 bt     .+6
86
 jmp    @r13
87
 nop
88
!----
89
 cmp/eq r2, r1
90
 bf     _testloop
91
 bra    _testfinish
92
 nop
93
!----
94
 .align 4
95
_ptestvalue1: .long _testvalue1
96
_ptestvalue2: .long _testvalue2
97
 
98
 .align 4
99
_testvalue1:
100
 .long  0xffff0002 !Rn
101
 .long  0xffff0003 !Rm
102
 .long  0xffffffff !MACH
103
 .long  0x00000006 !MACL
104
 
105
 .long  0xffff1234
106
 .long  0x00009abc
107
 .long  0xffffffff
108
 .long  0x0b00a630
109
 
110
 .long  0xffff0001
111
 .long  0x0000ffff
112
 .long  0xffffffff
113
 .long  0x0000ffff
114
 
115
 .long  0x0000ffff
116
 .long  0xffff0001
117
 .long  0xffffffff
118
 .long  0x0000ffff
119
 
120
 .long  0xffff7fff
121
 .long  0x00008000
122
 .long  0xffffffff
123
 .long  0x3fff8000
124
 
125
 .long  0x00008000
126
 .long  0xffff7fff
127
 .long  0xffffffff
128
 .long  0x3fff8000
129
 
130
 .long  0x1234ffff
131
 .long  0x5678ffff
132
 .long  0xffffffff
133
 .long  0xfffe0001
134
 
135
 .long  0x9abc7fff
136
 .long  0x9abc7fff
137
 .long  0xffffffff
138
 .long  0x3fff0001
139
 
140
 .long  0x12348000
141
 .long  0x12348000
142
 .long  0xffffffff
143
 .long  0x40000000
144
_testvalue2:
145
 
146
_testfinish:
147
/*********************************************************
148
 Move to another Next ROM area to check hardware operation
149
 *********************************************************/
150
 mov.l _pbranch_table, r13
151
 add r14, r13
152
 mov.l @r13, r12
153
 jmp @r12
154
 add #4, r14
155
.align 4
156
_pbranch_table: .long _branch_table
157
_branch_table:
158
 .long _rom1+_test
159
 .long _rom2+_test
160
 .long _rom3+_test
161
 .long _rom0+_pass
162
 
163
/**************
164
 Congraturation
165
 **************/
166
_pass:
167
 mov.l _ppass_value, r0
168
 mov.l _ppass_value, r1
169
 mov.l r0, @r1
170
 bra   _pass
171
 nop
172
.align 4
173
_ppass_value: .long 0x12345678
174
 
175
/**********
176
 You Failed
177
 **********/
178
_fail:
179
 mov.l _pfail_value, r0
180
 mov.l _pfail_value, r1
181
 bra   _fail
182
 nop
183
.align 4
184
_pfail_value: .long 0x88888888
185
 
186
.end

powered by: WebSVN 2.1.0

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