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 582

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 124 jeremybenn
# Run the l.and, and l.andi tests
258
run_or1ksim "and-test"                                 \
259
    [list "!  ** OVE flag set **"                      \
260
          "!l.and"                                     \
261
          "  0x00000000 & 0x00000000 = 0x00000000: OK" \
262
          "  - carry flag set:      FALSE"             \
263
          "  - overflow flag set:   FALSE"             \
264
          "  - exception triggered: FALSE"             \
265
          "  0xffffffff & 0xffffffff = 0xffffffff: OK" \
266
          "  - carry flag set:      FALSE"             \
267
          "  - overflow flag set:   FALSE"             \
268
          "  - exception triggered: FALSE"             \
269
          "  0xaaaaaaaa & 0x00000000 = 0x00000000: OK" \
270
          "  - carry flag set:      FALSE"             \
271
          "  - overflow flag set:   FALSE"             \
272
          "  - exception triggered: FALSE"             \
273
          "  0xaaaaaaaa & 0xaaaaaaaa = 0xaaaaaaaa: OK" \
274
          "  - carry flag set:      FALSE"             \
275
          "  - overflow flag set:   FALSE"             \
276
          "  - exception triggered: FALSE"             \
277
          "  0x55555555 & 0x00000000 = 0x00000000: OK" \
278
          "  - carry flag set:      FALSE"             \
279
          "  - overflow flag set:   FALSE"             \
280
          "  - exception triggered: FALSE"             \
281
          "  0x55555555 & 0x55555555 = 0x55555555: OK" \
282
          "  - carry flag set:      FALSE"             \
283
          "  - overflow flag set:   FALSE"             \
284
          "  - exception triggered: FALSE"             \
285
          "  0xaaaaaaaa & 0x55555555 = 0x00000000: OK" \
286
          "  - carry flag set:      FALSE"             \
287
          "  - overflow flag set:   FALSE"             \
288
          "  - exception triggered: FALSE"             \
289
          "  0x4c70f07c & 0xb38f0f83 = 0x00000000: OK" \
290
          "  - carry flag set:      FALSE"             \
291
          "  - overflow flag set:   FALSE"             \
292
          "  - exception triggered: FALSE"             \
293
          "  0x4c70f07c & 0xc4c70f07 = 0x44400004: OK" \
294
          "  - carry flag set:      FALSE"             \
295
          "  - overflow flag set:   FALSE"             \
296
          "  - exception triggered: FALSE"             \
297
          "  0xb38f0f83 & 0x38f0f83b = 0x30800803: OK" \
298
          "  - carry flag set:      FALSE"             \
299
          "  - overflow flag set:   FALSE"             \
300
          "  - exception triggered: FALSE"             \
301
          "!l.andi"                                    \
302
          "  0x00000000 & 0x0000 = 0x00000000: OK"     \
303
          "  - carry flag set:      FALSE"             \
304
          "  - overflow flag set:   FALSE"             \
305
          "  - exception triggered: FALSE"             \
306
          "  0xffffffff & 0xffff = 0x0000ffff: OK"     \
307
          "  - carry flag set:      FALSE"             \
308
          "  - overflow flag set:   FALSE"             \
309
          "  - exception triggered: FALSE"             \
310
          "  0xaaaaaaaa & 0x0000 = 0x00000000: OK"     \
311
          "  - carry flag set:      FALSE"             \
312
          "  - overflow flag set:   FALSE"             \
313
          "  - exception triggered: FALSE"             \
314
          "  0xaaaaaaaa & 0xaaaa = 0x0000aaaa: OK"     \
315
          "  - carry flag set:      FALSE"             \
316
          "  - overflow flag set:   FALSE"             \
317
          "  - exception triggered: FALSE"             \
318
          "  0x55555555 & 0x0000 = 0x00000000: OK"     \
319
          "  - carry flag set:      FALSE"             \
320
          "  - overflow flag set:   FALSE"             \
321
          "  - exception triggered: FALSE"             \
322
          "  0x55555555 & 0x5555 = 0x00005555: OK"     \
323
          "  - carry flag set:      FALSE"             \
324
          "  - overflow flag set:   FALSE"             \
325
          "  - exception triggered: FALSE"             \
326
          "  0xaaaaaaaa & 0x5555 = 0x00000000: OK"     \
327
          "  - carry flag set:      FALSE"             \
328
          "  - overflow flag set:   FALSE"             \
329
          "  - exception triggered: FALSE"             \
330
          "  0x4c70f07c & 0x0f83 = 0x00000000: OK"     \
331
          "  - carry flag set:      FALSE"             \
332
          "  - overflow flag set:   FALSE"             \
333
          "  - exception triggered: FALSE"             \
334
          "  0x4c70f07c & 0x0f07 = 0x00000004: OK"     \
335
          "  - carry flag set:      FALSE"             \
336
          "  - overflow flag set:   FALSE"             \
337
          "  - exception triggered: FALSE"             \
338
          "  0xb38f0f83 & 0xf83b = 0x00000803: OK"     \
339
          "  - carry flag set:      FALSE"             \
340
          "  - overflow flag set:   FALSE"             \
341
          "  - exception triggered: FALSE"             \
342
          "!Test completed"                            \
343
          "!report(0xdeaddead);"                       \
344
          "!exit(0)"]                                  \
345
    "inst-set-test.cfg" "inst-set-test/is-and-test"
346
 
347 115 jeremybenn
# Run the l.div and l.divu test
348 118 jeremybenn
run_or1ksim "div-test"                                 \
349
    [list "!l.div"                                     \
350
          "  0x0000000c / 0x00000003 = 0x00000004: OK" \
351
          "  - carry flag set:      FALSE"             \
352
          "  - overflow flag set:   FALSE"             \
353
          "  - exception triggered: FALSE"             \
354
          "  0x0000000b / 0x00000003 = 0x00000003: OK" \
355
          "  - carry flag set:      FALSE"             \
356
          "  - overflow flag set:   FALSE"             \
357
          "  - exception triggered: FALSE"             \
358
          "  0xfffffff4 / 0xfffffffd = 0x00000004: OK" \
359
          "  - carry flag set:      FALSE"             \
360
          "  - overflow flag set:   FALSE"             \
361
          "  - exception triggered: FALSE"             \
362
          "  0xfffffff5 / 0xfffffffd = 0x00000003: OK" \
363
          "  - carry flag set:      FALSE"             \
364
          "  - overflow flag set:   FALSE"             \
365
          "  - exception triggered: FALSE"             \
366
          "  0xfffffff4 / 0x00000003 = 0xfffffffc: OK" \
367
          "  - carry flag set:      FALSE"             \
368
          "  - overflow flag set:   FALSE"             \
369
          "  - exception triggered: FALSE"             \
370
          "  0xfffffff5 / 0x00000003 = 0xfffffffd: OK" \
371
          "  - carry flag set:      FALSE"             \
372
          "  - overflow flag set:   FALSE"             \
373
          "  - exception triggered: FALSE"             \
374
          "  0x0000000c / 0xfffffffd = 0xfffffffc: OK" \
375
          "  - carry flag set:      FALSE"             \
376
          "  - overflow flag set:   FALSE"             \
377
          "  - exception triggered: FALSE"             \
378
          "  0x0000000b / 0xfffffffd = 0xfffffffd: OK" \
379
          "  - carry flag set:      FALSE"             \
380
          "  - overflow flag set:   FALSE"             \
381
          "  - exception triggered: FALSE"             \
382
          "  0x0000000c / 0x00000000 = 0x00000000: OK" \
383
          "  - carry flag set:      TRUE"              \
384
          "  - overflow flag set:   FALSE"             \
385
          "  - exception triggered: FALSE"             \
386
          "  0xfffffff4 / 0x00000000 = 0x00000000: OK" \
387
          "  - carry flag set:      TRUE"              \
388
          "  - overflow flag set:   FALSE"             \
389
          "  - exception triggered: FALSE"             \
390
          "!  ** OVE flag set **"                      \
391
          "  RANGE exception"                          \
392
          "  0x0000000c / 0x00000000 = 0x00000000: OK" \
393
          "  - carry flag set:      TRUE"              \
394
          "  - overflow flag set:   FALSE"             \
395
          "  - exception triggered: TRUE"              \
396
          "  RANGE exception"                          \
397
          "  0xfffffff4 / 0x00000000 = 0x00000000: OK" \
398
          "  - carry flag set:      TRUE"              \
399
          "  - overflow flag set:   FALSE"             \
400
          "  - exception triggered: TRUE"              \
401
          "!  ** OVE flag cleared **"                  \
402
          "l.divu"                                     \
403
          "  0x0000000c / 0x00000003 = 0x00000004: OK" \
404
          "  - carry flag set:      FALSE"             \
405
          "  - overflow flag set:   FALSE"             \
406
          "  - exception triggered: FALSE"             \
407
          "  0x0000000b / 0x00000003 = 0x00000003: OK" \
408
          "  - carry flag set:      FALSE"             \
409
          "  - overflow flag set:   FALSE"             \
410
          "  - exception triggered: FALSE"             \
411
          "  0xfffffff4 / 0xfffffffd = 0x00000000: OK" \
412
          "  - carry flag set:      FALSE"             \
413
          "  - overflow flag set:   FALSE"             \
414
          "  - exception triggered: FALSE"             \
415
          "  0xfffffff5 / 0xfffffffd = 0x00000000: OK" \
416
          "  - carry flag set:      FALSE"             \
417
          "  - overflow flag set:   FALSE"             \
418
          "  - exception triggered: FALSE"             \
419
          "  0xfffffff4 / 0x00000003 = 0x55555551: OK" \
420
          "  - carry flag set:      FALSE"             \
421
          "  - overflow flag set:   FALSE"             \
422
          "  - exception triggered: FALSE"             \
423
          "  0xfffffff5 / 0x00000003 = 0x55555551: OK" \
424
          "  - carry flag set:      FALSE"             \
425
          "  - overflow flag set:   FALSE"             \
426
          "  - exception triggered: FALSE"             \
427
          "  0x0000000c / 0xfffffffd = 0x00000000: OK" \
428
          "  - carry flag set:      FALSE"             \
429
          "  - overflow flag set:   FALSE"             \
430
          "  - exception triggered: FALSE"             \
431
          "  0x0000000b / 0xfffffffd = 0x00000000: OK" \
432
          "  - carry flag set:      FALSE"             \
433
          "  - overflow flag set:   FALSE"             \
434
          "  - exception triggered: FALSE"             \
435
          "  0x0000000c / 0x00000000 = 0x00000000: OK" \
436
          "  - carry flag set:      TRUE"              \
437
          "  - overflow flag set:   FALSE"             \
438
          "  - exception triggered: FALSE"             \
439
          "  0xfffffff4 / 0x00000000 = 0x00000000: OK" \
440
          "  - carry flag set:      TRUE"              \
441
          "  - overflow flag set:   FALSE"             \
442
          "  - exception triggered: FALSE"             \
443
          "!  ** OVE flag set **"                      \
444
          "  RANGE exception"                          \
445
          "  0x0000000c / 0x00000000 = 0x00000000: OK" \
446
          "  - carry flag set:      TRUE"              \
447
          "  - overflow flag set:   FALSE"             \
448
          "  - exception triggered: TRUE"              \
449
          "  RANGE exception"                          \
450
          "  0xfffffff4 / 0x00000000 = 0x00000000: OK" \
451
          "  - carry flag set:      TRUE"              \
452
          "  - overflow flag set:   FALSE"             \
453
          "  - exception triggered: TRUE"              \
454
          "!  ** OVE flag cleared **"                  \
455
          "!Test completed"                            \
456
          "!report(0xdeaddead);"                       \
457
          "!exit(0)"]                                  \
458 115 jeremybenn
    "inst-set-test.cfg" "inst-set-test/is-div-test"
459
 
460
# Run the l.ff1 and l.fl1 test
461
run_or1ksim "find-test"                 \
462
    [list "!l.ff1"                      \
463 118 jeremybenn
          "  ff1 (0x00000001) = 0x01: OK" \
464
          "  ff1 (0x80000000) = 0x20: OK" \
465
          "  ff1 (0x55555555) = 0x01: OK" \
466
          "  ff1 (0xaaaaaaaa) = 0x02: OK" \
467
          "  ff1 (0x00018000) = 0x10: OK" \
468
          "  ff1 (0xc0000000) = 0x1f: OK" \
469
          "  ff1 (0x00000000) = 0x00: OK" \
470 115 jeremybenn
          "!l.fl1"                      \
471 118 jeremybenn
          "  fl1 (0x00000001) = 0x01: OK" \
472
          "  fl1 (0x80000000) = 0x20: OK" \
473
          "  fl1 (0x55555555) = 0x1f: OK" \
474
          "  fl1 (0xaaaaaaaa) = 0x20: OK" \
475
          "  fl1 (0x00018000) = 0x11: OK" \
476
          "  fl1 (0xc0000000) = 0x20: OK" \
477
          "  fl1 (0x00000000) = 0x00: OK" \
478 115 jeremybenn
          "!Test completed"             \
479
          "!report(0xdeaddead);"        \
480
          "!exit(0)"]                   \
481
    "inst-set-test.cfg" "inst-set-test/is-find-test"
482
 
483 121 jeremybenn
# Run the l.jalf and l.jr test
484
run_or1ksim "jump-test"                                     \
485
    [list "!l.jalr"                                         \
486
          "  Jump to 0x000010dc using register 0x05 OK"     \
487
          "  - exception triggered: FALSE"                  \
488
          "  ALIGNMENT exception"                           \
489
          "  Jump to 0x000012b9 using register 0x05 failed" \
490
          "  - exception triggered: TRUE"                   \
491
          "  ALIGNMENT exception"                           \
492
          "  Jump to 0x00001496 using register 0x05 failed" \
493
          "  - exception triggered: TRUE"                   \
494
          "  ALIGNMENT exception"                           \
495
          "  Jump to 0x00001673 using register 0x05 failed" \
496
          "  - exception triggered: TRUE"                   \
497
          "  ILLEGAL INSTRUCTION exception"                 \
498
          "  Jump to 0x0000184c using register 0x09 failed" \
499
          "  - exception triggered: TRUE"                   \
500
          "!l.jr"                                           \
501
          "  Jump to 0x00001a38 using register 0x05 OK"     \
502
          "  - exception triggered: FALSE"                  \
503
          "  ALIGNMENT exception"                           \
504
          "  Jump to 0x00001c15 using register 0x05 failed" \
505
          "  - exception triggered: TRUE"                   \
506
          "  ALIGNMENT exception"                           \
507
          "  Jump to 0x00001df2 using register 0x05 failed" \
508
          "  - exception triggered: TRUE"                   \
509
          "  ALIGNMENT exception"                           \
510
          "  Jump to 0x00001fcf using register 0x05 failed" \
511
          "  - exception triggered: TRUE"                   \
512
          "  Jump to 0x000021a8 using register 0x09 OK"     \
513
          "  - exception triggered: FALSE"                  \
514
          "!Test completed"                                 \
515
          "!report(0xdeaddead);"                            \
516
          "!exit(0)"]                                       \
517
    "inst-set-test.cfg" "inst-set-test/is-jump-test"
518
 
519 115 jeremybenn
# Run the l.lws test
520
run_or1ksim "lws-test"                            \
521
    [list "!l.lws"                                \
522
          "   l.lws r4,0(r5): r4=0xdeadbeef:  OK" \
523
          "   l.lws r4,0(r5): r4=0x00000000:  OK" \
524
          "   l.lws r4,0(r5): r4=0x7fffffff:  OK" \
525
          "   l.lws r4,0(r5): r4=0x80000000:  OK" \
526
          "   l.lws r4,0(r5): r4=0xffffffff:  OK" \
527
          "   l.lws r4,0(r5): r4=0x00000000:  OK" \
528
          "   l.lws r4,0(r5): r4=0x7fffffff:  OK" \
529
          "   l.lws r4,0(r5): r4=0x80000000:  OK" \
530
          "   l.lws r4,0(r5): r4=0xffffffff:  OK" \
531
          "   l.lws r4,0(r5): r4=0xdeadbeef:  OK" \
532
          "   l.lws r4,0(r5): r4=0x00000000:  OK" \
533
          "   l.lws r4,0(r5): r4=0x7fffffff:  OK" \
534
          "   l.lws r4,0(r5): r4=0x80000000:  OK" \
535
          "!Test completed"                       \
536
          "!report(0xdeaddead);"                  \
537
          "!exit(0)"]                             \
538
    "inst-set-test.cfg" "inst-set-test/is-lws-test"
539 116 jeremybenn
 
540
# Run the l.mac test
541
run_or1ksim "mac-test"                            \
542
    [list "!l.mac"                                \
543
  "  0x00000000 00000000 + 0x00000002 * 0x00000003 = 0x00000000 00000006: OK" \
544
  "  0x00000000 00000006 + 0x00000002 * 0x00000003 = 0x00000000 0000000c: OK" \
545
  "  0x00000000 fffffffa + 0x00000002 * 0x00000003 = 0x00000001 00000000: OK" \
546
  "  0x3fffffff fffffffa + 0x00000002 * 0x00000003 = 0x40000000 00000000: OK" \
547
  "  0xffffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000 00000000: OK" \
548
  "  0xffffffff 00000000 + 0x00000002 * 0x00000003 = 0xffffffff 00000006: OK" \
549
  "  0x80000000 00000000 + 0x00000002 * 0x00000003 = 0x80000000 00000006: OK" \
550
  "!" \
551
  "  0x00000000 00000000 + 0x00008001 * 0x0000fffe = 0x00000000 7ffffffe: OK" \
552
  "  0x00000000 00000002 + 0x00008001 * 0x0000fffe = 0x00000000 80000000: OK" \
553
  "  0x00000000 80000002 + 0x00008001 * 0x0000fffe = 0x00000001 00000000: OK" \
554
  "  0x7fffffff 80000001 + 0x00008001 * 0x0000fffe = 0x7fffffff ffffffff: OK" \
555
  "  0xffffffff ffffffff + 0x00008001 * 0x0000fffe = 0x00000000 7ffffffd: OK" \
556
  "  0xffffffff 80000002 + 0x00008001 * 0x0000fffe = 0x00000000 00000000: OK" \
557
  "  0xfffffffe 80000002 + 0x00008001 * 0x0000fffe = 0xffffffff 00000000: OK" \
558
  "!" \
559
  "  0x00000000 00000000 + 0xfffffffe * 0xfffffffd = 0x00000000 00000006: OK" \
560
  "  0x00000000 00000006 + 0xfffffffe * 0xfffffffd = 0x00000000 0000000c: OK" \
561
  "  0xffffffff ffffffff + 0xfffffffe * 0xfffffffd = 0x00000000 00000005: OK" \
562
  "!" \
563
  "  0x00000000 00000000 + 0x00000002 * 0xfffffffd = 0xffffffff fffffffa: OK" \
564
  "  0x00000000 0000000c + 0x00000002 * 0xfffffffd = 0x00000000 00000006: OK" \
565
  "  0x00000001 00000005 + 0x00000002 * 0xfffffffd = 0x00000000 ffffffff: OK" \
566
  "  0x7fffffff ffffffff + 0x00000002 * 0xfffffffd = 0x7fffffff fffffff9: OK" \
567
  "  0xffffffff ffffffff + 0x00000002 * 0xfffffffd = 0xffffffff fffffff9: OK" \
568
  "  0xffffffff 00000005 + 0x00000002 * 0xfffffffd = 0xfffffffe ffffffff: OK" \
569
  "  0x80000000 00000006 + 0x00000002 * 0xfffffffd = 0x80000000 00000000: OK" \
570
  "!" \
571
  "  0x00000000 00000000 + 0x00008000 * 0xffff0000 = 0xffffffff 80000000: OK" \
572
  "  0x00000000 00000006 + 0x00008000 * 0xffff0000 = 0xffffffff 80000006: OK" \
573
  "  0x00000000 80000000 + 0x00008000 * 0xffff0000 = 0x00000000 00000000: OK" \
574
  "  0x7fffffff ffffffff + 0x00008000 * 0xffff0000 = 0x7fffffff 7fffffff: OK" \
575
  "  0xffffffff ffffffff + 0x00008000 * 0xffff0000 = 0xffffffff 7fffffff: OK" \
576
  "  0xffffffff 7fffffff + 0x00008000 * 0xffff0000 = 0xfffffffe ffffffff: OK" \
577
  "  0x80000000 80000000 + 0x00008000 * 0xffff0000 = 0x80000000 00000000: OK" \
578
  "!" \
579
  "l.maci" \
580
  "  0x00000000 00000000 + 0x00000002 * 0x00000003 = 0x00000000 00000006: OK" \
581
  "  0x00000000 00000006 + 0x00000002 * 0x00000003 = 0x00000000 0000000c: OK" \
582
  "  0x00000000 fffffffa + 0x00000002 * 0x00000003 = 0x00000001 00000000: OK" \
583
  "  0x3fffffff fffffffa + 0x00000002 * 0x00000003 = 0x40000000 00000000: OK" \
584
  "  0xffffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000 00000000: OK" \
585
  "  0xffffffff 00000000 + 0x00000002 * 0x00000003 = 0xffffffff 00000006: OK" \
586
  "  0x80000000 00000000 + 0x00000002 * 0x00000003 = 0x80000000 00000006: OK" \
587
  "!" \
588
  "  0x00000000 00000000 + 0x00010002 * 0x00007fff = 0x00000000 7ffffffe: OK" \
589
  "  0x00000000 00000002 + 0x00010002 * 0x00007fff = 0x00000000 80000000: OK" \
590
  "  0x00000000 80000002 + 0x00010002 * 0x00007fff = 0x00000001 00000000: OK" \
591
  "  0x7fffffff 80000001 + 0x00010002 * 0x00007fff = 0x7fffffff ffffffff: OK" \
592
  "  0xffffffff ffffffff + 0x00010002 * 0x00007fff = 0x00000000 7ffffffd: OK" \
593
  "  0xffffffff 80000002 + 0x00010002 * 0x00007fff = 0x00000000 00000000: OK" \
594
  "  0xfffffffe 80000002 + 0x00010002 * 0x00007fff = 0xffffffff 00000000: OK" \
595
  "!" \
596
  "  0x00000000 00000000 + 0xfffffffe * 0x0000fffd = 0x00000000 00000006: OK" \
597
  "  0x00000000 00000006 + 0xfffffffe * 0x0000fffd = 0x00000000 0000000c: OK" \
598
  "  0xffffffff ffffffff + 0xfffffffe * 0x0000fffd = 0x00000000 00000005: OK" \
599
  "!" \
600
  "  0x00000000 00000000 + 0x00000002 * 0x0000fffd = 0xffffffff fffffffa: OK" \
601
  "  0x00000000 0000000c + 0x00000002 * 0x0000fffd = 0x00000000 00000006: OK" \
602
  "  0x00000001 00000005 + 0x00000002 * 0x0000fffd = 0x00000000 ffffffff: OK" \
603
  "  0x7fffffff ffffffff + 0x00000002 * 0x0000fffd = 0x7fffffff fffffff9: OK" \
604
  "  0xffffffff ffffffff + 0x00000002 * 0x0000fffd = 0xffffffff fffffff9: OK" \
605
  "  0xffffffff 00000005 + 0x00000002 * 0x0000fffd = 0xfffffffe ffffffff: OK" \
606
  "  0x80000000 00000006 + 0x00000002 * 0x0000fffd = 0x80000000 00000000: OK" \
607
  "!" \
608
  "  0x00000000 00000000 + 0x00010000 * 0x00008000 = 0xffffffff 80000000: OK" \
609
  "  0x00000000 00000006 + 0x00010000 * 0x00008000 = 0xffffffff 80000006: OK" \
610
  "  0x00000000 80000000 + 0x00010000 * 0x00008000 = 0x00000000 00000000: OK" \
611
  "  0x7fffffff ffffffff + 0x00010000 * 0x00008000 = 0x7fffffff 7fffffff: OK" \
612
  "  0xffffffff ffffffff + 0x00010000 * 0x00008000 = 0xffffffff 7fffffff: OK" \
613
  "  0xffffffff 7fffffff + 0x00010000 * 0x00008000 = 0xfffffffe ffffffff: OK" \
614
  "  0x80000000 80000000 + 0x00010000 * 0x00008000 = 0x80000000 00000000: OK" \
615
  "!" \
616
  "l.macrc" \
617
  "  0x00000000 00000000 + 0x00000002 * 0x00000003 = 0x00000006:   OK" \
618
  "  - MACHI cleared" \
619
  "  - MACLO cleared" \
620
  "  0x00000000 00000006 + 0x00000002 * 0x00000003 = 0x0000000c:   OK" \
621
  "  - MACHI cleared" \
622
  "  - MACLO cleared" \
623
  "  0x00000000 fffffffa + 0x00000002 * 0x00000003 = 0x00000000:   OK" \
624
  "  - MACHI cleared" \
625
  "  - MACLO cleared" \
626
  "  0x3fffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000:   OK" \
627
  "  - MACHI cleared" \
628
  "  - MACLO cleared" \
629
  "  0xffffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000:   OK" \
630
  "  - MACHI cleared" \
631
  "  - MACLO cleared" \
632
  "  0xffffffff 00000000 + 0x00000002 * 0x00000003 = 0x00000006:   OK" \
633
  "  - MACHI cleared" \
634
  "  - MACLO cleared" \
635
  "  0x80000000 00000000 + 0x00000002 * 0x00000003 = 0x00000006:   OK" \
636
  "  - MACHI cleared" \
637
  "  - MACLO cleared" \
638
  "!" \
639
  "  0x00000000 00000000 + 0x00008001 * 0x0000fffe = 0x7ffffffe:   OK" \
640
  "  - MACHI cleared" \
641
  "  - MACLO cleared" \
642
  "  0x00000000 00000002 + 0x00008001 * 0x0000fffe = 0x80000000:   OK" \
643
  "  - MACHI cleared" \
644
  "  - MACLO cleared" \
645
  "  0x00000000 80000002 + 0x00008001 * 0x0000fffe = 0x00000000:   OK" \
646
  "  - MACHI cleared" \
647
  "  - MACLO cleared" \
648
  "  0x7fffffff 80000001 + 0x00008001 * 0x0000fffe = 0xffffffff:   OK" \
649
  "  - MACHI cleared" \
650
  "  - MACLO cleared" \
651
  "  0xffffffff ffffffff + 0x00008001 * 0x0000fffe = 0x7ffffffd:   OK" \
652
  "  - MACHI cleared" \
653
  "  - MACLO cleared" \
654
  "  0xffffffff 80000002 + 0x00008001 * 0x0000fffe = 0x00000000:   OK" \
655
  "  - MACHI cleared" \
656
  "  - MACLO cleared" \
657
  "  0xfffffffe 80000002 + 0x00008001 * 0x0000fffe = 0x00000000:   OK" \
658
  "  - MACHI cleared" \
659
  "  - MACLO cleared" \
660
  "!" \
661
  "  0x00000000 00000000 + 0xfffffffe * 0xfffffffd = 0x00000006:   OK" \
662
  "  - MACHI cleared" \
663
  "  - MACLO cleared" \
664
  "  0x00000000 00000006 + 0xfffffffe * 0xfffffffd = 0x0000000c:   OK" \
665
  "  - MACHI cleared" \
666
  "  - MACLO cleared" \
667
  "  0xffffffff ffffffff + 0xfffffffe * 0xfffffffd = 0x00000005:   OK" \
668
  "  - MACHI cleared" \
669
  "  - MACLO cleared" \
670
  "!" \
671
  "  0x00000000 00000000 + 0x00000002 * 0xfffffffd = 0xfffffffa:   OK" \
672
  "  - MACHI cleared" \
673
  "  - MACLO cleared" \
674
  "  0x00000000 0000000c + 0x00000002 * 0xfffffffd = 0x00000006:   OK" \
675
  "  - MACHI cleared" \
676
  "  - MACLO cleared" \
677
  "  0x00000001 00000005 + 0x00000002 * 0xfffffffd = 0xffffffff:   OK" \
678
  "  - MACHI cleared" \
679
  "  - MACLO cleared" \
680
  "  0x7fffffff ffffffff + 0x00000002 * 0xfffffffd = 0xfffffff9:   OK" \
681
  "  - MACHI cleared" \
682
  "  - MACLO cleared" \
683
  "  0xffffffff ffffffff + 0x00000002 * 0xfffffffd = 0xfffffff9:   OK" \
684
  "  - MACHI cleared" \
685
  "  - MACLO cleared" \
686
  "  0xffffffff 00000005 + 0x00000002 * 0xfffffffd = 0xffffffff:   OK" \
687
  "  - MACHI cleared" \
688
  "  - MACLO cleared" \
689
  "  0x80000000 00000006 + 0x00000002 * 0xfffffffd = 0x00000000:   OK" \
690
  "  - MACHI cleared" \
691
  "  - MACLO cleared" \
692
  "!" \
693
  "  0x00000000 00000000 + 0x00008000 * 0xffff0000 = 0x80000000:   OK" \
694
  "  - MACHI cleared" \
695
  "  - MACLO cleared" \
696
  "  0x00000000 00000006 + 0x00008000 * 0xffff0000 = 0x80000006:   OK" \
697
  "  - MACHI cleared" \
698
  "  - MACLO cleared" \
699
  "  0x00000000 80000000 + 0x00008000 * 0xffff0000 = 0x00000000:   OK" \
700
  "  - MACHI cleared" \
701
  "  - MACLO cleared" \
702
  "  0x7fffffff ffffffff + 0x00008000 * 0xffff0000 = 0x7fffffff:   OK" \
703
  "  - MACHI cleared" \
704
  "  - MACLO cleared" \
705
  "  0xffffffff ffffffff + 0x00008000 * 0xffff0000 = 0x7fffffff:   OK" \
706
  "  - MACHI cleared" \
707
  "  - MACLO cleared" \
708
  "  0xffffffff 7fffffff + 0x00008000 * 0xffff0000 = 0xffffffff:   OK" \
709
  "  - MACHI cleared" \
710
  "  - MACLO cleared" \
711
  "  0x80000000 80000000 + 0x00008000 * 0xffff0000 = 0x00000000:   OK" \
712
  "  - MACHI cleared" \
713
  "  - MACLO cleared" \
714
  "!" \
715
  "l.msb" \
716
  "  0x00000000 00000000 - 0x00000002 * 0x00000003 = 0xffffffff fffffffa: OK" \
717
  "  0x00000000 0000000c - 0x00000002 * 0x00000003 = 0x00000000 00000006: OK" \
718
  "  0x00000001 00000000 - 0x00000002 * 0x00000003 = 0x00000000 fffffffa: OK" \
719
  "  0x40000000 00000000 - 0x00000002 * 0x00000003 = 0x3fffffff fffffffa: OK" \
720
  "  0xffffffff fffffffa - 0x00000002 * 0x00000003 = 0xffffffff fffffff4: OK" \
721
  "  0xffffffff 00000005 - 0x00000002 * 0x00000003 = 0xfffffffe ffffffff: OK" \
722
  "  0x80000000 00000006 - 0x00000002 * 0x00000003 = 0x80000000 00000000: OK" \
723
  "!" \
724
  "  0x00000000 00000000 - 0x00008001 * 0x0000fffe = 0xffffffff 80000002: OK" \
725
  "  0x00000000 00000002 - 0x00008001 * 0x0000fffe = 0xffffffff 80000004: OK" \
726
  "  0x00000000 80000002 - 0x00008001 * 0x0000fffe = 0x00000000 00000004: OK" \
727
  "  0x7fffffff 7ffffffd - 0x00008001 * 0x0000fffe = 0x7ffffffe ffffffff: OK" \
728
  "  0xffffffff ffffffff - 0x00008001 * 0x0000fffe = 0xffffffff 80000001: OK" \
729
  "  0xffffffff 80000002 - 0x00008001 * 0x0000fffe = 0xffffffff 00000004: OK" \
730
  "  0xfffffffe 80000002 - 0x00008001 * 0x0000fffe = 0xfffffffe 00000004: OK" \
731
  "!" \
732
  "  0x00000000 00000006 - 0xfffffffe * 0xfffffffd = 0x00000000 00000000: OK" \
733
  "  0x00000000 0000000c - 0xfffffffe * 0xfffffffd = 0x00000000 00000006: OK" \
734
  "  0xffffffff ffffffff - 0xfffffffe * 0xfffffffd = 0xffffffff fffffff9: OK" \
735
  "!" \
736
  "  0x00000000 00000000 - 0x00000002 * 0xfffffffd = 0x00000000 00000006: OK" \
737
  "  0x00000000 00000006 - 0x00000002 * 0xfffffffd = 0x00000000 0000000c: OK" \
738
  "  0x00000000 ffffffff - 0x00000002 * 0xfffffffd = 0x00000001 00000005: OK" \
739
  "  0x7fffffff fffffff9 - 0x00000002 * 0xfffffffd = 0x7fffffff ffffffff: OK" \
740
  "  0xffffffff fffffff9 - 0x00000002 * 0xfffffffd = 0xffffffff ffffffff: OK" \
741
  "  0xfffffffe ffffffff - 0x00000002 * 0xfffffffd = 0xffffffff 00000005: OK" \
742
  "  0x80000000 00000000 - 0x00000002 * 0xfffffffd = 0x80000000 00000006: OK" \
743
  "!" \
744
  "  0x00000000 00000000 - 0x00008000 * 0xffff0000 = 0x00000000 80000000: OK" \
745
  "  0x00000000 00000006 - 0x00008000 * 0xffff0000 = 0x00000000 80000006: OK" \
746
  "  0x00000000 80000000 - 0x00008000 * 0xffff0000 = 0x00000001 00000000: OK" \
747
  "  0x7fffffff 7fffffff - 0x00008000 * 0xffff0000 = 0x7fffffff ffffffff: OK" \
748
  "  0xffffffff ffffffff - 0x00008000 * 0xffff0000 = 0x00000000 7fffffff: OK" \
749
  "  0xfffffffe ffffffff - 0x00008000 * 0xffff0000 = 0xffffffff 7fffffff: OK" \
750
  "  0x80000000 00000000 - 0x00008000 * 0xffff0000 = 0x80000000 80000000: OK" \
751
  "!" \
752
  "!Test completed"                       \
753
  "!report(0xdeaddead);"                  \
754
  "!exit(0)"]                             \
755
    "inst-set-test.cfg" "inst-set-test/is-mac-test"
756 118 jeremybenn
 
757
# Run the l.mul test
758
run_or1ksim "mul-test"                                 \
759
    [list "!  ** OVE flag cleared **"                  \
760
          "!l.mul"                                     \
761
          "  0x00000002 * 0x00000003 = 0x00000006: OK" \
762
          "  - carry flag set:      FALSE"             \
763
          "  - overflow flag set:   FALSE"             \
764
          "  - exception triggered: FALSE"             \
765
          "  0x00008001 * 0x0000fffe = 0x7ffffffe: OK" \
766
          "  - carry flag set:      FALSE"             \
767
          "  - overflow flag set:   FALSE"             \
768
          "  - exception triggered: FALSE"             \
769
          "  0x00008000 * 0x00010000 = 0x80000000: OK" \
770
          "  - carry flag set:      FALSE"             \
771
          "  - overflow flag set:   TRUE"              \
772
          "  - exception triggered: FALSE"             \
773
          "  0x00010000 * 0x00010000 = 0x00000000: OK" \
774
          "  - carry flag set:      TRUE"              \
775
          "  - overflow flag set:   TRUE"              \
776
          "  - exception triggered: FALSE"             \
777
          "  0xfffffffe * 0xfffffffd = 0x00000006: OK" \
778
          "  - carry flag set:      TRUE"              \
779
          "  - overflow flag set:   FALSE"             \
780
          "  - exception triggered: FALSE"             \
781
          "  0xffff7fff * 0xffff0002 = 0x7ffffffe: OK" \
782
          "  - carry flag set:      TRUE"              \
783
          "  - overflow flag set:   FALSE"             \
784
          "  - exception triggered: FALSE"             \
785
          "  0xffff7fff * 0xffff0000 = 0x80010000: OK" \
786
          "  - carry flag set:      TRUE"              \
787
          "  - overflow flag set:   TRUE"              \
788
          "  - exception triggered: FALSE"             \
789
          "  0xffff0000 * 0xfffeffff = 0x00010000: OK" \
790
          "  - carry flag set:      TRUE"              \
791
          "  - overflow flag set:   TRUE"              \
792
          "  - exception triggered: FALSE"             \
793
          "  0x00000002 * 0xfffffffd = 0xfffffffa: OK" \
794
          "  - carry flag set:      TRUE"              \
795
          "  - overflow flag set:   FALSE"             \
796
          "  - exception triggered: FALSE"             \
797
          "  0xffff8000 * 0x00010000 = 0x80000000: OK" \
798
          "  - carry flag set:      TRUE"              \
799
          "  - overflow flag set:   FALSE"             \
800
          "  - exception triggered: FALSE"             \
801
          "  0xffff7fff * 0x00010000 = 0x7fff0000: OK" \
802
          "  - carry flag set:      TRUE"              \
803
          "  - overflow flag set:   TRUE"              \
804
          "  - exception triggered: FALSE"             \
805
          "  0x80000000 * 0x00000001 = 0x80000000: OK" \
806
          "  - carry flag set:      FALSE"             \
807
          "  - overflow flag set:   FALSE"             \
808
          "  - exception triggered: FALSE"             \
809
          "!  ** OVE flag set **"                      \
810
          "  RANGE exception"                          \
811
          "  0x00008000 * 0x00010000 = 0x80000000: OK" \
812
          "  - carry flag set:      FALSE"             \
813
          "  - overflow flag set:   TRUE"              \
814
          "  - exception triggered: TRUE"              \
815
          "  0x00000002 * 0xfffffffd = 0xfffffffa: OK" \
816
          "  - carry flag set:      TRUE"              \
817
          "  - overflow flag set:   FALSE"             \
818
          "  - exception triggered: FALSE"             \
819
          "  RANGE exception"                          \
820
          "  0xffff7fff * 0xffff0000 = 0x80010000: OK" \
821
          "  - carry flag set:      TRUE"              \
822
          "  - overflow flag set:   TRUE"              \
823
          "  - exception triggered: TRUE"              \
824
          "!  ** OVE flag cleared **"                  \
825
          "l.muli"                                     \
826
          "  0x00000002 * 0x0003 = 0x00000006: OK"     \
827
          "  - carry flag set:      FALSE"             \
828
          "  - overflow flag set:   FALSE"             \
829
          "  - exception triggered: FALSE"             \
830
          "  0x00010002 * 0x7fff = 0x7ffffffe: OK"     \
831
          "  - carry flag set:      FALSE"             \
832
          "  - overflow flag set:   FALSE"             \
833
          "  - exception triggered: FALSE"             \
834
          "  0x00020000 * 0x4000 = 0x80000000: OK"     \
835
          "  - carry flag set:      FALSE"             \
836
          "  - overflow flag set:   TRUE"              \
837
          "  - exception triggered: FALSE"             \
838
          "  0x00040000 * 0x4000 = 0x00000000: OK"     \
839
          "  - carry flag set:      TRUE"              \
840
          "  - overflow flag set:   TRUE"              \
841
          "  - exception triggered: FALSE"             \
842
          "  0xfffffffe * 0xfffd = 0x00000006: OK"     \
843
          "  - carry flag set:      TRUE"              \
844
          "  - overflow flag set:   FALSE"             \
845
          "  - exception triggered: FALSE"             \
846
          "  0xfffefffe * 0x8001 = 0x7ffffffe: OK"     \
847
          "  - carry flag set:      TRUE"              \
848
          "  - overflow flag set:   FALSE"             \
849
          "  - exception triggered: FALSE"             \
850
          "  0xfffe0000 * 0xbfff = 0x80020000: OK"     \
851
          "  - carry flag set:      TRUE"              \
852
          "  - overflow flag set:   TRUE"              \
853
          "  - exception triggered: FALSE"             \
854
          "  0xfffdfffe * 0x8000 = 0x00010000: OK"     \
855
          "  - carry flag set:      TRUE"              \
856
          "  - overflow flag set:   TRUE"              \
857
          "  - exception triggered: FALSE"             \
858
          "  0x00000002 * 0xfffd = 0xfffffffa: OK"     \
859
          "  - carry flag set:      TRUE"              \
860
          "  - overflow flag set:   FALSE"             \
861
          "  - exception triggered: FALSE"             \
862
          "  0x00010000 * 0x8000 = 0x80000000: OK"     \
863
          "  - carry flag set:      TRUE"              \
864
          "  - overflow flag set:   FALSE"             \
865
          "  - exception triggered: FALSE"             \
866
          "  0xfffdfffc * 0x4000 = 0x7fff0000: OK"     \
867
          "  - carry flag set:      TRUE"              \
868
          "  - overflow flag set:   TRUE"              \
869
          "  - exception triggered: FALSE"             \
870
          "  0x80000000 * 0x0001 = 0x80000000: OK"     \
871
          "  - carry flag set:      FALSE"             \
872
          "  - overflow flag set:   FALSE"             \
873
          "  - exception triggered: FALSE"             \
874
          "!  ** OVE flag set **"                      \
875
          "  RANGE exception"                          \
876
          "  0x00020000 * 0x4000 = 0x80000000: OK"     \
877
          "  - carry flag set:      FALSE"             \
878
          "  - overflow flag set:   TRUE"              \
879
          "  - exception triggered: TRUE"              \
880
          "  0xfffffffe * 0xfffd = 0x00000006: OK"     \
881
          "  - carry flag set:      TRUE"              \
882
          "  - overflow flag set:   FALSE"             \
883
          "  - exception triggered: FALSE"             \
884
          "  RANGE exception"                          \
885
          "  0xfffdfffe * 0x8000 = 0x00010000: OK"     \
886
          "  - carry flag set:      TRUE"              \
887
          "  - overflow flag set:   TRUE"              \
888
          "  - exception triggered: TRUE"              \
889
          "!  ** OVE flag cleared **"                  \
890
          "l.mulu"                                     \
891
          "  0x00000002 * 0x00000003 = 0x00000006: OK" \
892
          "  - carry flag set:      FALSE"             \
893
          "  - overflow flag set:   FALSE"             \
894
          "  - exception triggered: FALSE"             \
895
          "  0x00008001 * 0x0000fffe = 0x7ffffffe: OK" \
896
          "  - carry flag set:      FALSE"             \
897
          "  - overflow flag set:   FALSE"             \
898
          "  - exception triggered: FALSE"             \
899
          "  0x00008000 * 0x00010000 = 0x80000000: OK" \
900
          "  - carry flag set:      FALSE"             \
901
          "  - overflow flag set:   FALSE"             \
902
          "  - exception triggered: FALSE"             \
903
          "  0x00010000 * 0x00010000 = 0x00000000: OK" \
904
          "  - carry flag set:      TRUE"              \
905
          "  - overflow flag set:   FALSE"             \
906
          "  - exception triggered: FALSE"             \
907
          "  0xfffffffe * 0xfffffffd = 0x00000006: OK" \
908
          "  - carry flag set:      TRUE"              \
909
          "  - overflow flag set:   FALSE"             \
910
          "  - exception triggered: FALSE"             \
911
          "  0xffff7fff * 0xffff0002 = 0x7ffffffe: OK" \
912
          "  - carry flag set:      TRUE"              \
913
          "  - overflow flag set:   FALSE"             \
914
          "  - exception triggered: FALSE"             \
915
          "  0xffff7fff * 0xffff0000 = 0x80010000: OK" \
916
          "  - carry flag set:      TRUE"              \
917
          "  - overflow flag set:   FALSE"             \
918
          "  - exception triggered: FALSE"             \
919
          "  0xffff0000 * 0xfffeffff = 0x00010000: OK" \
920
          "  - carry flag set:      TRUE"              \
921
          "  - overflow flag set:   FALSE"             \
922
          "  - exception triggered: FALSE"             \
923
          "  0x00000002 * 0xfffffffd = 0xfffffffa: OK" \
924
          "  - carry flag set:      TRUE"              \
925
          "  - overflow flag set:   FALSE"             \
926
          "  - exception triggered: FALSE"             \
927
          "  0xffff8000 * 0x00010000 = 0x80000000: OK" \
928
          "  - carry flag set:      TRUE"              \
929
          "  - overflow flag set:   FALSE"             \
930
          "  - exception triggered: FALSE"             \
931
          "  0xffff7fff * 0x00010000 = 0x7fff0000: OK" \
932
          "  - carry flag set:      TRUE"              \
933
          "  - overflow flag set:   FALSE"             \
934
          "  - exception triggered: FALSE"             \
935
          "  0x80000000 * 0x00000001 = 0x80000000: OK" \
936
          "  - carry flag set:      FALSE"             \
937
          "  - overflow flag set:   FALSE"             \
938
          "  - exception triggered: FALSE"             \
939
          "!  ** OVE flag set **"                      \
940
          "  0x00008000 * 0x00010000 = 0x80000000: OK" \
941
          "  - carry flag set:      FALSE"             \
942
          "  - overflow flag set:   FALSE"             \
943
          "  - exception triggered: FALSE"             \
944
          "  0x00000002 * 0xfffffffd = 0xfffffffa: OK" \
945
          "  - carry flag set:      TRUE"              \
946
          "  - overflow flag set:   FALSE"             \
947
          "  - exception triggered: FALSE"             \
948
          "  0xffff7fff * 0xffff0000 = 0x80010000: OK" \
949
          "  - carry flag set:      TRUE"              \
950
          "  - overflow flag set:   FALSE"             \
951
          "  - exception triggered: FALSE"             \
952
          "!  ** OVE flag cleared **"                  \
953
          "!Test completed"                            \
954
          "!report(0xdeaddead);"                       \
955
          "!exit(0)"]                                  \
956
    "inst-set-test.cfg" "inst-set-test/is-mul-test"
957 122 jeremybenn
 
958 124 jeremybenn
# Run the l.or, and l.ori tests
959
run_or1ksim "or-test"                                  \
960
    [list "!  ** OVE flag set **"                      \
961
          "!l.or"                                      \
962
          "  0x00000000 | 0x00000000 = 0x00000000: OK" \
963
          "  - carry flag set:      FALSE"             \
964
          "  - overflow flag set:   FALSE"             \
965
          "  - exception triggered: FALSE"             \
966
          "  0xffffffff | 0xffffffff = 0xffffffff: OK" \
967
          "  - carry flag set:      FALSE"             \
968
          "  - overflow flag set:   FALSE"             \
969
          "  - exception triggered: FALSE"             \
970
          "  0xaaaaaaaa | 0x00000000 = 0xaaaaaaaa: OK" \
971
          "  - carry flag set:      FALSE"             \
972
          "  - overflow flag set:   FALSE"             \
973
          "  - exception triggered: FALSE"             \
974
          "  0xaaaaaaaa | 0xaaaaaaaa = 0xaaaaaaaa: OK" \
975
          "  - carry flag set:      FALSE"             \
976
          "  - overflow flag set:   FALSE"             \
977
          "  - exception triggered: FALSE"             \
978
          "  0x55555555 | 0x00000000 = 0x55555555: OK" \
979
          "  - carry flag set:      FALSE"             \
980
          "  - overflow flag set:   FALSE"             \
981
          "  - exception triggered: FALSE"             \
982
          "  0x55555555 | 0x55555555 = 0x55555555: OK" \
983
          "  - carry flag set:      FALSE"             \
984
          "  - overflow flag set:   FALSE"             \
985
          "  - exception triggered: FALSE"             \
986
          "  0xaaaaaaaa | 0x55555555 = 0xffffffff: OK" \
987
          "  - carry flag set:      FALSE"             \
988
          "  - overflow flag set:   FALSE"             \
989
          "  - exception triggered: FALSE"             \
990
          "  0x4c70f07c | 0xb38f0f83 = 0xffffffff: OK" \
991
          "  - carry flag set:      FALSE"             \
992
          "  - overflow flag set:   FALSE"             \
993
          "  - exception triggered: FALSE"             \
994
          "  0x4c70f07c | 0xc4c70f07 = 0xccf7ff7f: OK" \
995
          "  - carry flag set:      FALSE"             \
996
          "  - overflow flag set:   FALSE"             \
997
          "  - exception triggered: FALSE"             \
998
          "  0xb38f0f83 | 0x38f0f83b = 0xbbffffbb: OK" \
999
          "  - carry flag set:      FALSE"             \
1000
          "  - overflow flag set:   FALSE"             \
1001
          "  - exception triggered: FALSE"             \
1002
          "!l.ori"                                     \
1003
          "  0x00000000 | 0x0000 = 0x00000000: OK"     \
1004
          "  - carry flag set:      FALSE"             \
1005
          "  - overflow flag set:   FALSE"             \
1006
          "  - exception triggered: FALSE"             \
1007
          "  0xffffffff | 0xffff = 0xffffffff: OK"     \
1008
          "  - carry flag set:      FALSE"             \
1009
          "  - overflow flag set:   FALSE"             \
1010
          "  - exception triggered: FALSE"             \
1011
          "  0xaaaaaaaa | 0x0000 = 0xaaaaaaaa: OK"     \
1012
          "  - carry flag set:      FALSE"             \
1013
          "  - overflow flag set:   FALSE"             \
1014
          "  - exception triggered: FALSE"             \
1015
          "  0xaaaaaaaa | 0xaaaa = 0xaaaaaaaa: OK"     \
1016
          "  - carry flag set:      FALSE"             \
1017
          "  - overflow flag set:   FALSE"             \
1018
          "  - exception triggered: FALSE"             \
1019
          "  0x55555555 | 0x0000 = 0x55555555: OK"     \
1020
          "  - carry flag set:      FALSE"             \
1021
          "  - overflow flag set:   FALSE"             \
1022
          "  - exception triggered: FALSE"             \
1023
          "  0x55555555 | 0x5555 = 0x55555555: OK"     \
1024
          "  - carry flag set:      FALSE"             \
1025
          "  - overflow flag set:   FALSE"             \
1026
          "  - exception triggered: FALSE"             \
1027
          "  0xaaaaaaaa | 0x5555 = 0xaaaaffff: OK"     \
1028
          "  - carry flag set:      FALSE"             \
1029
          "  - overflow flag set:   FALSE"             \
1030
          "  - exception triggered: FALSE"             \
1031
          "  0x4c70f07c | 0x0f83 = 0x4c70ffff: OK"     \
1032
          "  - carry flag set:      FALSE"             \
1033
          "  - overflow flag set:   FALSE"             \
1034
          "  - exception triggered: FALSE"             \
1035
          "  0x4c70f07c | 0x0f07 = 0x4c70ff7f: OK"     \
1036
          "  - carry flag set:      FALSE"             \
1037
          "  - overflow flag set:   FALSE"             \
1038
          "  - exception triggered: FALSE"             \
1039
          "  0xb38f0f83 | 0xf83b = 0xb38fffbb: OK"     \
1040
          "  - carry flag set:      FALSE"             \
1041
          "  - overflow flag set:   FALSE"             \
1042
          "  - exception triggered: FALSE"             \
1043
          "!Test completed"                            \
1044
          "!report(0xdeaddead);"                       \
1045
          "!exit(0)"]                                  \
1046
    "inst-set-test.cfg" "inst-set-test/is-or-test"
1047
 
1048 122 jeremybenn
# Run the l.ror test
1049
run_or1ksim "ror-test"                                   \
1050
    [list "!l.ror"                                       \
1051
          "  0xb38f0f83 ROR 0x00000000 = 0xb38f0f83: OK" \
1052
          "  - exception triggered: FALSE"               \
1053
          "  0xb38f0f83 ROR 0x00000001 = 0xd9c787c1: OK" \
1054
          "  - exception triggered: FALSE"               \
1055
          "  0xb38f0f83 ROR 0x00000004 = 0x3b38f0f8: OK" \
1056
          "  - exception triggered: FALSE"               \
1057
          "  0xb38f0f83 ROR 0x00000010 = 0x0f83b38f: OK" \
1058
          "  - exception triggered: FALSE"               \
1059
          "  0xb38f0f83 ROR 0x0000001f = 0x671e1f07: OK" \
1060
          "  - exception triggered: FALSE"               \
1061
          "  0xb38f0f83 ROR 0x00000021 = 0xd9c787c1: OK" \
1062
          "  - exception triggered: FALSE"               \
1063
          "  0xb38f0f83 ROR 0x00002224 = 0x3b38f0f8: OK" \
1064
          "  - exception triggered: FALSE"               \
1065
          "  0xb38f0f83 ROR 0x00f789f0 = 0x0f83b38f: OK" \
1066
          "  - exception triggered: FALSE"               \
1067
          "  0xb38f0f83 ROR 0xffffffff = 0x671e1f07: OK" \
1068
          "  - exception triggered: FALSE"               \
1069
          "!l.rori"                                      \
1070
          "  0xb38f0f83 RORI 0x00 = 0xb38f0f83: OK"      \
1071
          "  - exception triggered: FALSE"               \
1072
          "  0xb38f0f83 RORI 0x01 = 0xd9c787c1: OK"      \
1073
          "  - exception triggered: FALSE"               \
1074
          "  0xb38f0f83 RORI 0x04 = 0x3b38f0f8: OK"      \
1075
          "  - exception triggered: FALSE"               \
1076
          "  0xb38f0f83 RORI 0x10 = 0x0f83b38f: OK"      \
1077
          "  - exception triggered: FALSE"               \
1078
          "  0xb38f0f83 RORI 0x1f = 0x671e1f07: OK"      \
1079
          "  - exception triggered: FALSE"               \
1080
          "  0xb38f0f83 RORI 0x21 = 0xd9c787c1: OK"      \
1081
          "  - exception triggered: FALSE"               \
1082
          "  0xb38f0f83 RORI 0x24 = 0x3b38f0f8: OK"      \
1083
          "  - exception triggered: FALSE"               \
1084
          "  0xb38f0f83 RORI 0x30 = 0x0f83b38f: OK"      \
1085
          "  - exception triggered: FALSE"               \
1086
          "  0xb38f0f83 RORI 0x3f = 0x671e1f07: OK"      \
1087
          "  - exception triggered: FALSE"               \
1088
          "!Test completed"                              \
1089
          "!report(0xdeaddead);"                         \
1090
          "!exit(0)"]                                    \
1091
    "inst-set-test.cfg" "inst-set-test/is-ror-test"
1092 123 jeremybenn
 
1093
# Run the l.mfspr and l.mtspr test
1094
run_or1ksim "spr-test"                         \
1095
    [list "!l.mfspr"                           \
1096
          "  l.mfspr  0x00000000 | 0x2801: OK" \
1097
          "  - exception triggered: FALSE"     \
1098
          "  l.mfspr  0x00002801 | 0x0000: OK" \
1099
          "  - exception triggered: FALSE"     \
1100
          "  l.mfspr  0x00002801 | 0x2801: OK" \
1101
          "  - exception triggered: FALSE"     \
1102
          "  l.mfspr  0x00000801 | 0x2000: OK" \
1103
          "  - exception triggered: FALSE"     \
1104
          "  l.mfspr  0x00002000 | 0x0801: OK" \
1105
          "  - exception triggered: FALSE"     \
1106
          "  l.mfspr  0x00002801 | 0x0001: OK" \
1107
          "  - exception triggered: FALSE"     \
1108
          "  l.mfspr  0x00000800 | 0x2801: OK" \
1109
          "  - exception triggered: FALSE"     \
1110
          "!l.mtspr"                           \
1111
          "  l.mtspr  0x00000000 | 0x2801: OK" \
1112
          "  - exception triggered: FALSE"     \
1113
          "  l.mtspr  0x00002801 | 0x0000: OK" \
1114
          "  - exception triggered: FALSE"     \
1115
          "  l.mtspr  0x00002801 | 0x2801: OK" \
1116
          "  - exception triggered: FALSE"     \
1117
          "  l.mtspr  0x00000801 | 0x2000: OK" \
1118
          "  - exception triggered: FALSE"     \
1119
          "  l.mtspr  0x00002000 | 0x0801: OK" \
1120
          "  - exception triggered: FALSE"     \
1121
          "  l.mtspr  0x00002801 | 0x0001: OK" \
1122
          "  - exception triggered: FALSE"     \
1123
          "  l.mtspr  0x00000800 | 0x2801: OK" \
1124
          "  - exception triggered: FALSE"     \
1125
          "!Test completed"                    \
1126
          "!report(0xdeaddead);"               \
1127
          "!exit(0)"]                          \
1128
    "inst-set-test.cfg" "inst-set-test/is-spr-test"
1129 124 jeremybenn
 
1130
# Run the shift tests
1131
run_or1ksim "shift-test"                                        \
1132
    [list "!  ** OVE flag set **"                               \
1133
          "!l.sll"                                              \
1134
          "  0xb38f0f83 shifted by 0x00000000 = 0xb38f0f83: OK" \
1135
          "  - carry flag set:      FALSE"                      \
1136
          "  - overflow flag set:   FALSE"                      \
1137
          "  - exception triggered: FALSE"                      \
1138
          "  0xb38f0f83 shifted by 0x00000001 = 0x671e1f06: OK" \
1139
          "  - carry flag set:      FALSE"                      \
1140
          "  - overflow flag set:   FALSE"                      \
1141
          "  - exception triggered: FALSE"                      \
1142
          "  0xb38f0f83 shifted by 0x00000004 = 0x38f0f830: OK" \
1143
          "  - carry flag set:      FALSE"                      \
1144
          "  - overflow flag set:   FALSE"                      \
1145
          "  - exception triggered: FALSE"                      \
1146
          "  0xb38f0f83 shifted by 0x00000010 = 0x0f830000: OK" \
1147
          "  - carry flag set:      FALSE"                      \
1148
          "  - overflow flag set:   FALSE"                      \
1149
          "  - exception triggered: FALSE"                      \
1150
          "  0xb38f0f83 shifted by 0x0000001f = 0x80000000: OK" \
1151
          "  - carry flag set:      FALSE"                      \
1152
          "  - overflow flag set:   FALSE"                      \
1153
          "  - exception triggered: FALSE"                      \
1154
          "  0xb38f0f83 shifted by 0x00000021 = 0x671e1f06: OK" \
1155
          "  - carry flag set:      FALSE"                      \
1156
          "  - overflow flag set:   FALSE"                      \
1157
          "  - exception triggered: FALSE"                      \
1158
          "  0xb38f0f83 shifted by 0x00002224 = 0x38f0f830: OK" \
1159
          "  - carry flag set:      FALSE"                      \
1160
          "  - overflow flag set:   FALSE"                      \
1161
          "  - exception triggered: FALSE"                      \
1162
          "  0xb38f0f83 shifted by 0x00f789f0 = 0x0f830000: OK" \
1163
          "  - carry flag set:      FALSE"                      \
1164
          "  - overflow flag set:   FALSE"                      \
1165
          "  - exception triggered: FALSE"                      \
1166
          "  0xb38f0f83 shifted by 0xffffffff = 0x80000000: OK" \
1167
          "  - carry flag set:      FALSE"                      \
1168
          "  - overflow flag set:   FALSE"                      \
1169
          "  - exception triggered: FALSE"                      \
1170
          "!l.slli"                                             \
1171
          "  0xb38f0f83 shifted by 0x0000 = 0xb38f0f83: OK"     \
1172
          "  - carry flag set:      FALSE"                      \
1173
          "  - overflow flag set:   FALSE"                      \
1174
          "  - exception triggered: FALSE"                      \
1175
          "  0xb38f0f83 shifted by 0x0001 = 0x671e1f06: OK"     \
1176
          "  - carry flag set:      FALSE"                      \
1177
          "  - overflow flag set:   FALSE"                      \
1178
          "  - exception triggered: FALSE"                      \
1179
          "  0xb38f0f83 shifted by 0x0004 = 0x38f0f830: OK"     \
1180
          "  - carry flag set:      FALSE"                      \
1181
          "  - overflow flag set:   FALSE"                      \
1182
          "  - exception triggered: FALSE"                      \
1183
          "  0xb38f0f83 shifted by 0x0010 = 0x0f830000: OK"     \
1184
          "  - carry flag set:      FALSE"                      \
1185
          "  - overflow flag set:   FALSE"                      \
1186
          "  - exception triggered: FALSE"                      \
1187
          "  0xb38f0f83 shifted by 0x001f = 0x80000000: OK"     \
1188
          "  - carry flag set:      FALSE"                      \
1189
          "  - overflow flag set:   FALSE"                      \
1190
          "  - exception triggered: FALSE"                      \
1191
          "  0xb38f0f83 shifted by 0x0021 = 0x671e1f06: OK"     \
1192
          "  - carry flag set:      FALSE"                      \
1193
          "  - overflow flag set:   FALSE"                      \
1194
          "  - exception triggered: FALSE"                      \
1195
          "  0xb38f0f83 shifted by 0x0024 = 0x38f0f830: OK"     \
1196
          "  - carry flag set:      FALSE"                      \
1197
          "  - overflow flag set:   FALSE"                      \
1198
          "  - exception triggered: FALSE"                      \
1199
          "  0xb38f0f83 shifted by 0x0030 = 0x0f830000: OK"     \
1200
          "  - carry flag set:      FALSE"                      \
1201
          "  - overflow flag set:   FALSE"                      \
1202
          "  - exception triggered: FALSE"                      \
1203
          "  0xb38f0f83 shifted by 0x003f = 0x80000000: OK"     \
1204
          "  - carry flag set:      FALSE"                      \
1205
          "  - overflow flag set:   FALSE"                      \
1206
          "  - exception triggered: FALSE"                      \
1207
          "!l.sra"                                              \
1208
          "  0xb38f0f83 shifted by 0x00000000 = 0xb38f0f83: OK" \
1209
          "  - carry flag set:      FALSE"                      \
1210
          "  - overflow flag set:   FALSE"                      \
1211
          "  - exception triggered: FALSE"                      \
1212
          "  0xb38f0f83 shifted by 0x00000001 = 0xd9c787c1: OK" \
1213
          "  - carry flag set:      FALSE"                      \
1214
          "  - overflow flag set:   FALSE"                      \
1215
          "  - exception triggered: FALSE"                      \
1216
          "  0xb38f0f83 shifted by 0x00000004 = 0xfb38f0f8: OK" \
1217
          "  - carry flag set:      FALSE"                      \
1218
          "  - overflow flag set:   FALSE"                      \
1219
          "  - exception triggered: FALSE"                      \
1220
          "  0xb38f0f83 shifted by 0x00000010 = 0xffffb38f: OK" \
1221
          "  - carry flag set:      FALSE"                      \
1222
          "  - overflow flag set:   FALSE"                      \
1223
          "  - exception triggered: FALSE"                      \
1224
          "  0xb38f0f83 shifted by 0x0000001f = 0xffffffff: OK" \
1225
          "  - carry flag set:      FALSE"                      \
1226
          "  - overflow flag set:   FALSE"                      \
1227
          "  - exception triggered: FALSE"                      \
1228
          "  0x4c70f07c shifted by 0x00000001 = 0x2638783e: OK" \
1229
          "  - carry flag set:      FALSE"                      \
1230
          "  - overflow flag set:   FALSE"                      \
1231
          "  - exception triggered: FALSE"                      \
1232
          "  0x4c70f07c shifted by 0x00000004 = 0x04c70f07: OK" \
1233
          "  - carry flag set:      FALSE"                      \
1234
          "  - overflow flag set:   FALSE"                      \
1235
          "  - exception triggered: FALSE"                      \
1236
          "  0x4c70f07c shifted by 0x00000010 = 0x00004c70: OK" \
1237
          "  - carry flag set:      FALSE"                      \
1238
          "  - overflow flag set:   FALSE"                      \
1239
          "  - exception triggered: FALSE"                      \
1240
          "  0x4c70f07c shifted by 0x0000001f = 0x00000000: OK" \
1241
          "  - carry flag set:      FALSE"                      \
1242
          "  - overflow flag set:   FALSE"                      \
1243
          "  - exception triggered: FALSE"                      \
1244
          "  0xb38f0f83 shifted by 0x00000021 = 0xd9c787c1: OK" \
1245
          "  - carry flag set:      FALSE"                      \
1246
          "  - overflow flag set:   FALSE"                      \
1247
          "  - exception triggered: FALSE"                      \
1248
          "  0xb38f0f83 shifted by 0x00002224 = 0xfb38f0f8: OK" \
1249
          "  - carry flag set:      FALSE"                      \
1250
          "  - overflow flag set:   FALSE"                      \
1251
          "  - exception triggered: FALSE"                      \
1252
          "  0xb38f0f83 shifted by 0x00f789f0 = 0xffffb38f: OK" \
1253
          "  - carry flag set:      FALSE"                      \
1254
          "  - overflow flag set:   FALSE"                      \
1255
          "  - exception triggered: FALSE"                      \
1256
          "  0xb38f0f83 shifted by 0xffffffff = 0xffffffff: OK" \
1257
          "  - carry flag set:      FALSE"                      \
1258
          "  - overflow flag set:   FALSE"                      \
1259
          "  - exception triggered: FALSE"                      \
1260
          "  0x4c70f07c shifted by 0x00000021 = 0x2638783e: OK" \
1261
          "  - carry flag set:      FALSE"                      \
1262
          "  - overflow flag set:   FALSE"                      \
1263
          "  - exception triggered: FALSE"                      \
1264
          "  0x4c70f07c shifted by 0x00002224 = 0x04c70f07: OK" \
1265
          "  - carry flag set:      FALSE"                      \
1266
          "  - overflow flag set:   FALSE"                      \
1267
          "  - exception triggered: FALSE"                      \
1268
          "  0x4c70f07c shifted by 0x00f789f0 = 0x00004c70: OK" \
1269
          "  - carry flag set:      FALSE"                      \
1270
          "  - overflow flag set:   FALSE"                      \
1271
          "  - exception triggered: FALSE"                      \
1272
          "  0x4c70f07c shifted by 0xffffffff = 0x00000000: OK" \
1273
          "  - carry flag set:      FALSE"                      \
1274
          "  - overflow flag set:   FALSE"                      \
1275
          "  - exception triggered: FALSE"                      \
1276
          "!l.srai"                                             \
1277
          "  0xb38f0f83 shifted by 0x0000 = 0xb38f0f83: OK"     \
1278
          "  - carry flag set:      FALSE"                      \
1279
          "  - overflow flag set:   FALSE"                      \
1280
          "  - exception triggered: FALSE"                      \
1281
          "  0xb38f0f83 shifted by 0x0001 = 0xd9c787c1: OK"     \
1282
          "  - carry flag set:      FALSE"                      \
1283
          "  - overflow flag set:   FALSE"                      \
1284
          "  - exception triggered: FALSE"                      \
1285
          "  0xb38f0f83 shifted by 0x0004 = 0xfb38f0f8: OK"     \
1286
          "  - carry flag set:      FALSE"                      \
1287
          "  - overflow flag set:   FALSE"                      \
1288
          "  - exception triggered: FALSE"                      \
1289
          "  0xb38f0f83 shifted by 0x0010 = 0xffffb38f: OK"     \
1290
          "  - carry flag set:      FALSE"                      \
1291
          "  - overflow flag set:   FALSE"                      \
1292
          "  - exception triggered: FALSE"                      \
1293
          "  0xb38f0f83 shifted by 0x001f = 0xffffffff: OK"     \
1294
          "  - carry flag set:      FALSE"                      \
1295
          "  - overflow flag set:   FALSE"                      \
1296
          "  - exception triggered: FALSE"                      \
1297
          "  0x4c70f07c shifted by 0x0001 = 0x2638783e: OK"     \
1298
          "  - carry flag set:      FALSE"                      \
1299
          "  - overflow flag set:   FALSE"                      \
1300
          "  - exception triggered: FALSE"                      \
1301
          "  0x4c70f07c shifted by 0x0004 = 0x04c70f07: OK"     \
1302
          "  - carry flag set:      FALSE"                      \
1303
          "  - overflow flag set:   FALSE"                      \
1304
          "  - exception triggered: FALSE"                      \
1305
          "  0x4c70f07c shifted by 0x0010 = 0x00004c70: OK"     \
1306
          "  - carry flag set:      FALSE"                      \
1307
          "  - overflow flag set:   FALSE"                      \
1308
          "  - exception triggered: FALSE"                      \
1309
          "  0x4c70f07c shifted by 0x001f = 0x00000000: OK"     \
1310
          "  - carry flag set:      FALSE"                      \
1311
          "  - overflow flag set:   FALSE"                      \
1312
          "  - exception triggered: FALSE"                      \
1313
          "  0xb38f0f83 shifted by 0x0021 = 0xd9c787c1: OK"     \
1314
          "  - carry flag set:      FALSE"                      \
1315
          "  - overflow flag set:   FALSE"                      \
1316
          "  - exception triggered: FALSE"                      \
1317
          "  0xb38f0f83 shifted by 0x0024 = 0xfb38f0f8: OK"     \
1318
          "  - carry flag set:      FALSE"                      \
1319
          "  - overflow flag set:   FALSE"                      \
1320
          "  - exception triggered: FALSE"                      \
1321
          "  0xb38f0f83 shifted by 0x0030 = 0xffffb38f: OK"     \
1322
          "  - carry flag set:      FALSE"                      \
1323
          "  - overflow flag set:   FALSE"                      \
1324
          "  - exception triggered: FALSE"                      \
1325
          "  0xb38f0f83 shifted by 0x003f = 0xffffffff: OK"     \
1326
          "  - carry flag set:      FALSE"                      \
1327
          "  - overflow flag set:   FALSE"                      \
1328
          "  - exception triggered: FALSE"                      \
1329
          "  0x4c70f07c shifted by 0x0021 = 0x2638783e: OK"     \
1330
          "  - carry flag set:      FALSE"                      \
1331
          "  - overflow flag set:   FALSE"                      \
1332
          "  - exception triggered: FALSE"                      \
1333
          "  0x4c70f07c shifted by 0x0024 = 0x04c70f07: OK"     \
1334
          "  - carry flag set:      FALSE"                      \
1335
          "  - overflow flag set:   FALSE"                      \
1336
          "  - exception triggered: FALSE"                      \
1337
          "  0x4c70f07c shifted by 0x0030 = 0x00004c70: OK"     \
1338
          "  - carry flag set:      FALSE"                      \
1339
          "  - overflow flag set:   FALSE"                      \
1340
          "  - exception triggered: FALSE"                      \
1341
          "  0x4c70f07c shifted by 0x003f = 0x00000000: OK"     \
1342
          "  - carry flag set:      FALSE"                      \
1343
          "  - overflow flag set:   FALSE"                      \
1344
          "  - exception triggered: FALSE"                      \
1345
          "!l.srl"                                              \
1346
          "  0xb38f0f83 shifted by 0x00000000 = 0xb38f0f83: OK" \
1347
          "  - carry flag set:      FALSE"                      \
1348
          "  - overflow flag set:   FALSE"                      \
1349
          "  - exception triggered: FALSE"                      \
1350
          "  0xb38f0f83 shifted by 0x00000001 = 0x59c787c1: OK" \
1351
          "  - carry flag set:      FALSE"                      \
1352
          "  - overflow flag set:   FALSE"                      \
1353
          "  - exception triggered: FALSE"                      \
1354
          "  0xb38f0f83 shifted by 0x00000004 = 0x0b38f0f8: OK" \
1355
          "  - carry flag set:      FALSE"                      \
1356
          "  - overflow flag set:   FALSE"                      \
1357
          "  - exception triggered: FALSE"                      \
1358
          "  0xb38f0f83 shifted by 0x00000010 = 0x0000b38f: OK" \
1359
          "  - carry flag set:      FALSE"                      \
1360
          "  - overflow flag set:   FALSE"                      \
1361
          "  - exception triggered: FALSE"                      \
1362
          "  0xb38f0f83 shifted by 0x0000001f = 0x00000001: OK" \
1363
          "  - carry flag set:      FALSE"                      \
1364
          "  - overflow flag set:   FALSE"                      \
1365
          "  - exception triggered: FALSE"                      \
1366
          "  0x4c70f07c shifted by 0x00000001 = 0x2638783e: OK" \
1367
          "  - carry flag set:      FALSE"                      \
1368
          "  - overflow flag set:   FALSE"                      \
1369
          "  - exception triggered: FALSE"                      \
1370
          "  0x4c70f07c shifted by 0x00000004 = 0x04c70f07: OK" \
1371
          "  - carry flag set:      FALSE"                      \
1372
          "  - overflow flag set:   FALSE"                      \
1373
          "  - exception triggered: FALSE"                      \
1374
          "  0x4c70f07c shifted by 0x00000010 = 0x00004c70: OK" \
1375
          "  - carry flag set:      FALSE"                      \
1376
          "  - overflow flag set:   FALSE"                      \
1377
          "  - exception triggered: FALSE"                      \
1378
          "  0x4c70f07c shifted by 0x0000001f = 0x00000000: OK" \
1379
          "  - carry flag set:      FALSE"                      \
1380
          "  - overflow flag set:   FALSE"                      \
1381
          "  - exception triggered: FALSE"                      \
1382
          "  0xb38f0f83 shifted by 0x00000021 = 0x59c787c1: OK" \
1383
          "  - carry flag set:      FALSE"                      \
1384
          "  - overflow flag set:   FALSE"                      \
1385
          "  - exception triggered: FALSE"                      \
1386
          "  0xb38f0f83 shifted by 0x00002224 = 0x0b38f0f8: OK" \
1387
          "  - carry flag set:      FALSE"                      \
1388
          "  - overflow flag set:   FALSE"                      \
1389
          "  - exception triggered: FALSE"                      \
1390
          "  0xb38f0f83 shifted by 0x00f789f0 = 0x0000b38f: OK" \
1391
          "  - carry flag set:      FALSE"                      \
1392
          "  - overflow flag set:   FALSE"                      \
1393
          "  - exception triggered: FALSE"                      \
1394
          "  0xb38f0f83 shifted by 0xffffffff = 0x00000001: OK" \
1395
          "  - carry flag set:      FALSE"                      \
1396
          "  - overflow flag set:   FALSE"                      \
1397
          "  - exception triggered: FALSE"                      \
1398
          "  0x4c70f07c shifted by 0x00000021 = 0x2638783e: OK" \
1399
          "  - carry flag set:      FALSE"                      \
1400
          "  - overflow flag set:   FALSE"                      \
1401
          "  - exception triggered: FALSE"                      \
1402
          "  0x4c70f07c shifted by 0x00002224 = 0x04c70f07: OK" \
1403
          "  - carry flag set:      FALSE"                      \
1404
          "  - overflow flag set:   FALSE"                      \
1405
          "  - exception triggered: FALSE"                      \
1406
          "  0x4c70f07c shifted by 0x00f789f0 = 0x00004c70: OK" \
1407
          "  - carry flag set:      FALSE"                      \
1408
          "  - overflow flag set:   FALSE"                      \
1409
          "  - exception triggered: FALSE"                      \
1410
          "  0x4c70f07c shifted by 0xffffffff = 0x00000000: OK" \
1411
          "  - carry flag set:      FALSE"                      \
1412
          "  - overflow flag set:   FALSE"                      \
1413
          "  - exception triggered: FALSE"                      \
1414
          "!l.srli"                                             \
1415
          "  0xb38f0f83 shifted by 0x0000 = 0xb38f0f83: OK"     \
1416
          "  - carry flag set:      FALSE"                      \
1417
          "  - overflow flag set:   FALSE"                      \
1418
          "  - exception triggered: FALSE"                      \
1419
          "  0xb38f0f83 shifted by 0x0001 = 0x59c787c1: OK"     \
1420
          "  - carry flag set:      FALSE"                      \
1421
          "  - overflow flag set:   FALSE"                      \
1422
          "  - exception triggered: FALSE"                      \
1423
          "  0xb38f0f83 shifted by 0x0004 = 0x0b38f0f8: OK"     \
1424
          "  - carry flag set:      FALSE"                      \
1425
          "  - overflow flag set:   FALSE"                      \
1426
          "  - exception triggered: FALSE"                      \
1427
          "  0xb38f0f83 shifted by 0x0010 = 0x0000b38f: OK"     \
1428
          "  - carry flag set:      FALSE"                      \
1429
          "  - overflow flag set:   FALSE"                      \
1430
          "  - exception triggered: FALSE"                      \
1431
          "  0xb38f0f83 shifted by 0x001f = 0x00000001: OK"     \
1432
          "  - carry flag set:      FALSE"                      \
1433
          "  - overflow flag set:   FALSE"                      \
1434
          "  - exception triggered: FALSE"                      \
1435
          "  0x4c70f07c shifted by 0x0001 = 0x2638783e: OK"     \
1436
          "  - carry flag set:      FALSE"                      \
1437
          "  - overflow flag set:   FALSE"                      \
1438
          "  - exception triggered: FALSE"                      \
1439
          "  0x4c70f07c shifted by 0x0004 = 0x04c70f07: OK"     \
1440
          "  - carry flag set:      FALSE"                      \
1441
          "  - overflow flag set:   FALSE"                      \
1442
          "  - exception triggered: FALSE"                      \
1443
          "  0x4c70f07c shifted by 0x0010 = 0x00004c70: OK"     \
1444
          "  - carry flag set:      FALSE"                      \
1445
          "  - overflow flag set:   FALSE"                      \
1446
          "  - exception triggered: FALSE"                      \
1447
          "  0x4c70f07c shifted by 0x001f = 0x00000000: OK"     \
1448
          "  - carry flag set:      FALSE"                      \
1449
          "  - overflow flag set:   FALSE"                      \
1450
          "  - exception triggered: FALSE"                      \
1451
          "  0xb38f0f83 shifted by 0x0021 = 0x59c787c1: OK"     \
1452
          "  - carry flag set:      FALSE"                      \
1453
          "  - overflow flag set:   FALSE"                      \
1454
          "  - exception triggered: FALSE"                      \
1455
          "  0xb38f0f83 shifted by 0x0024 = 0x0b38f0f8: OK"     \
1456
          "  - carry flag set:      FALSE"                      \
1457
          "  - overflow flag set:   FALSE"                      \
1458
          "  - exception triggered: FALSE"                      \
1459
          "  0xb38f0f83 shifted by 0x0030 = 0x0000b38f: OK"     \
1460
          "  - carry flag set:      FALSE"                      \
1461
          "  - overflow flag set:   FALSE"                      \
1462
          "  - exception triggered: FALSE"                      \
1463
          "  0xb38f0f83 shifted by 0x003f = 0x00000001: OK"     \
1464
          "  - carry flag set:      FALSE"                      \
1465
          "  - overflow flag set:   FALSE"                      \
1466
          "  - exception triggered: FALSE"                      \
1467
          "  0x4c70f07c shifted by 0x0021 = 0x2638783e: OK"     \
1468
          "  - carry flag set:      FALSE"                      \
1469
          "  - overflow flag set:   FALSE"                      \
1470
          "  - exception triggered: FALSE"                      \
1471
          "  0x4c70f07c shifted by 0x0024 = 0x04c70f07: OK"     \
1472
          "  - carry flag set:      FALSE"                      \
1473
          "  - overflow flag set:   FALSE"                      \
1474
          "  - exception triggered: FALSE"                      \
1475
          "  0x4c70f07c shifted by 0x0030 = 0x00004c70: OK"     \
1476
          "  - carry flag set:      FALSE"                      \
1477
          "  - overflow flag set:   FALSE"                      \
1478
          "  - exception triggered: FALSE"                      \
1479
          "  0x4c70f07c shifted by 0x003f = 0x00000000: OK"     \
1480
          "  - carry flag set:      FALSE"                      \
1481
          "  - overflow flag set:   FALSE"                      \
1482
          "  - exception triggered: FALSE"                      \
1483
          "!Test completed"                                     \
1484
          "!report(0xdeaddead);"                                \
1485
          "!exit(0)"]                                           \
1486
    "inst-set-test.cfg" "inst-set-test/is-shift-test"
1487
 
1488
# Run the l.sub test
1489
run_or1ksim "sub-test"                         \
1490
    [list "!  ** OVE flag cleared **" \
1491
          "!l.sub" \
1492
          "  0x00000003 - 0x00000002 = 0x00000001: OK" \
1493
          "  - carry flag set:      FALSE"             \
1494
          "  - overflow flag set:   FALSE"             \
1495
          "  - exception triggered: FALSE"             \
1496
          "  0x00000001 - 0x00000002 = 0xffffffff: OK" \
1497
          "  - carry flag set:      TRUE"              \
1498
          "  - overflow flag set:   FALSE"             \
1499
          "  - exception triggered: FALSE"             \
1500
          "  0x00000003 - 0x00000002 = 0x00000001: OK" \
1501
          "  - carry flag set:      FALSE"             \
1502
          "  - overflow flag set:   FALSE"             \
1503
          "  - exception triggered: FALSE"             \
1504
          "  0xfffffffd - 0xfffffffe = 0xffffffff: OK" \
1505
          "  - carry flag set:      TRUE"              \
1506
          "  - overflow flag set:   FALSE"             \
1507
          "  - exception triggered: FALSE"             \
1508
          "  0xffffffff - 0xfffffffe = 0x00000001: OK" \
1509
          "  - carry flag set:      FALSE"             \
1510
          "  - overflow flag set:   FALSE"             \
1511
          "  - exception triggered: FALSE"             \
1512
          "  0x7fffffff - 0x3fffffff = 0x40000000: OK" \
1513
          "  - carry flag set:      FALSE"             \
1514
          "  - overflow flag set:   FALSE"             \
1515
          "  - exception triggered: FALSE"             \
1516
          "  0x40000000 - 0x40000000 = 0x00000000: OK" \
1517
          "  - carry flag set:      FALSE"             \
1518
          "  - overflow flag set:   FALSE"             \
1519
          "  - exception triggered: FALSE"             \
1520
          "  0x3fffffff - 0x40000000 = 0xffffffff: OK" \
1521
          "  - carry flag set:      TRUE"              \
1522
          "  - overflow flag set:   FALSE"             \
1523
          "  - exception triggered: FALSE"             \
1524
          "  0x40000000 - 0x3fffffff = 0x00000001: OK" \
1525
          "  - carry flag set:      FALSE"             \
1526
          "  - overflow flag set:   FALSE"             \
1527
          "  - exception triggered: FALSE"             \
1528
          "  0x80000000 - 0x7fffffff = 0x00000001: OK" \
1529
          "  - carry flag set:      FALSE"             \
1530
          "  - overflow flag set:   TRUE"              \
1531
          "  - exception triggered: FALSE"             \
1532
          "  0x7fffffff - 0x80000000 = 0xffffffff: OK" \
1533
          "  - carry flag set:      TRUE"              \
1534
          "  - overflow flag set:   TRUE"              \
1535
          "  - exception triggered: FALSE"             \
1536
          "!  ** OVE flag set **"                      \
1537
          "  RANGE exception"                          \
1538
          "  0x80000000 - 0x7fffffff = 0x00000001: OK" \
1539
          "  - carry flag set:      FALSE"             \
1540
          "  - overflow flag set:   TRUE"              \
1541
          "  - exception triggered: TRUE"              \
1542
          "  0x3fffffff - 0x40000000 = 0xffffffff: OK" \
1543
          "  - carry flag set:      TRUE"              \
1544
          "  - overflow flag set:   FALSE"             \
1545
          "  - exception triggered: FALSE"             \
1546
          "  RANGE exception"                          \
1547
          "  0x7fffffff - 0x80000000 = 0xffffffff: OK" \
1548
          "  - carry flag set:      TRUE"              \
1549
          "  - overflow flag set:   TRUE"              \
1550
          "  - exception triggered: TRUE"              \
1551
          "!  ** OVE flag cleared **"                  \
1552
          "!Test completed"                            \
1553
          "!report(0xdeaddead);"                       \
1554
          "!exit(0)"]                                  \
1555
    "inst-set-test.cfg" "inst-set-test/is-sub-test"
1556
 
1557
# Run the l.xor test
1558
run_or1ksim "xor-test"                                 \
1559
    [list "!  ** OVE flag set **"                      \
1560
          "!l.xor"                                     \
1561
          "  0x00000000 ^ 0x00000000 = 0x00000000: OK" \
1562
          "  - carry flag set:      FALSE"             \
1563
          "  - overflow flag set:   FALSE"             \
1564
          "  - exception triggered: FALSE"             \
1565
          "  0xffffffff ^ 0xffffffff = 0x00000000: OK" \
1566
          "  - carry flag set:      FALSE"             \
1567
          "  - overflow flag set:   FALSE"             \
1568
          "  - exception triggered: FALSE"             \
1569
          "  0xaaaaaaaa ^ 0x00000000 = 0xaaaaaaaa: OK" \
1570
          "  - carry flag set:      FALSE"             \
1571
          "  - overflow flag set:   FALSE"             \
1572
          "  - exception triggered: FALSE"             \
1573
          "  0xaaaaaaaa ^ 0xaaaaaaaa = 0x00000000: OK" \
1574
          "  - carry flag set:      FALSE"             \
1575
          "  - overflow flag set:   FALSE"             \
1576
          "  - exception triggered: FALSE"             \
1577
          "  0x55555555 ^ 0x00000000 = 0x55555555: OK" \
1578
          "  - carry flag set:      FALSE"             \
1579
          "  - overflow flag set:   FALSE"             \
1580
          "  - exception triggered: FALSE"             \
1581
          "  0x55555555 ^ 0x55555555 = 0x00000000: OK" \
1582
          "  - carry flag set:      FALSE"             \
1583
          "  - overflow flag set:   FALSE"             \
1584
          "  - exception triggered: FALSE"             \
1585
          "  0xaaaaaaaa ^ 0x55555555 = 0xffffffff: OK" \
1586
          "  - carry flag set:      FALSE"             \
1587
          "  - overflow flag set:   FALSE"             \
1588
          "  - exception triggered: FALSE"             \
1589
          "  0x4c70f07c ^ 0xb38f0f83 = 0xffffffff: OK" \
1590
          "  - carry flag set:      FALSE"             \
1591
          "  - overflow flag set:   FALSE"             \
1592
          "  - exception triggered: FALSE"             \
1593
          "  0x4c70f07c ^ 0xc4c70f07 = 0x88b7ff7b: OK" \
1594
          "  - carry flag set:      FALSE"             \
1595
          "  - overflow flag set:   FALSE"             \
1596
          "  - exception triggered: FALSE"             \
1597
          "  0xb38f0f83 ^ 0x38f0f83b = 0x8b7ff7b8: OK" \
1598
          "  - carry flag set:      FALSE"             \
1599
          "  - overflow flag set:   FALSE"             \
1600
          "  - exception triggered: FALSE"             \
1601
          "!l.xori"                                    \
1602
          "  0x00000000 ^ 0x0000 = 0x00000000: OK"     \
1603
          "  - carry flag set:      FALSE"             \
1604
          "  - overflow flag set:   FALSE"             \
1605
          "  - exception triggered: FALSE"             \
1606
          "  0xffffffff ^ 0xffff = 0x00000000: OK"     \
1607
          "  - carry flag set:      FALSE"             \
1608
          "  - overflow flag set:   FALSE"             \
1609
          "  - exception triggered: FALSE"             \
1610
          "  0xaaaaaaaa ^ 0x0000 = 0xaaaaaaaa: OK"     \
1611
          "  - carry flag set:      FALSE"             \
1612
          "  - overflow flag set:   FALSE"             \
1613
          "  - exception triggered: FALSE"             \
1614
          "  0xaaaaaaaa ^ 0xaaaa = 0x55550000: OK"     \
1615
          "  - carry flag set:      FALSE"             \
1616
          "  - overflow flag set:   FALSE"             \
1617
          "  - exception triggered: FALSE"             \
1618
          "  0x55555555 ^ 0x0000 = 0x55555555: OK"     \
1619
          "  - carry flag set:      FALSE"             \
1620
          "  - overflow flag set:   FALSE"             \
1621
          "  - exception triggered: FALSE"             \
1622
          "  0x55555555 ^ 0x5555 = 0x55550000: OK"     \
1623
          "  - carry flag set:      FALSE"             \
1624
          "  - overflow flag set:   FALSE"             \
1625
          "  - exception triggered: FALSE"             \
1626
          "  0xaaaaaaaa ^ 0x5555 = 0xaaaaffff: OK"     \
1627
          "  - carry flag set:      FALSE"             \
1628
          "  - overflow flag set:   FALSE"             \
1629
          "  - exception triggered: FALSE"             \
1630
          "  0x4c70f07c ^ 0x0f83 = 0x4c70ffff: OK"     \
1631
          "  - carry flag set:      FALSE"             \
1632
          "  - overflow flag set:   FALSE"             \
1633
          "  - exception triggered: FALSE"             \
1634
          "  0x4c70f07c ^ 0x0f07 = 0x4c70ff7b: OK"     \
1635
          "  - carry flag set:      FALSE"             \
1636
          "  - overflow flag set:   FALSE"             \
1637
          "  - exception triggered: FALSE"             \
1638
          "  0xb38f0f83 ^ 0xf83b = 0x4c70f7b8: OK"     \
1639
          "  - carry flag set:      FALSE"             \
1640
          "  - overflow flag set:   FALSE"             \
1641
          "  - exception triggered: FALSE"             \
1642
          "!Test completed"                            \
1643
          "!report(0xdeaddead);"                       \
1644
          "!exit(0)"]                                  \
1645
    "inst-set-test.cfg" "inst-set-test/is-xor-test"

powered by: WebSVN 2.1.0

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