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 112

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
# Run the l.lws test
28
run_or1ksim "lws-test"                            \
29
    [list "!l.lws"                                \
30
          "   l.lws r4,0(r5): r4=0xdeadbeef:  OK" \
31
          "   l.lws r4,0(r5): r4=0x00000000:  OK" \
32
          "   l.lws r4,0(r5): r4=0x7fffffff:  OK" \
33
          "   l.lws r4,0(r5): r4=0x80000000:  OK" \
34
          "   l.lws r4,0(r5): r4=0xffffffff:  OK" \
35
          "   l.lws r4,0(r5): r4=0x00000000:  OK" \
36
          "   l.lws r4,0(r5): r4=0x7fffffff:  OK" \
37
          "   l.lws r4,0(r5): r4=0x80000000:  OK" \
38
          "   l.lws r4,0(r5): r4=0xffffffff:  OK" \
39
          "   l.lws r4,0(r5): r4=0xdeadbeef:  OK" \
40
          "   l.lws r4,0(r5): r4=0x00000000:  OK" \
41
          "   l.lws r4,0(r5): r4=0x7fffffff:  OK" \
42
          "   l.lws r4,0(r5): r4=0x80000000:  OK" \
43
          "!Test completed"                       \
44
          "!report(0xdeaddead);"                  \
45
          "!exit(0)"]                             \
46
    "inst-set-test.cfg" "inst-set-test/is-lws-test"
47 112 jeremybenn
 
48
# Run the l.div and l.divu test
49
run_or1ksim "lws-test"                                \
50
    [list "!l.div"                                    \
51
          "!  RANGE exception"                        \
52
          "  - caused by: report(0xe0853309);"        \
53
          "!  - SR value:  report(0x00008601);"       \
54
          "  1 / 0 (with error) carry flag set: TRUE" \
55
          "!l.divu"                                   \
56
          "!  RANGE exception"                        \
57
          "  - caused by: report(0xe085330a);"        \
58
          "!  - SR value:  report(0x00008601);"       \
59
          "  1 / 0 (with error) carry flag set: TRUE" \
60
          "!Test completed"                           \
61
          "!report(0xdeaddead);"                      \
62
          "!exit(0)"]                                 \
63
    "inst-set-test.cfg" "inst-set-test/is-div-test"
64
 
65
# Run the l.add, l.addc, l.addi and l.addic tests
66
run_or1ksim "lws-test"                                 \
67
    [list "!l.add"                                     \
68
          "  0x00000001 + 0x00000002 = 0x00000003: OK" \
69
          "  - carry flag set:    FALSE"               \
70
          "  - overflow flag set: FALSE"               \
71
          "  0xffffffff + 0xfffffffe = 0xfffffffd: OK" \
72
          "  - carry flag set:    TRUE"                \
73
          "  - overflow flag set: FALSE"               \
74
          "  0x40000000 + 0x3fffffff = 0x7fffffff: OK" \
75
          "  - carry flag set:    FALSE"               \
76
          "  - overflow flag set: FALSE"               \
77
          "  0x40000000 + 0x40000000 = 0x80000000: OK" \
78
          "  - carry flag set:    FALSE"               \
79
          "  - overflow flag set: TRUE"                \
80
          "  0xc0000000 + 0xc0000000 = 0x80000000: OK" \
81
          "  - carry flag set:    TRUE"                \
82
          "  - overflow flag set: FALSE"               \
83
          "  0xbfffffff + 0xbfffffff = 0x7ffffffe: OK" \
84
          "  - carry flag set:    TRUE"                \
85
          "  - overflow flag set: TRUE"                \
86
          "!  OVE flag set"                            \
87
          "  RANGE exception"                          \
88
          "  - caused by: report(0xe0853000);"         \
89
          "  - SR value:  report(0x00009a01);"         \
90
          "  0x40000000 + 0x40000000 = 0x80000000: OK" \
91
          "  - carry flag set:    FALSE"               \
92
          "  - overflow flag set: TRUE"                \
93
          "  0xffffffff + 0xfffffffe = 0xfffffffd: OK" \
94
          "  - carry flag set:    TRUE"                \
95
          "  - overflow flag set: FALSE"               \
96
          "  RANGE exception"                          \
97
          "  - caused by: report(0xe0853000);"         \
98
          "  - SR value:  report(0x00009e01);"         \
99
          "  0xbfffffff + 0xbfffffff = 0x7ffffffe: OK" \
100
          "  - carry flag set:    TRUE"                \
101
          "  - overflow flag set: TRUE"                \
102
          "!  OVE flag cleared"                        \
103
          "!Test completed"                            \
104
          "!report(0xdeaddead);"                       \
105
          "!exit(0)"]                                  \
106
    "inst-set-test.cfg" "inst-set-test/is-add-test"

powered by: WebSVN 2.1.0

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