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

Subversion Repositories or1k

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

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
All programs should be built inside their directories (ie. dhrystone should be built
5
inside testbench/dhrystone). You need to have all GNU OR32 tools installed and in path.
6
All makefiles assume or32-rtems target.
7
 
8
!!! For all test cases, or1ksim should be built with ONLY_VIRTUAL_MACHINE undefined in
9
cpu/or1k/except.h !!!
10
 
11
Dhrystone 2.1: a benchmark modified to use simulator's timing facility. It should finish with exit(0).
12
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13
 
14
running simulation:
15
 
16
# ./sim testbench/dhrystone/dhry.or32
17
(sim) run 1000000 hush
18
  
19
MTSPR(0x1234, 20070);
20
MTSPR(0x1234, 20013);
21
MTSPR(0x1234, 7);
22
MTSPR(0x1234, 30010);
23
MTSPR(0x1234, 30010);
24
MTSPR(0x1234, 8);
25
MTSPR(0x1234, 20020);
26
MTSPR(0x1234, 9);
27
syscall exit(0)
28
(sim)
29
 
30
stdout.txt should read like this:
31
 
32
Execution starts, 20 runs through Dhrystone
33
Begin Time = 549
34
End Time   = 22701
35
OR1K at 200 MHz
36
Microseconds for one run through Dhrystone: 110 us / 20 runs
37
Dhrystones per Second:                      181
38
 
39 195 simons
test0: a test for all instructions and all GPRs. If everything is ok, RESULT == 0xdeadead.
40
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41 97 lampret
 
42 195 simons
Simulation:
43
# ./sim testbench/test0/test0.or32
44
(sim) run 1000000000 hush
45
UART 0 RX EOF detected. Shutting down to prevent endless loop.
46
MTSPR(0x1234, ffff0012);
47
MTSPR(0x1234, 12352af7);
48
MTSPR(0x1234, 7ffffffe);
49
MTSPR(0x1234, ffffa5a7);
50
MTSPR(0x1234, fffff);
51
MTSPR(0x1234, 2800);
52
MTSPR(0x1234, a);
53
MTSPR(0x1234, deaddead);
54
syscall exit(0)
55
(sim)
56
 
57
Standard output:
58
RESULT: deaddead
59
 
60
 
61 97 lampret
test1: a test for "all" instructions and their combinations. If everything is ok, RESULT == 0xdeadead.
62
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63
 
64
Simulation:
65
# ./sim testbench/test1/test1.or32
66
(sim) run 100000000 hush
67
MTSPR(0x1234, ffffffda);
68
MTSPR(0x1234, ffffffc5);
69
MTSPR(0x1234, 6805);
70
MTSPR(0x1234, ffff97f9);
71
MTSPR(0x1234, ffff97f9);
72
MTSPR(0x1234, 7a77952e);
73
MTSPR(0x1234, 81e5e000);
74
MTSPR(0x1234, 74);
75
MTSPR(0x1234, 74);
76
MTSPR(0x1234, 74);
77
MTSPR(0x1234, 1);
78
MTSPR(0x1234, d7c);
79
MTSPR(0x1234, 74);
80
MTSPR(0x1234, 74);
81
MTSPR(0x1234, 74);
82
MTSPR(0x1234, ffffffff);
83
MTSPR(0x1234, d7a);
84
MTSPR(0x1234, d7a);
85
MTSPR(0x1234, deaddead);
86
syscall exit(0)
87
(sim)
88
 
89
Standard output:
90
RESULT: deaddead
91
 
92 195 simons
test2: 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.
93
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94
 
95
Simulation:
96
# ./sim testbench/test2/test2.or32
97
(sim) run 100000000 hush
98
...
99
...
100
...
101
MTSPR(0x1234, 178);
102
MTSPR(0x1234, 178);
103
MTSPR(0x1234, deaddead);
104
syscall exit(0)
105
(sim)
106
 
107
Standard output:
108
RESULT: deaddead
109
 
110
test3: a test of l.sys instruction. Checks all the delay slot issues ind other things. If everything is ok, RESULT == 0xdeadead.
111
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112
 
113
Simulation:
114
# ./sim testbench/test3/test3.or32
115
(sim) run 1000000 hush
116
UART 0 RX EOF detected. Shutting down to prevent endless loop.
117
Exception 0xc00 (System Call): Iqueue[0].insn_addr: 0xc74  Eff ADDR: 0x0
118
  pc: 0xc74  pcnext: 0xc78
119
MTSPR(0x1234, 1);
120
MTSPR(0x1234, 1);
121
MTSPR(0x1234, 1c);
122
MTSPR(0x1234, 1);
123
MTSPR(0x1234, 3);
124
MTSPR(0x1234, deaddead);
125
syscall exit(0)
126
(sim)
127
 
128
Standard output:
129
RESULT: deaddead
130
 
131
test4: 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.
132
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133
 
134
Simulation:
135
# ./sim testbench/test4/test4.or32
136
(sim) run 1000000 hush
137
MTSPR(0x1234, 0);
138
MTSPR(0x1234, e83f);
139
MTSPR(0x1234, 0);
140
MTSPR(0x1234, 5);
141
MTSPR(0x1234, 20);
142
MTSPR(0x1234, 1d);
143
MTSPR(0x1234, 1d);
144
MTSPR(0x1234, 1d);
145
MTSPR(0x1234, 1d);
146
MTSPR(0x1234, 8);
147
MTSPR(0x1234, 1);
148
MTSPR(0x1234, deaddead);
149
syscall exit(0)
150
(sim)
151
 
152
Standard output:
153
RESULT: deaddead
154
 
155 97 lampret
compress: UNIX compressed modified not to use libc calls. Should finish with exit(0).
156
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157
 
158
Simulation:
159
 
160
./sim testbench/compress/mycompress.or32
161
(sim) run 100000000 hush
162
Interrupt reported.
163
Interrupt reported.
164
syscall exit(0)
165
(sim)
166
 
167
Standard output:
168
 
169
main: bytes_out 3... hsize 5003
170
main: hshift 4...
171
main: bytes_out 3...
172
main: hsize_reg 5003...
173
main: before compress 1...
174
main: compressing 1...
175
main: compressing 2...
176
main: compressing 3...
177
  
178
main: compressing 997...
179
main: compressing 998...
180
main: compressing 999...
181
main: output...
182
main: end...
183
 

powered by: WebSVN 2.1.0

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