1 |
4 |
wfjm |
# $ $Id: w11a_tb_guide.txt 316 2010-07-16 19:07:47Z mueller $
|
2 |
|
|
|
3 |
|
|
== Guide to running w11a test benches ==
|
4 |
|
|
|
5 |
|
|
1. Unit tests benches -----------------------------------------------------
|
6 |
|
|
|
7 |
|
|
All unit test benches have the same simple structure:
|
8 |
|
|
|
9 |
|
|
- a stimulus process reads test patterns as well as the expected
|
10 |
|
|
responses from a stimulus file
|
11 |
|
|
|
12 |
|
|
- the responses are checked in very simple cases by the stimulus process,
|
13 |
|
|
in general by a monitoring process
|
14 |
|
|
|
15 |
|
|
- the test bench produces a comprehensive log file. For each checked
|
16 |
|
|
response the line contains the word "CHECK" and either an "OK" or a
|
17 |
|
|
"FAIL", in the later case in general with an indication of whats wrong.
|
18 |
|
|
Other unexpected behaviour, like timeouts, will also result in a line
|
19 |
|
|
containing the word "FAIL".
|
20 |
|
|
|
21 |
|
|
- at the end a line with the word "DONE" is printed.
|
22 |
|
|
|
23 |
|
|
- the test bench is run like
|
24 |
|
|
|
25 |
|
|
tbw [stimfile] | tee | egrep "(FAIL|DONE)"
|
26 |
|
|
|
27 |
|
|
where
|
28 |
|
|
- 'tbw' is a small perl script setting up a symbolic link to the
|
29 |
|
|
stimulus file, the default extracted from the file tbw.dat, if
|
30 |
|
|
an optional file name is give this one will be used instead.
|
31 |
|
|
- 'tee' ensured that the full log is saved
|
32 |
|
|
- 'egrep' filters FAIL and DONE lines, a successful run will
|
33 |
|
|
produce a single DONE line
|
34 |
|
|
|
35 |
|
|
- Most tests can be run against
|
36 |
|
|
- the functional model
|
37 |
|
|
- gate level models at three stages
|
38 |
|
|
- the post-xst model (produced by netgen from ngc xst output)
|
39 |
|
|
- the post-map model (produced by netgen from ncd ngdbuild output)
|
40 |
|
|
- the post-par model (produced by netgen from ncd par output)
|
41 |
|
|
This is simply done using
|
42 |
|
|
make _ssim for post-xst
|
43 |
|
|
make _fsim for post-map
|
44 |
|
|
make _tsim for post-par
|
45 |
|
|
all the rest is handled by the build environment.
|
46 |
|
|
An example of a post-synthesis model is given for the w11a core test.
|
47 |
|
|
|
48 |
|
|
2. Available unit tests benches -------------------------------------------
|
49 |
|
|
|
50 |
|
|
In the following the available tests are listed with
|
51 |
|
|
- the 'make' command to build them
|
52 |
|
|
- the pipe setup to run them
|
53 |
|
|
- the expected output (the run time measured on a 3 GHz system)
|
54 |
|
|
|
55 |
|
|
- serport receiver test
|
56 |
|
|
cd $RETROBASE/rtl/vlib/serport/tb
|
57 |
|
|
make tb_serport_uart_rx
|
58 |
|
|
time tbw tb_serport_uart_rx |\
|
59 |
|
|
tee tb_serport_uart_rx_dsim.log | egrep "(FAIL|DONE)"
|
60 |
|
|
-> 1269955 ns 63488: DONE
|
61 |
|
|
|
62 |
|
|
- serport receiver/transmitter test
|
63 |
|
|
make tb_serport_uart_rxtx
|
64 |
|
|
time tbw tb_serport_uart_rxtx |\
|
65 |
|
|
tee tb_serport_uart_rxtx_dsim.log | egrep "(FAIL|DONE)"
|
66 |
|
|
-> 52335 ns 2607: DONE
|
67 |
|
|
|
68 |
|
|
- serport autobauder test
|
69 |
|
|
make tb_serport_autobaud
|
70 |
|
|
time tbw tb_serport_autobaud |\
|
71 |
|
|
tee tb_serport_autobaud_dsim.log | egrep "(FAIL|DONE)"
|
72 |
|
|
-> 367475 ns 18364: DONE
|
73 |
|
|
|
74 |
|
|
- rri core test
|
75 |
|
|
|
76 |
|
|
cd $RETROBASE/rtl/vlib/rri/tb
|
77 |
|
|
make tb_rri_core
|
78 |
|
|
time tbw tb_rri_core |\
|
79 |
|
|
tee tb_rri_core_dsim.log | egrep "(FAIL|DONE)"
|
80 |
|
|
-> 61855 ns 3083: DONE
|
81 |
|
|
-> real 0m0.163s user 0m0.128s sys 0m0.020s
|
82 |
|
|
|
83 |
|
|
- rri core test via serial port interface
|
84 |
|
|
|
85 |
|
|
make tb_rri_serport
|
86 |
|
|
time tbw tb_rri_serport |\
|
87 |
|
|
tee tb_rri_serport_dsim.log | egrep "(FAIL|DONE)"
|
88 |
|
|
-> 273355 ns 13658: DONE
|
89 |
|
|
-> real 0m0.939s user 0m0.924s sys 0m0.008s
|
90 |
|
|
|
91 |
|
|
- w11a core test (using behavioural model)
|
92 |
|
|
|
93 |
|
|
cd $RETROBASE/rtl/w11a/tb
|
94 |
|
|
make tb_pdp11_core
|
95 |
|
|
time tbw tb_pdp11_core |\
|
96 |
|
|
tee tb_pdp11_core_dsim.log | egrep "(FAIL|DONE)"
|
97 |
|
|
-> 1220255 ns 61003: DONE
|
98 |
|
|
-> real 0m14.964s user 0m14.977s sys 0m0.108s
|
99 |
|
|
|
100 |
|
|
- w11a core test (using post-synthesis model)
|
101 |
|
|
|
102 |
|
|
make ghdl_tmp_clean tb_pdp11_core_ssim
|
103 |
|
|
time tbw tb_pdp11_core_ssim |\
|
104 |
|
|
tee tb_pdp11_core_ssim.log | egrep "(FAIL|DONE)"
|
105 |
|
|
-> 1220255 ns 61003: DONE
|
106 |
|
|
-> real 1m8.230s user 1m8.144s sys 0m0.124s
|
107 |
|
|
|
108 |
|
|
3. System tests benches ---------------------------------------------------
|
109 |
|
|
|
110 |
|
|
The system tests allow to verify to verify the full 11/70 SoC design.
|
111 |
|
|
In this case vhdl test bench code contains
|
112 |
|
|
- (simple) models of the memories used on the FPGA boards
|
113 |
|
|
- drivers for the rri connection (currently just serialport)
|
114 |
|
|
- code to interface the rri data stream to a UNIX 'named pipe',
|
115 |
|
|
implemented with a C routine which is called via VHPI from VHDL.
|
116 |
|
|
This way the whole ghdl simulation can be controlled via a di-directional
|
117 |
|
|
byte stream.
|
118 |
|
|
|
119 |
|
|
The rri backend process, currently a perl script named pi_rri, can connect
|
120 |
|
|
either via a named pipe to a ghdl simulation, or via a serial port to a
|
121 |
|
|
FPGA board. This way the same tests can be executed in simulation and
|
122 |
|
|
on real hardware.
|
123 |
|
|
|
124 |
|
|
4. Available system tests benches -----------------------------------------
|
125 |
|
|
|
126 |
|
|
The stimulus file used in the w11a core test can be executed in the
|
127 |
|
|
full system context (both s3board and nexys2 versions) with the
|
128 |
|
|
following commands. Note that the cycle number printed in the DONE
|
129 |
|
|
line can now vary slightly because the response time of the rri
|
130 |
|
|
backend process and thus scheduling of backend vs. ghdl process
|
131 |
|
|
can affect the result.
|
132 |
|
|
|
133 |
|
|
- sys_w11a_s3 system test
|
134 |
|
|
|
135 |
|
|
cd $RETROBASE/rtl/sys_gen/w11a/s3board/tb
|
136 |
|
|
make tb_w11a_s3
|
137 |
|
|
time pi_rri --fifo --timeout=40. --cmax=3 \
|
138 |
|
|
--run="tbw tb_w11a_s3" -- \
|
139 |
|
|
@../../../../w11a/tb/tb_pdp11_core_stim.dat |\
|
140 |
|
|
tee tb_w11a_s3_stim2_dsim.log | egrep "(-[EW]:|FAIL|PEND|DONE)"
|
141 |
|
|
-> 7766215 ns 388301: DONE
|
142 |
|
|
-> real 0m51.300s user 0m51.711s sys 0m0.772s
|
143 |
|
|
|
144 |
|
|
- sys_w11a_n2 system test
|
145 |
|
|
|
146 |
|
|
cd $RETROBASE/rtl/sys_gen/w11a/nexys2/tb
|
147 |
|
|
make tb_w11a_n2
|
148 |
|
|
time pi_rri --fifo --timeout=40. --cmax=3 \
|
149 |
|
|
--run="tbw tb_w11a_n2" -- \
|
150 |
|
|
@../../../../w11a/tb/tb_pdp11_core_stim.dat |\
|
151 |
|
|
tee tb_w11a_n2_stim2_dsim.log | egrep "(-[EW]:|FAIL|PEND|DONE)"
|
152 |
|
|
-> 7766855 ns 388333: DONE
|
153 |
|
|
-> real 0m51.243s user 0m51.647s sys 0m0.776s
|