1 |
29 |
wfjm |
# $Id: w11a_tb_guide.txt 654 2015-03-01 18:45:38Z mueller $
|
2 |
4 |
wfjm |
|
3 |
29 |
wfjm |
Note: Only ISE based test benches are currently documented !
|
4 |
|
|
The Vivado test environemnt is still in it's infancy !
|
5 |
|
|
|
6 |
5 |
wfjm |
Guide to running w11a test benches
|
7 |
4 |
wfjm |
|
8 |
5 |
wfjm |
Table of content:
|
9 |
|
|
|
10 |
|
|
1. Unit tests benches
|
11 |
|
|
2. Available unit tests benches
|
12 |
|
|
3. System tests benches
|
13 |
|
|
4. Available system tests benches
|
14 |
|
|
|
15 |
|
|
|
16 |
4 |
wfjm |
1. Unit tests benches -----------------------------------------------------
|
17 |
|
|
|
18 |
|
|
All unit test benches have the same simple structure:
|
19 |
|
|
|
20 |
|
|
- a stimulus process reads test patterns as well as the expected
|
21 |
|
|
responses from a stimulus file
|
22 |
|
|
|
23 |
|
|
- the responses are checked in very simple cases by the stimulus process,
|
24 |
|
|
in general by a monitoring process
|
25 |
|
|
|
26 |
|
|
- the test bench produces a comprehensive log file. For each checked
|
27 |
|
|
response the line contains the word "CHECK" and either an "OK" or a
|
28 |
|
|
"FAIL", in the later case in general with an indication of whats wrong.
|
29 |
|
|
Other unexpected behaviour, like timeouts, will also result in a line
|
30 |
|
|
containing the word "FAIL".
|
31 |
|
|
|
32 |
|
|
- at the end a line with the word "DONE" is printed.
|
33 |
|
|
|
34 |
|
|
- the test bench is run like
|
35 |
|
|
|
36 |
|
|
tbw [stimfile] | tee | egrep "(FAIL|DONE)"
|
37 |
|
|
|
38 |
|
|
where
|
39 |
|
|
- 'tbw' is a small perl script setting up a symbolic link to the
|
40 |
|
|
stimulus file, the default extracted from the file tbw.dat, if
|
41 |
|
|
an optional file name is give this one will be used instead.
|
42 |
22 |
wfjm |
- 'tee' ensures that the full log is saved
|
43 |
4 |
wfjm |
- 'egrep' filters FAIL and DONE lines, a successful run will
|
44 |
|
|
produce a single DONE line
|
45 |
|
|
|
46 |
|
|
- Most tests can be run against
|
47 |
|
|
- the functional model
|
48 |
|
|
- gate level models at three stages
|
49 |
|
|
- the post-xst model (produced by netgen from ngc xst output)
|
50 |
|
|
- the post-map model (produced by netgen from ncd ngdbuild output)
|
51 |
|
|
- the post-par model (produced by netgen from ncd par output)
|
52 |
|
|
This is simply done using
|
53 |
|
|
make _ssim for post-xst
|
54 |
|
|
make _fsim for post-map
|
55 |
|
|
make _tsim for post-par
|
56 |
|
|
all the rest is handled by the build environment.
|
57 |
|
|
An example of a post-synthesis model is given for the w11a core test.
|
58 |
|
|
|
59 |
28 |
wfjm |
- for convenience a wrapper script 'tbrun_tbw' is used to generate the
|
60 |
|
|
tbw|tee|egrep pipe. This script also checks with 'make' whether the
|
61 |
|
|
test bench is up-to-date or must be (re)-compiled.
|
62 |
|
|
|
63 |
4 |
wfjm |
2. Available unit tests benches -------------------------------------------
|
64 |
|
|
|
65 |
28 |
wfjm |
In the following the available tests are listed with their tbrun_tbw which
|
66 |
|
|
- will call 'make' to build them
|
67 |
|
|
- and create the pipe setup to run them
|
68 |
|
|
and the expected output (the run time measured on a 3 GHz system)
|
69 |
4 |
wfjm |
|
70 |
|
|
- serport receiver test
|
71 |
|
|
cd $RETROBASE/rtl/vlib/serport/tb
|
72 |
28 |
wfjm |
tbrun_tbw tb_serport_uart_rx
|
73 |
9 |
wfjm |
-> 1269955.0 ns 63488: DONE
|
74 |
13 |
wfjm |
-> real 0m01.178s user 0m01.172s sys 0m00.020s
|
75 |
4 |
wfjm |
|
76 |
|
|
- serport receiver/transmitter test
|
77 |
28 |
wfjm |
tbrun_tbw tb_serport_uart_rxtx
|
78 |
27 |
wfjm |
-> 52335.0 ns 2607: DONE
|
79 |
13 |
wfjm |
-> real 0m00.094s user 0m00.092s sys 0m00.008s
|
80 |
4 |
wfjm |
|
81 |
|
|
- serport autobauder test
|
82 |
28 |
wfjm |
tbrun_tbw tb_serport_autobaud
|
83 |
9 |
wfjm |
-> 367475.0 ns 18364: DONE
|
84 |
13 |
wfjm |
-> real 0m00.610s user 0m00.612s sys 0m00.004s
|
85 |
27 |
wfjm |
|
86 |
|
|
- 9 bit comma,data to Byte stream converter test
|
87 |
|
|
cd $RETROBASE/rtl/vlib/comlib/tb
|
88 |
28 |
wfjm |
tbrun_tbw tb_cdata2byte
|
89 |
27 |
wfjm |
-> 7261.0 ns 354: DONE
|
90 |
|
|
-> real 0m0.385s user 0m0.041s sys 0m0.006s
|
91 |
4 |
wfjm |
|
92 |
9 |
wfjm |
- rlink core test
|
93 |
4 |
wfjm |
|
94 |
9 |
wfjm |
cd $RETROBASE/rtl/vlib/rlink/tb
|
95 |
28 |
wfjm |
tbrun_tbw tb_rlink_direct
|
96 |
27 |
wfjm |
-> 78975.0 ns 3939: DONE
|
97 |
|
|
-> real 0m00.508s user 0m00.262s sys 0m00.028s
|
98 |
4 |
wfjm |
|
99 |
9 |
wfjm |
- rlink core test via serial port interface
|
100 |
4 |
wfjm |
|
101 |
17 |
wfjm |
cd $RETROBASE/rtl/vlib/rlink/tb
|
102 |
28 |
wfjm |
tbrun_tbw --lsuf stim2_dsim tb_rlink_sp1c tb_rlink_sp1c_stim.dat
|
103 |
27 |
wfjm |
-> 27595.0 ns 1370: DONE
|
104 |
|
|
-> real 0m0.250s user 0m0.108s sys 0m0.011s
|
105 |
4 |
wfjm |
|
106 |
28 |
wfjm |
tbrun_tbw --lsuf stim1_dsim tb_rlink_sp1c tb_rlink_stim.dat
|
107 |
27 |
wfjm |
-> 420295.0 ns 21005: DONE
|
108 |
|
|
-> real 0m02.271s user 0m01.360s sys 0m00.040s
|
109 |
9 |
wfjm |
|
110 |
4 |
wfjm |
- w11a core test (using behavioural model)
|
111 |
|
|
|
112 |
|
|
cd $RETROBASE/rtl/w11a/tb
|
113 |
28 |
wfjm |
tbrun_tbw tb_pdp11core
|
114 |
25 |
wfjm |
-> 1220255.0 ns 61073: DONE
|
115 |
13 |
wfjm |
-> real 0m10.736s user 0m10.713s sys 0m00.060s
|
116 |
4 |
wfjm |
|
117 |
|
|
- w11a core test (using post-synthesis model)
|
118 |
|
|
|
119 |
28 |
wfjm |
tbrun_tbw tb_pdp11core_ssim
|
120 |
27 |
wfjm |
-> 1220255.0 ns 61073: DONE
|
121 |
13 |
wfjm |
-> real 1m09.738s user 1m09.588s sys 0m00.096s
|
122 |
4 |
wfjm |
|
123 |
16 |
wfjm |
- s3board sram controller test
|
124 |
|
|
|
125 |
|
|
cd $RETROBASE/rtl/bplib/s3board/tb
|
126 |
28 |
wfjm |
tbrun_tbw tb_s3_sram_memctl
|
127 |
16 |
wfjm |
-> 5015.0 ns 241: DONE
|
128 |
|
|
-> real 0m00.113s user 0m00.068s sys 0m00.016s
|
129 |
|
|
|
130 |
|
|
- nexys2/nexys3 cram controller test
|
131 |
|
|
|
132 |
|
|
cd $RETROBASE/rtl/bplib/nxcramlib/tb
|
133 |
28 |
wfjm |
tbrun_tbw tb_nx_cram_memctl_as
|
134 |
16 |
wfjm |
-> 24272.5 ns 1204: DONE
|
135 |
|
|
-> real 0m00.343s user 0m00.248s sys 0m00.100s
|
136 |
|
|
|
137 |
4 |
wfjm |
3. System tests benches ---------------------------------------------------
|
138 |
|
|
|
139 |
11 |
wfjm |
The system tests allow to verify to verify a full system design.
|
140 |
4 |
wfjm |
In this case vhdl test bench code contains
|
141 |
|
|
- (simple) models of the memories used on the FPGA boards
|
142 |
9 |
wfjm |
- drivers for the rlink connection (currently just serialport)
|
143 |
|
|
- code to interface the rlink data stream to a UNIX 'named pipe',
|
144 |
4 |
wfjm |
implemented with a C routine which is called via VHPI from VHDL.
|
145 |
|
|
This way the whole ghdl simulation can be controlled via a di-directional
|
146 |
|
|
byte stream.
|
147 |
|
|
|
148 |
11 |
wfjm |
The rlink backend process can connect either via a named pipe to a ghdl
|
149 |
|
|
simulation, or via a serial port to a FPGA board. This way the same tests
|
150 |
|
|
can be executed in simulation and on real hardware.
|
151 |
4 |
wfjm |
|
152 |
|
|
4. Available system tests benches -----------------------------------------
|
153 |
|
|
|
154 |
20 |
wfjm |
4a. serport tester ---------------------------------------------------
|
155 |
11 |
wfjm |
|
156 |
16 |
wfjm |
The sys_tst_serloop design is a test target for validating the serial
|
157 |
|
|
link UART stack. Send and receive throughput as well as loop-back tests
|
158 |
|
|
are supported
|
159 |
|
|
|
160 |
|
|
- sys_tst_serloop_s3 test bench
|
161 |
|
|
|
162 |
|
|
cd $RETROBASE/rtl/sys_gen/tst_serloop/s3board/tb
|
163 |
28 |
wfjm |
tbrun_tbw tb_tst_serloop_s3
|
164 |
16 |
wfjm |
-> 301353.3 ns 18068: DONE
|
165 |
|
|
-> real 0m1.422s user 0m1.372s sys 0m0.024s
|
166 |
|
|
|
167 |
|
|
- sys_tst_serloop_n2 test bench
|
168 |
|
|
|
169 |
|
|
cd $RETROBASE/rtl/sys_gen/tst_serloop/nexys2/tb
|
170 |
28 |
wfjm |
tbrun_tbw tb_tst_serloop1_n2
|
171 |
16 |
wfjm |
-> 361560.0 ns 18068: DONE
|
172 |
|
|
-> real 0m1.341s user 0m1.340s sys 0m0.016s
|
173 |
|
|
|
174 |
28 |
wfjm |
tbrun_tbw tb_tst_serloop2_n2
|
175 |
16 |
wfjm |
-> 304353.3 ns 18248: DONE
|
176 |
|
|
-> real 0m1.933s user 0m1.924s sys 0m0.024s
|
177 |
|
|
|
178 |
|
|
- sys_tst_serloop_n3 test bench
|
179 |
|
|
|
180 |
|
|
cd $RETROBASE/rtl/sys_gen/tst_serloop/nexys3/tb
|
181 |
28 |
wfjm |
tbrun_tbw tb_tst_serloop1_n3
|
182 |
16 |
wfjm |
-> 361560.0 ns 18068: DONE
|
183 |
|
|
-> real 0m1.371s user 0m1.372s sys 0m0.016s
|
184 |
|
|
|
185 |
|
|
4b. rlink tester -----------------------------------------------------
|
186 |
|
|
|
187 |
11 |
wfjm |
The sys_tst_rlink design is a test target for validating the rlink
|
188 |
|
|
and rbus functionality at all levels.
|
189 |
|
|
|
190 |
16 |
wfjm |
- sys_tst_rlink_s3 test bench
|
191 |
|
|
|
192 |
|
|
cd $RETROBASE/rtl/sys_gen/tst_rlink/s3board/tb
|
193 |
28 |
wfjm |
tbrun_tbwrri --pack tst_rlink tb_tst_rlink_s3 \
|
194 |
|
|
"tst_rlink::setup" "tst_rlink::test_all"
|
195 |
|
|
-> 1377680.0 ns 68874: DONE
|
196 |
|
|
-> real 0m6.876s user 0m6.790s sys 0m0.060s
|
197 |
16 |
wfjm |
|
198 |
11 |
wfjm |
- sys_tst_rlink_n2 test bench
|
199 |
|
|
|
200 |
|
|
cd $RETROBASE/rtl/sys_gen/tst_rlink/nexys2/tb
|
201 |
28 |
wfjm |
tbrun_tbwrri --pack tst_rlink tb_tst_rlink_n2 \
|
202 |
|
|
"tst_rlink::setup" "tst_rlink::test_all"
|
203 |
|
|
-> 1378200.0 ns 68899: DONE
|
204 |
|
|
-> real 0m10.320s user 0m10.110s sys 0m0.204s
|
205 |
11 |
wfjm |
|
206 |
15 |
wfjm |
- sys_tst_rlink_n3 test bench
|
207 |
|
|
|
208 |
|
|
cd $RETROBASE/rtl/sys_gen/tst_rlink/nexys3/tb
|
209 |
28 |
wfjm |
tbrun_tbwrri --pack tst_rlink tb_tst_rlink_n3 \
|
210 |
|
|
"tst_rlink::setup" "tst_rlink::test_all"
|
211 |
|
|
-> 689210.0 ns 68900: DONE
|
212 |
|
|
-> real 0m7.098s user 0m6.874s sys 0m0.191s
|
213 |
15 |
wfjm |
|
214 |
16 |
wfjm |
4c. w11a systems -----------------------------------------------------
|
215 |
11 |
wfjm |
|
216 |
4 |
wfjm |
The stimulus file used in the w11a core test can be executed in the
|
217 |
|
|
full system context (both s3board and nexys2 versions) with the
|
218 |
|
|
following commands. Note that the cycle number printed in the DONE
|
219 |
9 |
wfjm |
line can now vary slightly because the response time of the rlink
|
220 |
4 |
wfjm |
backend process and thus scheduling of backend vs. ghdl process
|
221 |
|
|
can affect the result.
|
222 |
|
|
|
223 |
28 |
wfjm |
For convenience a wrapper script 'tbrun_tbwrri' is used to generate the
|
224 |
|
|
required quite long ti_rri command. Like for 'tbrun_tbw' the script also
|
225 |
|
|
checks with 'make' whether the test bench is up-to-date or must be
|
226 |
|
|
(re)-compiled.
|
227 |
|
|
|
228 |
11 |
wfjm |
- sys_w11a_s3 test bench
|
229 |
4 |
wfjm |
|
230 |
|
|
cd $RETROBASE/rtl/sys_gen/w11a/s3board/tb
|
231 |
28 |
wfjm |
tbrun_tbwrri --pack rw11 tb_w11a_s3 \
|
232 |
20 |
wfjm |
"rw11::setup_cpu" \
|
233 |
28 |
wfjm |
"rw11::run_pdpcp ../../../../w11a/tb/tb_pdp11core_stim.dat"
|
234 |
27 |
wfjm |
-> 9864500.0 ns 493215: DONE
|
235 |
|
|
-> real 0m59.728s user 0m58.586s sys 0m0.576s
|
236 |
4 |
wfjm |
|
237 |
11 |
wfjm |
- sys_w11a_n2 test bench
|
238 |
4 |
wfjm |
|
239 |
|
|
cd $RETROBASE/rtl/sys_gen/w11a/nexys2/tb
|
240 |
28 |
wfjm |
tbrun_tbwrri --pack rw11 --cuff tb_w11a_n2 \
|
241 |
20 |
wfjm |
"rw11::setup_cpu" \
|
242 |
28 |
wfjm |
"rw11::run_pdpcp ../../../../w11a/tb/tb_pdp11core_stim.dat"
|
243 |
|
|
-> 3809180.0 ns 190448: DONE
|
244 |
|
|
-> real 0m55.733s user 0m55.504s sys 0m0.592s
|
245 |
15 |
wfjm |
|
246 |
|
|
- sys_w11a_n3 test bench
|
247 |
|
|
|
248 |
|
|
cd $RETROBASE/rtl/sys_gen/w11a/nexys3/tb
|
249 |
28 |
wfjm |
tbrun_tbwrri --pack rw11 --cuff tb_w11a_n3 \
|
250 |
20 |
wfjm |
"rw11::setup_cpu" \
|
251 |
28 |
wfjm |
"rw11::run_pdpcp ../../../../w11a/tb/tb_pdp11core_stim.dat"
|
252 |
|
|
-> 279834.9 ns 236133: DONE
|
253 |
|
|
-> real 0m59.998s user 0m59.676s sys 0m0.618s
|
254 |
16 |
wfjm |
|
255 |
19 |
wfjm |
A new, modular w11a test bench is under construction. So far it is very
|
256 |
|
|
incomplete. This very preliminary version can be executed with
|
257 |
|
|
|
258 |
|
|
- sys_w11a_n2 test bench
|
259 |
|
|
|
260 |
|
|
cd $RETROBASE/rtl/sys_gen/w11a/nexys2/tb
|
261 |
28 |
wfjm |
tbrun_tbwrri --lsuf tbench_dsim --pack rw11 --cuff tb_w11a_n2 \
|
262 |
|
|
"rw11::setup_cpu" "rw11::tbench @w11a_all.dat"
|
263 |
|
|
-> 2638820.0 ns 131930: DONE
|
264 |
|
|
-> real 0m24.890s user 0m25.286s sys 0m0.439s
|
265 |
22 |
wfjm |
|