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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [testbench/] [README] - Blame information for rev 226

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

Line No. Rev Author Line
1 97 lampret
This directory includes some test case programs that should be used to verify correct operation
2
of the or1ksim, OR32 GCC and OR32 GNU Binutils.
3
 
4 226 markom
All programs are built from root directories. You need to have all GNU OR32 tools installed and in
5
path.
6 97 lampret
 
7
!!! For all test cases, or1ksim should be built with ONLY_VIRTUAL_MACHINE undefined in
8
cpu/or1k/except.h !!!
9
 
10
Dhrystone 2.1: a benchmark modified to use simulator's timing facility. It should finish with exit(0).
11
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
 
13
running simulation:
14
 
15
# ./sim testbench/dhrystone/dhry.or32
16 226 markom
(sim) run -1 hush
17 97 lampret
  
18
MTSPR(0x1234, 20070);
19
MTSPR(0x1234, 20013);
20
MTSPR(0x1234, 7);
21
MTSPR(0x1234, 30010);
22
MTSPR(0x1234, 30010);
23
MTSPR(0x1234, 8);
24
MTSPR(0x1234, 20020);
25
MTSPR(0x1234, 9);
26
syscall exit(0)
27
(sim)
28
 
29
stdout.txt should read like this:
30
 
31
Execution starts, 20 runs through Dhrystone
32
Begin Time = 549
33
End Time   = 22701
34
OR1K at 200 MHz
35
Microseconds for one run through Dhrystone: 110 us / 20 runs
36
Dhrystones per Second:                      181
37
 
38 226 markom
basic: a test for all instructions and all GPRs. If everything is ok, RESULT == 0xdeadead.
39 195 simons
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40 97 lampret
 
41 195 simons
Simulation:
42 226 markom
# ./sim testbench/basic.or32
43
(sim) run -1 hush
44 195 simons
UART 0 RX EOF detected. Shutting down to prevent endless loop.
45
MTSPR(0x1234, ffff0012);
46
MTSPR(0x1234, 12352af7);
47
MTSPR(0x1234, 7ffffffe);
48
MTSPR(0x1234, ffffa5a7);
49
MTSPR(0x1234, fffff);
50
MTSPR(0x1234, 2800);
51
MTSPR(0x1234, a);
52
MTSPR(0x1234, deaddead);
53
syscall exit(0)
54
(sim)
55
 
56
Standard output:
57
RESULT: deaddead
58
 
59
 
60 97 lampret
test1: a test for "all" instructions and their combinations. If everything is ok, RESULT == 0xdeadead.
61
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62
 
63
Simulation:
64 226 markom
# ./sim testbench/cbasic.or32
65
(sim) run -1 hush
66 97 lampret
MTSPR(0x1234, ffffffda);
67
MTSPR(0x1234, ffffffc5);
68
MTSPR(0x1234, 6805);
69
MTSPR(0x1234, ffff97f9);
70
MTSPR(0x1234, ffff97f9);
71
MTSPR(0x1234, 7a77952e);
72
MTSPR(0x1234, 81e5e000);
73
MTSPR(0x1234, 74);
74
MTSPR(0x1234, 74);
75
MTSPR(0x1234, 74);
76
MTSPR(0x1234, 1);
77
MTSPR(0x1234, d7c);
78
MTSPR(0x1234, 74);
79
MTSPR(0x1234, 74);
80
MTSPR(0x1234, 74);
81
MTSPR(0x1234, ffffffff);
82
MTSPR(0x1234, d7a);
83
MTSPR(0x1234, d7a);
84
MTSPR(0x1234, deaddead);
85
syscall exit(0)
86
(sim)
87
 
88
Standard output:
89
RESULT: deaddead
90
 
91 226 markom
pic: a test for PIC and TICK timer. All three modes of TICK timer are tested and interrupt is enabled and disabled in PIC. If everything is ok, RESULT == 0xdeadead.
92 195 simons
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93
 
94
Simulation:
95 226 markom
# ./sim testbench/pic.or32
96
(sim) run -1 hush
97 195 simons
...
98
...
99
...
100
MTSPR(0x1234, 178);
101
MTSPR(0x1234, 178);
102
MTSPR(0x1234, deaddead);
103
syscall exit(0)
104
(sim)
105
 
106
Standard output:
107
RESULT: deaddead
108
 
109 226 markom
excpt: a test of l.sys instruction. Checks all the delay slot issues ind other things. If everything is ok, RESULT == 0xdeadead.
110 195 simons
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111
 
112
Simulation:
113 226 markom
# ./sim testbench/excpt.or32
114
(sim) run -1 hush
115 195 simons
UART 0 RX EOF detected. Shutting down to prevent endless loop.
116
Exception 0xc00 (System Call): Iqueue[0].insn_addr: 0xc74  Eff ADDR: 0x0
117
  pc: 0xc74  pcnext: 0xc78
118
MTSPR(0x1234, 1);
119
MTSPR(0x1234, 1);
120
MTSPR(0x1234, 1c);
121
MTSPR(0x1234, 1);
122
MTSPR(0x1234, 3);
123
MTSPR(0x1234, deaddead);
124
syscall exit(0)
125
(sim)
126
 
127
Standard output:
128
RESULT: deaddead
129
 
130 226 markom
cfg: a test of SPRs (SPR_VR, SPR_CPUCFGR, SPR_DMMUCFGR, SPR_IMMUCFGR, SPR_DCCFGR, SPR_ICCFGR, SPR_DCFGR, SPR_PCCFGR). If everything is ok, RESULT == 0xdeadead.
131 195 simons
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
 
133
Simulation:
134 226 markom
# ./sim testbench/cfg.or32
135
(sim) run -1 hush
136 195 simons
MTSPR(0x1234, 0);
137
MTSPR(0x1234, e83f);
138
MTSPR(0x1234, 0);
139
MTSPR(0x1234, 5);
140
MTSPR(0x1234, 20);
141
MTSPR(0x1234, 1d);
142
MTSPR(0x1234, 1d);
143
MTSPR(0x1234, 1d);
144
MTSPR(0x1234, 1d);
145
MTSPR(0x1234, 8);
146
MTSPR(0x1234, 1);
147
MTSPR(0x1234, deaddead);
148
syscall exit(0)
149
(sim)
150
 
151
Standard output:
152
RESULT: deaddead
153
 
154 226 markom
dma: a test of DMA in normal (software) mode. If everything is ok, RESULT == 0xdeadead.
155 213 erez
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156
 
157
Simulation:
158 226 markom
# ./sim testbench/dma.or32
159 213 erez
(sim) run 1000000 hush
160
MTSPR(0x1234, 1);
161
MTSPR(0x1234, 6);
162
MTSPR(0x1234, a);
163
MTSPR(0x1234, deaddead);
164
syscall exit(0)
165
(sim)
166
 
167
Standard output:
168
RESULT: deaddead
169
 
170 97 lampret
compress: UNIX compressed modified not to use libc calls. Should finish with exit(0).
171
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
172
 
173
Simulation:
174
 
175
./sim testbench/compress/mycompress.or32
176 226 markom
(sim) run -1 hush
177 97 lampret
Interrupt reported.
178
Interrupt reported.
179
syscall exit(0)
180
(sim)
181
 
182
Standard output:
183
 
184
main: bytes_out 3... hsize 5003
185
main: hshift 4...
186
main: bytes_out 3...
187
main: hsize_reg 5003...
188
main: before compress 1...
189
main: compressing 1...
190
main: compressing 2...
191
main: compressing 3...
192
  
193
main: compressing 997...
194
main: compressing 998...
195
main: compressing 999...
196
main: output...
197
main: end...
198
 
199 226 markom
mul: Test l.mul, l.mac and l.macrc instructions. Should finish with exit(0).
200
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
201
Simulation:
202
./sim testbench/mul.or32
203
(sim) run -1 hush
204
MTSPR(0x1234, deadbeef);
205
syscall exit(0)
206
(sim)
207
 
208
Standard output:
209
 
210
0xa6312f33, expected 0xa6312f33
211
0x0d4de375, expected 0x0d4de375
212
0x61ab48dc, expected 0x61ab48dc
213
Test succesful.

powered by: WebSVN 2.1.0

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