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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [or1ksim.tests/] [inst-set-test.exp] - Blame information for rev 121

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 107 jeremybenn
# inst-set-test.exp. Tests of ORBIS32 instruction set
2
 
3
# Copyright (C) 2010 Embecosm Limited
4
 
5
# Contributor Jeremy Bennett 
6
 
7
# This file is part of OpenRISC 1000 Architectural Simulator.
8
 
9
# This program is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by the Free
11
# Software Foundation; either version 3 of the License, or (at your option)
12
# any later version.
13
 
14
# This program is distributed in the hope that it will be useful, but WITHOUT
15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
17
# more details.
18
 
19
# You should have received a copy of the GNU General Public License along
20
# with this program.  If not, see .  */
21
 
22
# -----------------------------------------------------------------------------
23
# This code is commented throughout for use with Doxygen.
24
# -----------------------------------------------------------------------------
25
 
26
 
27 112 jeremybenn
# Run the l.add, l.addc, l.addi and l.addic tests
28 115 jeremybenn
run_or1ksim "add-test"                                     \
29 118 jeremybenn
    [list "!  ** OVE flag cleared **"                      \
30
          "!l.add"                                         \
31
          "  0x00000001 + 0x00000002     = 0x00000003: OK" \
32
          "  - carry flag set:      FALSE"                 \
33
          "  - overflow flag set:   FALSE"                 \
34
          "  - exception triggered: FALSE"                 \
35
          "  0x00000001 + 0x00000002 + c = 0x00000003: OK" \
36
          "  - carry flag set:      FALSE"                 \
37
          "  - overflow flag set:   FALSE"                 \
38
          "  - exception triggered: FALSE"                 \
39
          "  0xffffffff + 0xfffffffe     = 0xfffffffd: OK" \
40
          "  - carry flag set:      TRUE"                  \
41
          "  - overflow flag set:   FALSE"                 \
42
          "  - exception triggered: FALSE"                 \
43
          "  0x40000000 + 0x3fffffff     = 0x7fffffff: OK" \
44
          "  - carry flag set:      FALSE"                 \
45
          "  - overflow flag set:   FALSE"                 \
46
          "  - exception triggered: FALSE"                 \
47
          "  0x40000000 + 0x40000000     = 0x80000000: OK" \
48
          "  - carry flag set:      FALSE"                 \
49
          "  - overflow flag set:   TRUE"                  \
50
          "  - exception triggered: FALSE"                 \
51
          "  0xc0000000 + 0xc0000000     = 0x80000000: OK" \
52
          "  - carry flag set:      TRUE"                  \
53
          "  - overflow flag set:   FALSE"                 \
54
          "  - exception triggered: FALSE"                 \
55
          "  0xbfffffff + 0xbfffffff     = 0x7ffffffe: OK" \
56
          "  - carry flag set:      TRUE"                  \
57
          "  - overflow flag set:   TRUE"                  \
58
          "  - exception triggered: FALSE"                 \
59 114 jeremybenn
          "!  ** OVE flag set **"                          \
60
          "  RANGE exception"                              \
61 118 jeremybenn
          "  0x40000000 + 0x40000000     = 0x80000000: OK" \
62
          "  - carry flag set:      FALSE"                 \
63
          "  - overflow flag set:   TRUE"                  \
64
          "  - exception triggered: TRUE"                  \
65
          "  0xffffffff + 0xfffffffe     = 0xfffffffd: OK" \
66
          "  - carry flag set:      TRUE"                  \
67
          "  - overflow flag set:   FALSE"                 \
68
          "  - exception triggered: FALSE"                 \
69 114 jeremybenn
          "  RANGE exception"                              \
70 118 jeremybenn
          "  0xbfffffff + 0xbfffffff     = 0x7ffffffe: OK" \
71
          "  - carry flag set:      TRUE"                  \
72
          "  - overflow flag set:   TRUE"                  \
73
          "  - exception triggered: TRUE"                  \
74 114 jeremybenn
          "!  ** OVE flag cleared **"                      \
75 118 jeremybenn
          "l.addc"                                         \
76 114 jeremybenn
          "  0x00000001 + 0x00000002     = 0x00000003: OK" \
77 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
78
          "  - overflow flag set:   FALSE"                 \
79
          "  - exception triggered: FALSE"                 \
80 114 jeremybenn
          "  0xffffffff + 0xfffffffe     = 0xfffffffd: OK" \
81 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
82
          "  - overflow flag set:   FALSE"                 \
83
          "  - exception triggered: FALSE"                 \
84 114 jeremybenn
          "  0x40000000 + 0x3fffffff     = 0x7fffffff: OK" \
85 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
86
          "  - overflow flag set:   FALSE"                 \
87
          "  - exception triggered: FALSE"                 \
88 114 jeremybenn
          "  0x40000000 + 0x3fffffff + c = 0x80000000: OK" \
89 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
90
          "  - overflow flag set:   TRUE"                  \
91
          "  - exception triggered: FALSE"                 \
92 114 jeremybenn
          "  0x40000000 + 0x40000000     = 0x80000000: OK" \
93 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
94
          "  - overflow flag set:   TRUE"                  \
95
          "  - exception triggered: FALSE"                 \
96 114 jeremybenn
          "  0xffffffff + 0x00000000 + c = 0x00000000: OK" \
97 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
98
          "  - overflow flag set:   FALSE"                 \
99
          "  - exception triggered: FALSE"                 \
100 114 jeremybenn
          "  0x00000000 + 0xffffffff + c = 0x00000000: OK" \
101 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
102
          "  - overflow flag set:   FALSE"                 \
103
          "  - exception triggered: FALSE"                 \
104 114 jeremybenn
          "  0xc0000000 + 0xc0000000     = 0x80000000: OK" \
105 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
106
          "  - overflow flag set:   FALSE"                 \
107
          "  - exception triggered: FALSE"                 \
108 114 jeremybenn
          "  0xc0000000 + 0xbfffffff + c = 0x80000000: OK" \
109 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
110
          "  - overflow flag set:   FALSE"                 \
111
          "  - exception triggered: FALSE"                 \
112 114 jeremybenn
          "  0xbfffffff + 0xbfffffff     = 0x7ffffffe: OK" \
113 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
114
          "  - overflow flag set:   TRUE"                  \
115
          "  - exception triggered: FALSE"                 \
116 114 jeremybenn
          "!  ** OVE flag set **"                          \
117
          "  RANGE exception"                              \
118
          "  0x40000000 + 0x40000000     = 0x80000000: OK" \
119 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
120
          "  - overflow flag set:   TRUE"                  \
121
          "  - exception triggered: TRUE"                  \
122 114 jeremybenn
          "  RANGE exception"                              \
123
          "  0x40000000 + 0x3fffffff + c = 0x80000000: OK" \
124 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
125
          "  - overflow flag set:   TRUE"                  \
126
          "  - exception triggered: TRUE"                  \
127 114 jeremybenn
          "  0xffffffff + 0xfffffffe     = 0xfffffffd: OK" \
128 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
129
          "  - overflow flag set:   FALSE"                 \
130
          "  - exception triggered: FALSE"                 \
131 114 jeremybenn
          "  0x00000000 + 0xffffffff + c = 0x00000000: OK" \
132 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
133
          "  - overflow flag set:   FALSE"                 \
134
          "  - exception triggered: FALSE"                 \
135 114 jeremybenn
          "  RANGE exception"                              \
136
          "  0xbfffffff + 0xbfffffff     = 0x7ffffffe: OK" \
137 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
138
          "  - overflow flag set:   TRUE"                  \
139
          "  - exception triggered: TRUE"                  \
140 114 jeremybenn
          "!  ** OVE flag cleared **"                      \
141 118 jeremybenn
          "l.addi"                                         \
142
          "  0x00000001 + 0x00000002     = 0x00000003: OK" \
143
          "  - carry flag set:      FALSE"                 \
144
          "  - overflow flag set:   FALSE"                 \
145
          "  - exception triggered: FALSE"                 \
146
          "  0x00000001 + 0x00000002 + c = 0x00000003: OK" \
147
          "  - carry flag set:      FALSE"                 \
148
          "  - overflow flag set:   FALSE"                 \
149
          "  - exception triggered: FALSE"                 \
150
          "  0xffffffff + 0x0000fffe     = 0xfffffffd: OK" \
151
          "  - carry flag set:      TRUE"                  \
152
          "  - overflow flag set:   FALSE"                 \
153
          "  - exception triggered: FALSE"                 \
154
          "  0x7fff8000 + 0x00007fff     = 0x7fffffff: OK" \
155
          "  - carry flag set:      FALSE"                 \
156
          "  - overflow flag set:   FALSE"                 \
157
          "  - exception triggered: FALSE"                 \
158
          "  0x7fffc000 + 0x00004000     = 0x80000000: OK" \
159
          "  - carry flag set:      FALSE"                 \
160
          "  - overflow flag set:   TRUE"                  \
161
          "  - exception triggered: FALSE"                 \
162
          "  0x80008000 + 0x00008000     = 0x80000000: OK" \
163
          "  - carry flag set:      TRUE"                  \
164
          "  - overflow flag set:   FALSE"                 \
165
          "  - exception triggered: FALSE"                 \
166
          "  0x80007fff + 0x00008000     = 0x7fffffff: OK" \
167
          "  - carry flag set:      TRUE"                  \
168
          "  - overflow flag set:   TRUE"                  \
169
          "  - exception triggered: FALSE"                 \
170 114 jeremybenn
          "!  ** OVE flag set **"                          \
171
          "  RANGE exception"                              \
172 118 jeremybenn
          "  0x7fffc000 + 0x00004000     = 0x80000000: OK" \
173
          "  - carry flag set:      FALSE"                 \
174
          "  - overflow flag set:   TRUE"                  \
175
          "  - exception triggered: TRUE"                  \
176
          "  0xffffffff + 0x0000fffe     = 0xfffffffd: OK" \
177
          "  - carry flag set:      TRUE"                  \
178
          "  - overflow flag set:   FALSE"                 \
179
          "  - exception triggered: FALSE"                 \
180 114 jeremybenn
          "  RANGE exception"                              \
181 118 jeremybenn
          "  0x80007fff + 0x00008000     = 0x7fffffff: OK" \
182
          "  - carry flag set:      TRUE"                  \
183
          "  - overflow flag set:   TRUE"                  \
184
          "  - exception triggered: TRUE"                  \
185 114 jeremybenn
          "!  ** OVE flag cleared **"                      \
186 118 jeremybenn
          "l.addic"                                        \
187 114 jeremybenn
          "  0x00000001 + 0x00000002     = 0x00000003: OK" \
188 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
189
          "  - overflow flag set:   FALSE"                 \
190
          "  - exception triggered: FALSE"                 \
191
          "  0xffffffff + 0x0000fffe     = 0xfffffffd: OK" \
192
          "  - carry flag set:      TRUE"                  \
193
          "  - overflow flag set:   FALSE"                 \
194
          "  - exception triggered: FALSE"                 \
195 114 jeremybenn
          "  0x7fff8000 + 0x00007fff     = 0x7fffffff: OK" \
196 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
197
          "  - overflow flag set:   FALSE"                 \
198
          "  - exception triggered: FALSE"                 \
199 114 jeremybenn
          "  0x7fff8000 + 0x00007fff + c = 0x80000000: OK" \
200 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
201
          "  - overflow flag set:   TRUE"                  \
202
          "  - exception triggered: FALSE"                 \
203 114 jeremybenn
          "  0x7fffc000 + 0x00004000     = 0x80000000: OK" \
204 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
205
          "  - overflow flag set:   TRUE"                  \
206
          "  - exception triggered: FALSE"                 \
207 114 jeremybenn
          "  0xffffffff + 0x00000000 + c = 0x00000000: OK" \
208 118 jeremybenn
          "  - carry flag set:      TRUE"                  \
209
          "  - overflow flag set:   FALSE"                 \
210
          "  - exception triggered: FALSE"                 \
211
          "  0x00000000 + 0x0000ffff + c = 0x00000000: OK" \
212
          "  - carry flag set:      TRUE"                  \
213
          "  - overflow flag set:   FALSE"                 \
214
          "  - exception triggered: FALSE"                 \
215
          "  0x80008000 + 0x00008000     = 0x80000000: OK" \
216
          "  - carry flag set:      TRUE"                  \
217
          "  - overflow flag set:   FALSE"                 \
218
          "  - exception triggered: FALSE"                 \
219
          "  0x80007fff + 0x00008000 + c = 0x80000000: OK" \
220
          "  - carry flag set:      TRUE"                  \
221
          "  - overflow flag set:   FALSE"                 \
222
          "  - exception triggered: FALSE"                 \
223
          "  0x80007fff + 0x00008000     = 0x7fffffff: OK" \
224
          "  - carry flag set:      TRUE"                  \
225
          "  - overflow flag set:   TRUE"                  \
226
          "  - exception triggered: FALSE"                 \
227 114 jeremybenn
          "!  ** OVE flag set **"                          \
228
          "  RANGE exception"                              \
229
          "  0x7fffc000 + 0x00004000     = 0x80000000: OK" \
230 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
231
          "  - overflow flag set:   TRUE"                  \
232
          "  - exception triggered: TRUE"                  \
233 114 jeremybenn
          "  RANGE exception"                              \
234
          "  0x7fffc000 + 0x00003fff + c = 0x80000000: OK" \
235 118 jeremybenn
          "  - carry flag set:      FALSE"                 \
236
          "  - overflow flag set:   TRUE"                  \
237
          "  - exception triggered: TRUE"                  \
238
          "  0xffffffff + 0x0000fffe     = 0xfffffffd: OK" \
239
          "  - carry flag set:      TRUE"                  \
240
          "  - overflow flag set:   FALSE"                 \
241
          "  - exception triggered: FALSE"                 \
242
          "  0x00000000 + 0x0000ffff + c = 0x00000000: OK" \
243
          "  - carry flag set:      TRUE"                  \
244
          "  - overflow flag set:   FALSE"                 \
245
          "  - exception triggered: FALSE"                 \
246 114 jeremybenn
          "  RANGE exception"                              \
247 118 jeremybenn
          "  0x80007fff + 0x00008000     = 0x7fffffff: OK" \
248
          "  - carry flag set:      TRUE"                  \
249
          "  - overflow flag set:   TRUE"                  \
250
          "  - exception triggered: TRUE"                  \
251 114 jeremybenn
          "!  ** OVE flag cleared **"                      \
252
          "!Test completed"                                \
253
          "!report(0xdeaddead);"                           \
254
          "!exit(0)"]                                      \
255 112 jeremybenn
    "inst-set-test.cfg" "inst-set-test/is-add-test"
256 115 jeremybenn
 
257
# Run the l.div and l.divu test
258 118 jeremybenn
run_or1ksim "div-test"                                 \
259
    [list "!l.div"                                     \
260
          "  0x0000000c / 0x00000003 = 0x00000004: OK" \
261
          "  - carry flag set:      FALSE"             \
262
          "  - overflow flag set:   FALSE"             \
263
          "  - exception triggered: FALSE"             \
264
          "  0x0000000b / 0x00000003 = 0x00000003: OK" \
265
          "  - carry flag set:      FALSE"             \
266
          "  - overflow flag set:   FALSE"             \
267
          "  - exception triggered: FALSE"             \
268
          "  0xfffffff4 / 0xfffffffd = 0x00000004: OK" \
269
          "  - carry flag set:      FALSE"             \
270
          "  - overflow flag set:   FALSE"             \
271
          "  - exception triggered: FALSE"             \
272
          "  0xfffffff5 / 0xfffffffd = 0x00000003: OK" \
273
          "  - carry flag set:      FALSE"             \
274
          "  - overflow flag set:   FALSE"             \
275
          "  - exception triggered: FALSE"             \
276
          "  0xfffffff4 / 0x00000003 = 0xfffffffc: OK" \
277
          "  - carry flag set:      FALSE"             \
278
          "  - overflow flag set:   FALSE"             \
279
          "  - exception triggered: FALSE"             \
280
          "  0xfffffff5 / 0x00000003 = 0xfffffffd: OK" \
281
          "  - carry flag set:      FALSE"             \
282
          "  - overflow flag set:   FALSE"             \
283
          "  - exception triggered: FALSE"             \
284
          "  0x0000000c / 0xfffffffd = 0xfffffffc: OK" \
285
          "  - carry flag set:      FALSE"             \
286
          "  - overflow flag set:   FALSE"             \
287
          "  - exception triggered: FALSE"             \
288
          "  0x0000000b / 0xfffffffd = 0xfffffffd: OK" \
289
          "  - carry flag set:      FALSE"             \
290
          "  - overflow flag set:   FALSE"             \
291
          "  - exception triggered: FALSE"             \
292
          "  0x0000000c / 0x00000000 = 0x00000000: OK" \
293
          "  - carry flag set:      TRUE"              \
294
          "  - overflow flag set:   FALSE"             \
295
          "  - exception triggered: FALSE"             \
296
          "  0xfffffff4 / 0x00000000 = 0x00000000: OK" \
297
          "  - carry flag set:      TRUE"              \
298
          "  - overflow flag set:   FALSE"             \
299
          "  - exception triggered: FALSE"             \
300
          "!  ** OVE flag set **"                      \
301
          "  RANGE exception"                          \
302
          "  0x0000000c / 0x00000000 = 0x00000000: OK" \
303
          "  - carry flag set:      TRUE"              \
304
          "  - overflow flag set:   FALSE"             \
305
          "  - exception triggered: TRUE"              \
306
          "  RANGE exception"                          \
307
          "  0xfffffff4 / 0x00000000 = 0x00000000: OK" \
308
          "  - carry flag set:      TRUE"              \
309
          "  - overflow flag set:   FALSE"             \
310
          "  - exception triggered: TRUE"              \
311
          "!  ** OVE flag cleared **"                  \
312
          "l.divu"                                     \
313
          "  0x0000000c / 0x00000003 = 0x00000004: OK" \
314
          "  - carry flag set:      FALSE"             \
315
          "  - overflow flag set:   FALSE"             \
316
          "  - exception triggered: FALSE"             \
317
          "  0x0000000b / 0x00000003 = 0x00000003: OK" \
318
          "  - carry flag set:      FALSE"             \
319
          "  - overflow flag set:   FALSE"             \
320
          "  - exception triggered: FALSE"             \
321
          "  0xfffffff4 / 0xfffffffd = 0x00000000: OK" \
322
          "  - carry flag set:      FALSE"             \
323
          "  - overflow flag set:   FALSE"             \
324
          "  - exception triggered: FALSE"             \
325
          "  0xfffffff5 / 0xfffffffd = 0x00000000: OK" \
326
          "  - carry flag set:      FALSE"             \
327
          "  - overflow flag set:   FALSE"             \
328
          "  - exception triggered: FALSE"             \
329
          "  0xfffffff4 / 0x00000003 = 0x55555551: OK" \
330
          "  - carry flag set:      FALSE"             \
331
          "  - overflow flag set:   FALSE"             \
332
          "  - exception triggered: FALSE"             \
333
          "  0xfffffff5 / 0x00000003 = 0x55555551: OK" \
334
          "  - carry flag set:      FALSE"             \
335
          "  - overflow flag set:   FALSE"             \
336
          "  - exception triggered: FALSE"             \
337
          "  0x0000000c / 0xfffffffd = 0x00000000: OK" \
338
          "  - carry flag set:      FALSE"             \
339
          "  - overflow flag set:   FALSE"             \
340
          "  - exception triggered: FALSE"             \
341
          "  0x0000000b / 0xfffffffd = 0x00000000: OK" \
342
          "  - carry flag set:      FALSE"             \
343
          "  - overflow flag set:   FALSE"             \
344
          "  - exception triggered: FALSE"             \
345
          "  0x0000000c / 0x00000000 = 0x00000000: OK" \
346
          "  - carry flag set:      TRUE"              \
347
          "  - overflow flag set:   FALSE"             \
348
          "  - exception triggered: FALSE"             \
349
          "  0xfffffff4 / 0x00000000 = 0x00000000: OK" \
350
          "  - carry flag set:      TRUE"              \
351
          "  - overflow flag set:   FALSE"             \
352
          "  - exception triggered: FALSE"             \
353
          "!  ** OVE flag set **"                      \
354
          "  RANGE exception"                          \
355
          "  0x0000000c / 0x00000000 = 0x00000000: OK" \
356
          "  - carry flag set:      TRUE"              \
357
          "  - overflow flag set:   FALSE"             \
358
          "  - exception triggered: TRUE"              \
359
          "  RANGE exception"                          \
360
          "  0xfffffff4 / 0x00000000 = 0x00000000: OK" \
361
          "  - carry flag set:      TRUE"              \
362
          "  - overflow flag set:   FALSE"             \
363
          "  - exception triggered: TRUE"              \
364
          "!  ** OVE flag cleared **"                  \
365
          "!Test completed"                            \
366
          "!report(0xdeaddead);"                       \
367
          "!exit(0)"]                                  \
368 115 jeremybenn
    "inst-set-test.cfg" "inst-set-test/is-div-test"
369
 
370
# Run the l.ff1 and l.fl1 test
371
run_or1ksim "find-test"                 \
372
    [list "!l.ff1"                      \
373 118 jeremybenn
          "  ff1 (0x00000001) = 0x01: OK" \
374
          "  ff1 (0x80000000) = 0x20: OK" \
375
          "  ff1 (0x55555555) = 0x01: OK" \
376
          "  ff1 (0xaaaaaaaa) = 0x02: OK" \
377
          "  ff1 (0x00018000) = 0x10: OK" \
378
          "  ff1 (0xc0000000) = 0x1f: OK" \
379
          "  ff1 (0x00000000) = 0x00: OK" \
380 115 jeremybenn
          "!l.fl1"                      \
381 118 jeremybenn
          "  fl1 (0x00000001) = 0x01: OK" \
382
          "  fl1 (0x80000000) = 0x20: OK" \
383
          "  fl1 (0x55555555) = 0x1f: OK" \
384
          "  fl1 (0xaaaaaaaa) = 0x20: OK" \
385
          "  fl1 (0x00018000) = 0x11: OK" \
386
          "  fl1 (0xc0000000) = 0x20: OK" \
387
          "  fl1 (0x00000000) = 0x00: OK" \
388 115 jeremybenn
          "!Test completed"             \
389
          "!report(0xdeaddead);"        \
390
          "!exit(0)"]                   \
391
    "inst-set-test.cfg" "inst-set-test/is-find-test"
392
 
393 121 jeremybenn
# Run the l.jalf and l.jr test
394
run_or1ksim "jump-test"                                     \
395
    [list "!l.jalr"                                         \
396
          "  Jump to 0x000010dc using register 0x05 OK"     \
397
          "  - exception triggered: FALSE"                  \
398
          "  ALIGNMENT exception"                           \
399
          "  Jump to 0x000012b9 using register 0x05 failed" \
400
          "  - exception triggered: TRUE"                   \
401
          "  ALIGNMENT exception"                           \
402
          "  Jump to 0x00001496 using register 0x05 failed" \
403
          "  - exception triggered: TRUE"                   \
404
          "  ALIGNMENT exception"                           \
405
          "  Jump to 0x00001673 using register 0x05 failed" \
406
          "  - exception triggered: TRUE"                   \
407
          "  ILLEGAL INSTRUCTION exception"                 \
408
          "  Jump to 0x0000184c using register 0x09 failed" \
409
          "  - exception triggered: TRUE"                   \
410
          "!l.jr"                                           \
411
          "  Jump to 0x00001a38 using register 0x05 OK"     \
412
          "  - exception triggered: FALSE"                  \
413
          "  ALIGNMENT exception"                           \
414
          "  Jump to 0x00001c15 using register 0x05 failed" \
415
          "  - exception triggered: TRUE"                   \
416
          "  ALIGNMENT exception"                           \
417
          "  Jump to 0x00001df2 using register 0x05 failed" \
418
          "  - exception triggered: TRUE"                   \
419
          "  ALIGNMENT exception"                           \
420
          "  Jump to 0x00001fcf using register 0x05 failed" \
421
          "  - exception triggered: TRUE"                   \
422
          "  Jump to 0x000021a8 using register 0x09 OK"     \
423
          "  - exception triggered: FALSE"                  \
424
          "!Test completed"                                 \
425
          "!report(0xdeaddead);"                            \
426
          "!exit(0)"]                                       \
427
    "inst-set-test.cfg" "inst-set-test/is-jump-test"
428
 
429 115 jeremybenn
# Run the l.lws test
430
run_or1ksim "lws-test"                            \
431
    [list "!l.lws"                                \
432
          "   l.lws r4,0(r5): r4=0xdeadbeef:  OK" \
433
          "   l.lws r4,0(r5): r4=0x00000000:  OK" \
434
          "   l.lws r4,0(r5): r4=0x7fffffff:  OK" \
435
          "   l.lws r4,0(r5): r4=0x80000000:  OK" \
436
          "   l.lws r4,0(r5): r4=0xffffffff:  OK" \
437
          "   l.lws r4,0(r5): r4=0x00000000:  OK" \
438
          "   l.lws r4,0(r5): r4=0x7fffffff:  OK" \
439
          "   l.lws r4,0(r5): r4=0x80000000:  OK" \
440
          "   l.lws r4,0(r5): r4=0xffffffff:  OK" \
441
          "   l.lws r4,0(r5): r4=0xdeadbeef:  OK" \
442
          "   l.lws r4,0(r5): r4=0x00000000:  OK" \
443
          "   l.lws r4,0(r5): r4=0x7fffffff:  OK" \
444
          "   l.lws r4,0(r5): r4=0x80000000:  OK" \
445
          "!Test completed"                       \
446
          "!report(0xdeaddead);"                  \
447
          "!exit(0)"]                             \
448
    "inst-set-test.cfg" "inst-set-test/is-lws-test"
449 116 jeremybenn
 
450
# Run the l.mac test
451
run_or1ksim "mac-test"                            \
452
    [list "!l.mac"                                \
453
  "  0x00000000 00000000 + 0x00000002 * 0x00000003 = 0x00000000 00000006: OK" \
454
  "  0x00000000 00000006 + 0x00000002 * 0x00000003 = 0x00000000 0000000c: OK" \
455
  "  0x00000000 fffffffa + 0x00000002 * 0x00000003 = 0x00000001 00000000: OK" \
456
  "  0x3fffffff fffffffa + 0x00000002 * 0x00000003 = 0x40000000 00000000: OK" \
457
  "  0xffffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000 00000000: OK" \
458
  "  0xffffffff 00000000 + 0x00000002 * 0x00000003 = 0xffffffff 00000006: OK" \
459
  "  0x80000000 00000000 + 0x00000002 * 0x00000003 = 0x80000000 00000006: OK" \
460
  "!" \
461
  "  0x00000000 00000000 + 0x00008001 * 0x0000fffe = 0x00000000 7ffffffe: OK" \
462
  "  0x00000000 00000002 + 0x00008001 * 0x0000fffe = 0x00000000 80000000: OK" \
463
  "  0x00000000 80000002 + 0x00008001 * 0x0000fffe = 0x00000001 00000000: OK" \
464
  "  0x7fffffff 80000001 + 0x00008001 * 0x0000fffe = 0x7fffffff ffffffff: OK" \
465
  "  0xffffffff ffffffff + 0x00008001 * 0x0000fffe = 0x00000000 7ffffffd: OK" \
466
  "  0xffffffff 80000002 + 0x00008001 * 0x0000fffe = 0x00000000 00000000: OK" \
467
  "  0xfffffffe 80000002 + 0x00008001 * 0x0000fffe = 0xffffffff 00000000: OK" \
468
  "!" \
469
  "  0x00000000 00000000 + 0xfffffffe * 0xfffffffd = 0x00000000 00000006: OK" \
470
  "  0x00000000 00000006 + 0xfffffffe * 0xfffffffd = 0x00000000 0000000c: OK" \
471
  "  0xffffffff ffffffff + 0xfffffffe * 0xfffffffd = 0x00000000 00000005: OK" \
472
  "!" \
473
  "  0x00000000 00000000 + 0x00000002 * 0xfffffffd = 0xffffffff fffffffa: OK" \
474
  "  0x00000000 0000000c + 0x00000002 * 0xfffffffd = 0x00000000 00000006: OK" \
475
  "  0x00000001 00000005 + 0x00000002 * 0xfffffffd = 0x00000000 ffffffff: OK" \
476
  "  0x7fffffff ffffffff + 0x00000002 * 0xfffffffd = 0x7fffffff fffffff9: OK" \
477
  "  0xffffffff ffffffff + 0x00000002 * 0xfffffffd = 0xffffffff fffffff9: OK" \
478
  "  0xffffffff 00000005 + 0x00000002 * 0xfffffffd = 0xfffffffe ffffffff: OK" \
479
  "  0x80000000 00000006 + 0x00000002 * 0xfffffffd = 0x80000000 00000000: OK" \
480
  "!" \
481
  "  0x00000000 00000000 + 0x00008000 * 0xffff0000 = 0xffffffff 80000000: OK" \
482
  "  0x00000000 00000006 + 0x00008000 * 0xffff0000 = 0xffffffff 80000006: OK" \
483
  "  0x00000000 80000000 + 0x00008000 * 0xffff0000 = 0x00000000 00000000: OK" \
484
  "  0x7fffffff ffffffff + 0x00008000 * 0xffff0000 = 0x7fffffff 7fffffff: OK" \
485
  "  0xffffffff ffffffff + 0x00008000 * 0xffff0000 = 0xffffffff 7fffffff: OK" \
486
  "  0xffffffff 7fffffff + 0x00008000 * 0xffff0000 = 0xfffffffe ffffffff: OK" \
487
  "  0x80000000 80000000 + 0x00008000 * 0xffff0000 = 0x80000000 00000000: OK" \
488
  "!" \
489
  "l.maci" \
490
  "  0x00000000 00000000 + 0x00000002 * 0x00000003 = 0x00000000 00000006: OK" \
491
  "  0x00000000 00000006 + 0x00000002 * 0x00000003 = 0x00000000 0000000c: OK" \
492
  "  0x00000000 fffffffa + 0x00000002 * 0x00000003 = 0x00000001 00000000: OK" \
493
  "  0x3fffffff fffffffa + 0x00000002 * 0x00000003 = 0x40000000 00000000: OK" \
494
  "  0xffffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000 00000000: OK" \
495
  "  0xffffffff 00000000 + 0x00000002 * 0x00000003 = 0xffffffff 00000006: OK" \
496
  "  0x80000000 00000000 + 0x00000002 * 0x00000003 = 0x80000000 00000006: OK" \
497
  "!" \
498
  "  0x00000000 00000000 + 0x00010002 * 0x00007fff = 0x00000000 7ffffffe: OK" \
499
  "  0x00000000 00000002 + 0x00010002 * 0x00007fff = 0x00000000 80000000: OK" \
500
  "  0x00000000 80000002 + 0x00010002 * 0x00007fff = 0x00000001 00000000: OK" \
501
  "  0x7fffffff 80000001 + 0x00010002 * 0x00007fff = 0x7fffffff ffffffff: OK" \
502
  "  0xffffffff ffffffff + 0x00010002 * 0x00007fff = 0x00000000 7ffffffd: OK" \
503
  "  0xffffffff 80000002 + 0x00010002 * 0x00007fff = 0x00000000 00000000: OK" \
504
  "  0xfffffffe 80000002 + 0x00010002 * 0x00007fff = 0xffffffff 00000000: OK" \
505
  "!" \
506
  "  0x00000000 00000000 + 0xfffffffe * 0x0000fffd = 0x00000000 00000006: OK" \
507
  "  0x00000000 00000006 + 0xfffffffe * 0x0000fffd = 0x00000000 0000000c: OK" \
508
  "  0xffffffff ffffffff + 0xfffffffe * 0x0000fffd = 0x00000000 00000005: OK" \
509
  "!" \
510
  "  0x00000000 00000000 + 0x00000002 * 0x0000fffd = 0xffffffff fffffffa: OK" \
511
  "  0x00000000 0000000c + 0x00000002 * 0x0000fffd = 0x00000000 00000006: OK" \
512
  "  0x00000001 00000005 + 0x00000002 * 0x0000fffd = 0x00000000 ffffffff: OK" \
513
  "  0x7fffffff ffffffff + 0x00000002 * 0x0000fffd = 0x7fffffff fffffff9: OK" \
514
  "  0xffffffff ffffffff + 0x00000002 * 0x0000fffd = 0xffffffff fffffff9: OK" \
515
  "  0xffffffff 00000005 + 0x00000002 * 0x0000fffd = 0xfffffffe ffffffff: OK" \
516
  "  0x80000000 00000006 + 0x00000002 * 0x0000fffd = 0x80000000 00000000: OK" \
517
  "!" \
518
  "  0x00000000 00000000 + 0x00010000 * 0x00008000 = 0xffffffff 80000000: OK" \
519
  "  0x00000000 00000006 + 0x00010000 * 0x00008000 = 0xffffffff 80000006: OK" \
520
  "  0x00000000 80000000 + 0x00010000 * 0x00008000 = 0x00000000 00000000: OK" \
521
  "  0x7fffffff ffffffff + 0x00010000 * 0x00008000 = 0x7fffffff 7fffffff: OK" \
522
  "  0xffffffff ffffffff + 0x00010000 * 0x00008000 = 0xffffffff 7fffffff: OK" \
523
  "  0xffffffff 7fffffff + 0x00010000 * 0x00008000 = 0xfffffffe ffffffff: OK" \
524
  "  0x80000000 80000000 + 0x00010000 * 0x00008000 = 0x80000000 00000000: OK" \
525
  "!" \
526
  "l.macrc" \
527
  "  0x00000000 00000000 + 0x00000002 * 0x00000003 = 0x00000006:   OK" \
528
  "  - MACHI cleared" \
529
  "  - MACLO cleared" \
530
  "  0x00000000 00000006 + 0x00000002 * 0x00000003 = 0x0000000c:   OK" \
531
  "  - MACHI cleared" \
532
  "  - MACLO cleared" \
533
  "  0x00000000 fffffffa + 0x00000002 * 0x00000003 = 0x00000000:   OK" \
534
  "  - MACHI cleared" \
535
  "  - MACLO cleared" \
536
  "  0x3fffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000:   OK" \
537
  "  - MACHI cleared" \
538
  "  - MACLO cleared" \
539
  "  0xffffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000:   OK" \
540
  "  - MACHI cleared" \
541
  "  - MACLO cleared" \
542
  "  0xffffffff 00000000 + 0x00000002 * 0x00000003 = 0x00000006:   OK" \
543
  "  - MACHI cleared" \
544
  "  - MACLO cleared" \
545
  "  0x80000000 00000000 + 0x00000002 * 0x00000003 = 0x00000006:   OK" \
546
  "  - MACHI cleared" \
547
  "  - MACLO cleared" \
548
  "!" \
549
  "  0x00000000 00000000 + 0x00008001 * 0x0000fffe = 0x7ffffffe:   OK" \
550
  "  - MACHI cleared" \
551
  "  - MACLO cleared" \
552
  "  0x00000000 00000002 + 0x00008001 * 0x0000fffe = 0x80000000:   OK" \
553
  "  - MACHI cleared" \
554
  "  - MACLO cleared" \
555
  "  0x00000000 80000002 + 0x00008001 * 0x0000fffe = 0x00000000:   OK" \
556
  "  - MACHI cleared" \
557
  "  - MACLO cleared" \
558
  "  0x7fffffff 80000001 + 0x00008001 * 0x0000fffe = 0xffffffff:   OK" \
559
  "  - MACHI cleared" \
560
  "  - MACLO cleared" \
561
  "  0xffffffff ffffffff + 0x00008001 * 0x0000fffe = 0x7ffffffd:   OK" \
562
  "  - MACHI cleared" \
563
  "  - MACLO cleared" \
564
  "  0xffffffff 80000002 + 0x00008001 * 0x0000fffe = 0x00000000:   OK" \
565
  "  - MACHI cleared" \
566
  "  - MACLO cleared" \
567
  "  0xfffffffe 80000002 + 0x00008001 * 0x0000fffe = 0x00000000:   OK" \
568
  "  - MACHI cleared" \
569
  "  - MACLO cleared" \
570
  "!" \
571
  "  0x00000000 00000000 + 0xfffffffe * 0xfffffffd = 0x00000006:   OK" \
572
  "  - MACHI cleared" \
573
  "  - MACLO cleared" \
574
  "  0x00000000 00000006 + 0xfffffffe * 0xfffffffd = 0x0000000c:   OK" \
575
  "  - MACHI cleared" \
576
  "  - MACLO cleared" \
577
  "  0xffffffff ffffffff + 0xfffffffe * 0xfffffffd = 0x00000005:   OK" \
578
  "  - MACHI cleared" \
579
  "  - MACLO cleared" \
580
  "!" \
581
  "  0x00000000 00000000 + 0x00000002 * 0xfffffffd = 0xfffffffa:   OK" \
582
  "  - MACHI cleared" \
583
  "  - MACLO cleared" \
584
  "  0x00000000 0000000c + 0x00000002 * 0xfffffffd = 0x00000006:   OK" \
585
  "  - MACHI cleared" \
586
  "  - MACLO cleared" \
587
  "  0x00000001 00000005 + 0x00000002 * 0xfffffffd = 0xffffffff:   OK" \
588
  "  - MACHI cleared" \
589
  "  - MACLO cleared" \
590
  "  0x7fffffff ffffffff + 0x00000002 * 0xfffffffd = 0xfffffff9:   OK" \
591
  "  - MACHI cleared" \
592
  "  - MACLO cleared" \
593
  "  0xffffffff ffffffff + 0x00000002 * 0xfffffffd = 0xfffffff9:   OK" \
594
  "  - MACHI cleared" \
595
  "  - MACLO cleared" \
596
  "  0xffffffff 00000005 + 0x00000002 * 0xfffffffd = 0xffffffff:   OK" \
597
  "  - MACHI cleared" \
598
  "  - MACLO cleared" \
599
  "  0x80000000 00000006 + 0x00000002 * 0xfffffffd = 0x00000000:   OK" \
600
  "  - MACHI cleared" \
601
  "  - MACLO cleared" \
602
  "!" \
603
  "  0x00000000 00000000 + 0x00008000 * 0xffff0000 = 0x80000000:   OK" \
604
  "  - MACHI cleared" \
605
  "  - MACLO cleared" \
606
  "  0x00000000 00000006 + 0x00008000 * 0xffff0000 = 0x80000006:   OK" \
607
  "  - MACHI cleared" \
608
  "  - MACLO cleared" \
609
  "  0x00000000 80000000 + 0x00008000 * 0xffff0000 = 0x00000000:   OK" \
610
  "  - MACHI cleared" \
611
  "  - MACLO cleared" \
612
  "  0x7fffffff ffffffff + 0x00008000 * 0xffff0000 = 0x7fffffff:   OK" \
613
  "  - MACHI cleared" \
614
  "  - MACLO cleared" \
615
  "  0xffffffff ffffffff + 0x00008000 * 0xffff0000 = 0x7fffffff:   OK" \
616
  "  - MACHI cleared" \
617
  "  - MACLO cleared" \
618
  "  0xffffffff 7fffffff + 0x00008000 * 0xffff0000 = 0xffffffff:   OK" \
619
  "  - MACHI cleared" \
620
  "  - MACLO cleared" \
621
  "  0x80000000 80000000 + 0x00008000 * 0xffff0000 = 0x00000000:   OK" \
622
  "  - MACHI cleared" \
623
  "  - MACLO cleared" \
624
  "!" \
625
  "l.msb" \
626
  "  0x00000000 00000000 - 0x00000002 * 0x00000003 = 0xffffffff fffffffa: OK" \
627
  "  0x00000000 0000000c - 0x00000002 * 0x00000003 = 0x00000000 00000006: OK" \
628
  "  0x00000001 00000000 - 0x00000002 * 0x00000003 = 0x00000000 fffffffa: OK" \
629
  "  0x40000000 00000000 - 0x00000002 * 0x00000003 = 0x3fffffff fffffffa: OK" \
630
  "  0xffffffff fffffffa - 0x00000002 * 0x00000003 = 0xffffffff fffffff4: OK" \
631
  "  0xffffffff 00000005 - 0x00000002 * 0x00000003 = 0xfffffffe ffffffff: OK" \
632
  "  0x80000000 00000006 - 0x00000002 * 0x00000003 = 0x80000000 00000000: OK" \
633
  "!" \
634
  "  0x00000000 00000000 - 0x00008001 * 0x0000fffe = 0xffffffff 80000002: OK" \
635
  "  0x00000000 00000002 - 0x00008001 * 0x0000fffe = 0xffffffff 80000004: OK" \
636
  "  0x00000000 80000002 - 0x00008001 * 0x0000fffe = 0x00000000 00000004: OK" \
637
  "  0x7fffffff 7ffffffd - 0x00008001 * 0x0000fffe = 0x7ffffffe ffffffff: OK" \
638
  "  0xffffffff ffffffff - 0x00008001 * 0x0000fffe = 0xffffffff 80000001: OK" \
639
  "  0xffffffff 80000002 - 0x00008001 * 0x0000fffe = 0xffffffff 00000004: OK" \
640
  "  0xfffffffe 80000002 - 0x00008001 * 0x0000fffe = 0xfffffffe 00000004: OK" \
641
  "!" \
642
  "  0x00000000 00000006 - 0xfffffffe * 0xfffffffd = 0x00000000 00000000: OK" \
643
  "  0x00000000 0000000c - 0xfffffffe * 0xfffffffd = 0x00000000 00000006: OK" \
644
  "  0xffffffff ffffffff - 0xfffffffe * 0xfffffffd = 0xffffffff fffffff9: OK" \
645
  "!" \
646
  "  0x00000000 00000000 - 0x00000002 * 0xfffffffd = 0x00000000 00000006: OK" \
647
  "  0x00000000 00000006 - 0x00000002 * 0xfffffffd = 0x00000000 0000000c: OK" \
648
  "  0x00000000 ffffffff - 0x00000002 * 0xfffffffd = 0x00000001 00000005: OK" \
649
  "  0x7fffffff fffffff9 - 0x00000002 * 0xfffffffd = 0x7fffffff ffffffff: OK" \
650
  "  0xffffffff fffffff9 - 0x00000002 * 0xfffffffd = 0xffffffff ffffffff: OK" \
651
  "  0xfffffffe ffffffff - 0x00000002 * 0xfffffffd = 0xffffffff 00000005: OK" \
652
  "  0x80000000 00000000 - 0x00000002 * 0xfffffffd = 0x80000000 00000006: OK" \
653
  "!" \
654
  "  0x00000000 00000000 - 0x00008000 * 0xffff0000 = 0x00000000 80000000: OK" \
655
  "  0x00000000 00000006 - 0x00008000 * 0xffff0000 = 0x00000000 80000006: OK" \
656
  "  0x00000000 80000000 - 0x00008000 * 0xffff0000 = 0x00000001 00000000: OK" \
657
  "  0x7fffffff 7fffffff - 0x00008000 * 0xffff0000 = 0x7fffffff ffffffff: OK" \
658
  "  0xffffffff ffffffff - 0x00008000 * 0xffff0000 = 0x00000000 7fffffff: OK" \
659
  "  0xfffffffe ffffffff - 0x00008000 * 0xffff0000 = 0xffffffff 7fffffff: OK" \
660
  "  0x80000000 00000000 - 0x00008000 * 0xffff0000 = 0x80000000 80000000: OK" \
661
  "!" \
662
  "!Test completed"                       \
663
  "!report(0xdeaddead);"                  \
664
  "!exit(0)"]                             \
665
    "inst-set-test.cfg" "inst-set-test/is-mac-test"
666 118 jeremybenn
 
667
# Run the l.mul test
668
run_or1ksim "mul-test"                                 \
669
    [list "!  ** OVE flag cleared **"                  \
670
          "!l.mul"                                     \
671
          "  0x00000002 * 0x00000003 = 0x00000006: OK" \
672
          "  - carry flag set:      FALSE"             \
673
          "  - overflow flag set:   FALSE"             \
674
          "  - exception triggered: FALSE"             \
675
          "  0x00008001 * 0x0000fffe = 0x7ffffffe: OK" \
676
          "  - carry flag set:      FALSE"             \
677
          "  - overflow flag set:   FALSE"             \
678
          "  - exception triggered: FALSE"             \
679
          "  0x00008000 * 0x00010000 = 0x80000000: OK" \
680
          "  - carry flag set:      FALSE"             \
681
          "  - overflow flag set:   TRUE"              \
682
          "  - exception triggered: FALSE"             \
683
          "  0x00010000 * 0x00010000 = 0x00000000: OK" \
684
          "  - carry flag set:      TRUE"              \
685
          "  - overflow flag set:   TRUE"              \
686
          "  - exception triggered: FALSE"             \
687
          "  0xfffffffe * 0xfffffffd = 0x00000006: OK" \
688
          "  - carry flag set:      TRUE"              \
689
          "  - overflow flag set:   FALSE"             \
690
          "  - exception triggered: FALSE"             \
691
          "  0xffff7fff * 0xffff0002 = 0x7ffffffe: OK" \
692
          "  - carry flag set:      TRUE"              \
693
          "  - overflow flag set:   FALSE"             \
694
          "  - exception triggered: FALSE"             \
695
          "  0xffff7fff * 0xffff0000 = 0x80010000: OK" \
696
          "  - carry flag set:      TRUE"              \
697
          "  - overflow flag set:   TRUE"              \
698
          "  - exception triggered: FALSE"             \
699
          "  0xffff0000 * 0xfffeffff = 0x00010000: OK" \
700
          "  - carry flag set:      TRUE"              \
701
          "  - overflow flag set:   TRUE"              \
702
          "  - exception triggered: FALSE"             \
703
          "  0x00000002 * 0xfffffffd = 0xfffffffa: OK" \
704
          "  - carry flag set:      TRUE"              \
705
          "  - overflow flag set:   FALSE"             \
706
          "  - exception triggered: FALSE"             \
707
          "  0xffff8000 * 0x00010000 = 0x80000000: OK" \
708
          "  - carry flag set:      TRUE"              \
709
          "  - overflow flag set:   FALSE"             \
710
          "  - exception triggered: FALSE"             \
711
          "  0xffff7fff * 0x00010000 = 0x7fff0000: OK" \
712
          "  - carry flag set:      TRUE"              \
713
          "  - overflow flag set:   TRUE"              \
714
          "  - exception triggered: FALSE"             \
715
          "  0x80000000 * 0x00000001 = 0x80000000: OK" \
716
          "  - carry flag set:      FALSE"             \
717
          "  - overflow flag set:   FALSE"             \
718
          "  - exception triggered: FALSE"             \
719
          "!  ** OVE flag set **"                      \
720
          "  RANGE exception"                          \
721
          "  0x00008000 * 0x00010000 = 0x80000000: OK" \
722
          "  - carry flag set:      FALSE"             \
723
          "  - overflow flag set:   TRUE"              \
724
          "  - exception triggered: TRUE"              \
725
          "  0x00000002 * 0xfffffffd = 0xfffffffa: OK" \
726
          "  - carry flag set:      TRUE"              \
727
          "  - overflow flag set:   FALSE"             \
728
          "  - exception triggered: FALSE"             \
729
          "  RANGE exception"                          \
730
          "  0xffff7fff * 0xffff0000 = 0x80010000: OK" \
731
          "  - carry flag set:      TRUE"              \
732
          "  - overflow flag set:   TRUE"              \
733
          "  - exception triggered: TRUE"              \
734
          "!  ** OVE flag cleared **"                  \
735
          "l.muli"                                     \
736
          "  0x00000002 * 0x0003 = 0x00000006: OK"     \
737
          "  - carry flag set:      FALSE"             \
738
          "  - overflow flag set:   FALSE"             \
739
          "  - exception triggered: FALSE"             \
740
          "  0x00010002 * 0x7fff = 0x7ffffffe: OK"     \
741
          "  - carry flag set:      FALSE"             \
742
          "  - overflow flag set:   FALSE"             \
743
          "  - exception triggered: FALSE"             \
744
          "  0x00020000 * 0x4000 = 0x80000000: OK"     \
745
          "  - carry flag set:      FALSE"             \
746
          "  - overflow flag set:   TRUE"              \
747
          "  - exception triggered: FALSE"             \
748
          "  0x00040000 * 0x4000 = 0x00000000: OK"     \
749
          "  - carry flag set:      TRUE"              \
750
          "  - overflow flag set:   TRUE"              \
751
          "  - exception triggered: FALSE"             \
752
          "  0xfffffffe * 0xfffd = 0x00000006: OK"     \
753
          "  - carry flag set:      TRUE"              \
754
          "  - overflow flag set:   FALSE"             \
755
          "  - exception triggered: FALSE"             \
756
          "  0xfffefffe * 0x8001 = 0x7ffffffe: OK"     \
757
          "  - carry flag set:      TRUE"              \
758
          "  - overflow flag set:   FALSE"             \
759
          "  - exception triggered: FALSE"             \
760
          "  0xfffe0000 * 0xbfff = 0x80020000: OK"     \
761
          "  - carry flag set:      TRUE"              \
762
          "  - overflow flag set:   TRUE"              \
763
          "  - exception triggered: FALSE"             \
764
          "  0xfffdfffe * 0x8000 = 0x00010000: OK"     \
765
          "  - carry flag set:      TRUE"              \
766
          "  - overflow flag set:   TRUE"              \
767
          "  - exception triggered: FALSE"             \
768
          "  0x00000002 * 0xfffd = 0xfffffffa: OK"     \
769
          "  - carry flag set:      TRUE"              \
770
          "  - overflow flag set:   FALSE"             \
771
          "  - exception triggered: FALSE"             \
772
          "  0x00010000 * 0x8000 = 0x80000000: OK"     \
773
          "  - carry flag set:      TRUE"              \
774
          "  - overflow flag set:   FALSE"             \
775
          "  - exception triggered: FALSE"             \
776
          "  0xfffdfffc * 0x4000 = 0x7fff0000: OK"     \
777
          "  - carry flag set:      TRUE"              \
778
          "  - overflow flag set:   TRUE"              \
779
          "  - exception triggered: FALSE"             \
780
          "  0x80000000 * 0x0001 = 0x80000000: OK"     \
781
          "  - carry flag set:      FALSE"             \
782
          "  - overflow flag set:   FALSE"             \
783
          "  - exception triggered: FALSE"             \
784
          "!  ** OVE flag set **"                      \
785
          "  RANGE exception"                          \
786
          "  0x00020000 * 0x4000 = 0x80000000: OK"     \
787
          "  - carry flag set:      FALSE"             \
788
          "  - overflow flag set:   TRUE"              \
789
          "  - exception triggered: TRUE"              \
790
          "  0xfffffffe * 0xfffd = 0x00000006: OK"     \
791
          "  - carry flag set:      TRUE"              \
792
          "  - overflow flag set:   FALSE"             \
793
          "  - exception triggered: FALSE"             \
794
          "  RANGE exception"                          \
795
          "  0xfffdfffe * 0x8000 = 0x00010000: OK"     \
796
          "  - carry flag set:      TRUE"              \
797
          "  - overflow flag set:   TRUE"              \
798
          "  - exception triggered: TRUE"              \
799
          "!  ** OVE flag cleared **"                  \
800
          "l.mulu"                                     \
801
          "  0x00000002 * 0x00000003 = 0x00000006: OK" \
802
          "  - carry flag set:      FALSE"             \
803
          "  - overflow flag set:   FALSE"             \
804
          "  - exception triggered: FALSE"             \
805
          "  0x00008001 * 0x0000fffe = 0x7ffffffe: OK" \
806
          "  - carry flag set:      FALSE"             \
807
          "  - overflow flag set:   FALSE"             \
808
          "  - exception triggered: FALSE"             \
809
          "  0x00008000 * 0x00010000 = 0x80000000: OK" \
810
          "  - carry flag set:      FALSE"             \
811
          "  - overflow flag set:   FALSE"             \
812
          "  - exception triggered: FALSE"             \
813
          "  0x00010000 * 0x00010000 = 0x00000000: OK" \
814
          "  - carry flag set:      TRUE"              \
815
          "  - overflow flag set:   FALSE"             \
816
          "  - exception triggered: FALSE"             \
817
          "  0xfffffffe * 0xfffffffd = 0x00000006: OK" \
818
          "  - carry flag set:      TRUE"              \
819
          "  - overflow flag set:   FALSE"             \
820
          "  - exception triggered: FALSE"             \
821
          "  0xffff7fff * 0xffff0002 = 0x7ffffffe: OK" \
822
          "  - carry flag set:      TRUE"              \
823
          "  - overflow flag set:   FALSE"             \
824
          "  - exception triggered: FALSE"             \
825
          "  0xffff7fff * 0xffff0000 = 0x80010000: OK" \
826
          "  - carry flag set:      TRUE"              \
827
          "  - overflow flag set:   FALSE"             \
828
          "  - exception triggered: FALSE"             \
829
          "  0xffff0000 * 0xfffeffff = 0x00010000: OK" \
830
          "  - carry flag set:      TRUE"              \
831
          "  - overflow flag set:   FALSE"             \
832
          "  - exception triggered: FALSE"             \
833
          "  0x00000002 * 0xfffffffd = 0xfffffffa: OK" \
834
          "  - carry flag set:      TRUE"              \
835
          "  - overflow flag set:   FALSE"             \
836
          "  - exception triggered: FALSE"             \
837
          "  0xffff8000 * 0x00010000 = 0x80000000: OK" \
838
          "  - carry flag set:      TRUE"              \
839
          "  - overflow flag set:   FALSE"             \
840
          "  - exception triggered: FALSE"             \
841
          "  0xffff7fff * 0x00010000 = 0x7fff0000: OK" \
842
          "  - carry flag set:      TRUE"              \
843
          "  - overflow flag set:   FALSE"             \
844
          "  - exception triggered: FALSE"             \
845
          "  0x80000000 * 0x00000001 = 0x80000000: OK" \
846
          "  - carry flag set:      FALSE"             \
847
          "  - overflow flag set:   FALSE"             \
848
          "  - exception triggered: FALSE"             \
849
          "!  ** OVE flag set **"                      \
850
          "  0x00008000 * 0x00010000 = 0x80000000: OK" \
851
          "  - carry flag set:      FALSE"             \
852
          "  - overflow flag set:   FALSE"             \
853
          "  - exception triggered: FALSE"             \
854
          "  0x00000002 * 0xfffffffd = 0xfffffffa: OK" \
855
          "  - carry flag set:      TRUE"              \
856
          "  - overflow flag set:   FALSE"             \
857
          "  - exception triggered: FALSE"             \
858
          "  0xffff7fff * 0xffff0000 = 0x80010000: OK" \
859
          "  - carry flag set:      TRUE"              \
860
          "  - overflow flag set:   FALSE"             \
861
          "  - exception triggered: FALSE"             \
862
          "!  ** OVE flag cleared **"                  \
863
          "!Test completed"                            \
864
          "!report(0xdeaddead);"                       \
865
          "!exit(0)"]                                  \
866
    "inst-set-test.cfg" "inst-set-test/is-mul-test"

powered by: WebSVN 2.1.0

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