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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.5/] [doc/] [w11a_tb_guide.txt] - Blame information for rev 7

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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