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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [doc/] [src/] [guides/] [guide_verification.html] - Blame information for rev 27

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

Line No. Rev Author Line
1 27 jt_eaton
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
<html>
3
<head>
4
  <meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8">
5
  <title>Verification Guidelines</title>
6
  <meta name="GENERATOR" content="OpenOffice.org 3.0  (Linux)">
7
  <meta name="CREATED" content="0;0">
8
  <meta name="CHANGED" content="20100309;9312200">
9
  <meta name="KEYWORDS" content="start">
10
  <meta name="Info 3" content="">
11
  <meta name="Info 4" content="">
12
  <meta name="date" content="2008-01-08T12:01:41-0500">
13
  <meta name="robots" content="index,follow">
14
</head>
15
<body dir="ltr" lang="en-US">
16
<h1><a name="socgen_project"></a><big>SOCGEN Project</big></h1>
17
<h2><br>
18
</h2>
19
<h2><a name="manifesto"></a>Verification Guidelines</h2>
20
<p><br>
21
<br>
22
</p>
23
<p>Verification is the art of stimulating&nbsp; a component&nbsp;
24
module and checking that it produces the correct outputs. Stimulations
25
are designed to
26
ensure that all of the components functions are exercised and any
27
deviation from the expected value is reported as an error. Every
28
component must have at least one test case but may have as many as
29
needed to fully verify the design.<br>
30
</p>
31
<p>A complete test suite is required for every component module.&nbsp;
32
Each test_case is simulated and the log file will indicate whether the
33
test passed or failed. Other output files such as dump files may also
34
be produced duging the simulation.<br>
35
</p>
36
<p><br>
37
</p>
38
<p></p>
39
<br>
40
<p><img style="width: 800px; height: 600px;" alt=""
41
 src="../png/ver_fig1.png"><br>
42
</p>
43
<p><br>
44
</p>
45
<p>A test suite is needed for every piece of IP in the design and
46
creating this suite can be a very labor intensive operation. It usually
47
takes four hours to create the test_cases for each hour that was spent
48
creating the rtl code.&nbsp; A full test must be run on every leaf cell
49
component and some of these are repeated as the components are used as
50
children of other components.&nbsp; It is essential that all test_cases
51
are written so that they may be reused when testing the component when
52
it it part of a parent component.<br>
53
</p>
54
<p><br>
55
</p>
56
<p><br>
57
</p>
58
<p><br>
59
</p>
60
<p><br>
61
</p>
62
<p><br>
63
</p>
64
<p><img style="width: 800px; height: 600px;" alt=""
65
 src="../png/ver_fig2.png"><br>
66
</p>
67
<p>In this case a new component is created by combining&nbsp; two leaf
68
cell components and its test_case is created by combining blocks from
69
those two components test_cases.<br>
70
</p>
71
<p><br>
72
</p>
73
<p><br>
74
</p>
75
<p><br>
76
<br>
77
</p>
78
<p><br>
79
</p>
80
<p><img style="width: 800px; height: 600px;" alt=""
81
 src="../png/ver_fig3.png"><br>
82
</p>
83
<p><br>
84
</p>
85
<p>Every interface on the component is connected to it's own bfm model
86
that contains all the tasks needed to test the interface. The calling
87
sequences needed to preform a particular test are all loaded from a
88
sperate file. It is important that each interface has its task calls in
89
a seperate code block. The goal is to develope these models and task
90
calls on&nbsp; the component simulation and then reuse them as the
91
component is used in larger designs.&nbsp; Interleaving task calls for
92
different models makes that difficult.<br>
93
</p>
94
<p><br>
95
</p>
96
<p><br>
97
<br>
98
</p>
99
<p><br>
100
</p>
101
<h2><a name="manifesto"></a>guidelines for creating reusable test_cases<br>
102
</h2>
103
<br>
104
&nbsp; All test_cases will have a master clock and reset signal.&nbsp;
105
The DUT and all models will respond to the reset signal. Anything in
106
test_define will only change state on the rising edge of clock.<br
107
 style="font-family: serif;">
108
<br style="font-family: serif;">
109
<span style="font-family: serif;">&nbsp; All test_cases will be
110
self-checking.&nbsp; Test suites are usually run by scripts and robots
111
that need a simple method to determine wether a test_case finished and
112
passed. </span><br style="font-family: serif;">
113
<br style="font-family: serif;">
114
<span style="font-family: serif;">&nbsp; All models, tasks and protocal
115
checkers will use a common method to report&nbsp; if there is a failure.</span><br
116
 style="font-family: serif;">
117
<br style="font-family: serif;">
118
<span style="font-family: serif;">&nbsp; All test sequences will use a
119
common method to signal the successful completion of the test</span><br
120
 style="font-family: serif;">
121
<br style="font-family: serif;">
122
<span style="font-family: serif;">&nbsp; All messages in the log file
123
must use the following format:</span><br>
124
<br style="font-family: serif;">
125
<ul style="font-family: monospace;">
126
  <li><big>Time stamp&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is the
127
$realtime&nbsp; formated by %t</big></li>
128
  <li><big>Instance Name&nbsp;&nbsp;&nbsp;&nbsp; This is obtained with
129
%m</big></li>
130
  <li><big>Message Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is either
131
ERROR&nbsp; or WARNING. No type indicates informational message</big></li>
132
  <li><big>Message&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
133
 
134
 
135
    </big><br>
136
  </li>
137
</ul>
138
<br style="font-family: serif;">
139
<br style="font-family: serif;">
140
<p style="font-family: serif;">&nbsp;&nbsp; All test cases MUST have a
141
finite run time.&nbsp; Use a TIMEOUT counter to stop the sim if it
142
exceeds the expected number of clocks<br style="font-family: serif;">
143
</p>
144
<span style="font-family: serif;">&nbsp;&nbsp;
145
<code><span style="font-family: serif;">All test_cases must be
146
deterministic. If any pseudorandom delays are used they must be
147
"seeded" and repeatable from run to run.</span></code></span><code
148
 style="font-family: serif;"><br>
149
<br>
150
<br>
151
&nbsp;<span style="font-family: serif;"> </span></code><span
152
 style="font-family: serif;"><code><span style="font-family: serif;">Do
153
not interweave threads in the test_define blocks. Each block should
154
only access a single BFM.</span><br style="font-family: serif;">
155
<br style="font-family: serif;">
156
<br style="font-family: serif;">
157
<span style="font-family: serif;">&nbsp; Plan on designs where you will
158
need to test multiple instances of a component</span><br
159
 style="font-family: serif;">
160
<br style="font-family: serif;">
161
<span style="font-family: serif;">&nbsp; Only test a single
162
configuration or mode in any test_case. If you need to test 3 different
163
modes then create 3 different test_cases. The exception to this is when
164
there is a mission mode requirement to switch modes and you are testing
165
that switch.&nbsp; </span><br style="font-family: serif;">
166
</code></span>
167
<p style="font-family: serif;"><br>
168
</p>
169
<p><br>
170
</p>
171
<p><br>
172
</p>
173
<p><br>
174
</p>
175
<p><br>
176
</p>
177
<p><br>
178
</p>
179
<p><br>
180
</p>
181
<p><br>
182
</p>
183
<p><br>
184
<br>
185
</p>
186
<p><br>
187
</p>
188
<h2><a name="manifesto"></a>simulation directory (sim)<br>
189
</h2>
190
<p><br>
191
</p>
192
<big><code>
193
./sim<br>
194
&nbsp; +/bin<br>
195
&nbsp;&nbsp; &nbsp;&nbsp; Makefile<br>
196
&nbsp; +/bench<br>
197
&nbsp;&nbsp; &nbsp;&nbsp; +verilog<br>
198
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; TestBench<br>
199
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; +models<br>
200
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; model1<br>
201
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; model2<br>
202
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; .<br>
203
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; .<br>
204
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; .<br>
205
&nbsp; +/lib<br>
206
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +lib_part1<br>
207
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lib_part(s).v<br>
208
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +lib_part2<br>
209
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
210
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
211
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
212
</code><code>&nbsp; +/run</code><br>
213
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +test_case1<br>
214
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filelist<br>
215
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dmp_define<br>
216
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; modellist<br>
217
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dut<br>
218
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test_define<br>
219
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; liblist<br>
220
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TB.defs<br>
221
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +test_case2<br>
222
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
223
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
224
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
225
&nbsp; +/log<br>
226
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test_case1.log<br>
227
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test_case2.log<br>
228
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
229
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
230
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
231
&nbsp; +/out<br>
232
&nbsp;</code><code>&nbsp;&nbsp;&nbsp;&nbsp; test_case1.vcd<br>
233
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test_case2.vcd<br>
234
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
235
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br>
236
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</code><br>
237
</big>
238
<code><ouabache design="" works=""><big><br>
239
<br>
240
<br>
241
</big>
242
<br>
243
</ouabache></code>
244
<p>Each component will have a ./sim directory for the test suite.
245
Typing:<br>
246
</p>
247
<p><big><big><br>
248
<small><span style="font-family: monospace;">
249
&lt;&gt;:~$&gt;cd ./sim/bin</span><br style="font-family: monospace;">
250
</small><span style="font-family: monospace;"><small>
251
&lt;&gt;:~$&gt;make run_sims</small><br>
252
</span></big></big></p>
253
<p><big><big><span style="font-family: monospace;"><br>
254
</span></big></big>
255
</p>
256
will run the entire test suite. After that has been done then
257
individual test_cases may be rerun by changing into their test_case
258
directory and typing:<br>
259
<code><ouabache design="" works=""><br>
260
<br>
261
</ouabache></code>
262
<p><big><big><span style="font-family: monospace;"><small>&lt;&gt;:~$&gt;make
263
sim</small></span></big></big>
264
</p>
265
<p><br>
266
</p>
267
<p>Each test_case will produce a log file that may be parsed for the
268
string "PASSED" to indicate that the sim finished. If so then the log
269
file should be parsed for the strings "ERROR" and "WARNING" to see if
270
there were and errors or warnings. <br>
271
</p>
272
<p>Simulating a test_case requires involking a verilog simulator and
273
passing it command line arguments and a TestBench file. Icarus verilog
274
is the default simulator for the socgen project. Socgen uses a minumal
275
command line and instead puts most needed information in the TestBench
276
file.&nbsp; The only command line option is to set the VCD flag if a
277
value change dump file is needed.<br>
278
</p>
279
<p><br>
280
</p>
281
<p><br>
282
<br>
283
<br>
284
<br>
285
<br>
286
</p>
287
<h2><a name="manifesto"></a>TestBench file<br>
288
</h2>
289
<code>
290
<ouabache design="" works="">--------------------------------------------------------------------------------------------------------------------------------------<br>
291
<br>
292
`include&nbsp; "./TB.defs"<br>
293
<br>
294
`ifndef&nbsp;&nbsp;&nbsp;&nbsp; TIMESCALE<br>
295
`define&nbsp;&nbsp;&nbsp;&nbsp; TIMESCALE&nbsp;&nbsp; 1ns/1ns<br>
296
`endif<br>
297
<br>
298
<br>
299
`ifndef&nbsp;&nbsp;&nbsp;&nbsp; TIMEFORMAT<br>
300
`define&nbsp;&nbsp;&nbsp;&nbsp; TIMEFORMAT&nbsp; $timeformat(-6, 2, "
301
us", 14);<br>
302
`endif<br>
303
<br>
304
<br>
305
`ifndef&nbsp;&nbsp;&nbsp;&nbsp; PERIOD<br>
306
`define&nbsp;&nbsp;&nbsp;&nbsp; PERIOD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
307
40.00000 <br>
308
`endif<br>
309
<br>
310
`ifndef&nbsp;&nbsp;&nbsp;&nbsp; TIMEOUT<br>
311
`define&nbsp;&nbsp;&nbsp;&nbsp; TIMEOUT&nbsp;&nbsp;&nbsp;&nbsp; 200000<br>
312
`endif<br>
313
<br>
314
<br>
315
`timescale `TIMESCALE<br>
316
<br>
317
<br>
318
`include&nbsp; "./filelist"<br>
319
`include&nbsp; "./liblist"<br>
320
`include&nbsp; "./modellist"<br>
321
<br>
322
<br>
323
<br>
324
<br>
325
module TB();<br>
326
<br>
327
wire clk;<br>
328
wire reset;<br>
329
<br>
330
`include "./dut"<br>
331
`include "./test_define"<br>
332
<br>
333
<br>
334
`ifdef VCD<br>
335
initial<br>
336
begin<br>
337
`include "./dmp_define"<br>
338
end<br>
339
`endif<br>
340
<br>
341
clock_gen<br>
342
#(.PERIOD(`PERIOD),<br>
343
&nbsp; .TIMEOUT(`TIMEOUT))<br>
344
cg <br>
345
( .clk&nbsp;&nbsp; ( clk&nbsp;&nbsp; ),<br>
346
&nbsp;
347
.reset ( reset )<br>
348
);<br>
349
<br>
350
<br>
351
<br>
352
<br>
353
endmodule<br>
354
</ouabache></code><span style="font-family: monospace;"><br>
355
--------------------------------------------------------------------------------------------------------------------------------------<br>
356
</span>
357
<p><span style="font-family: monospace;"><br>
358
</span></p>
359
<p><br>
360
<span style="font-family: monospace;"></span></p>
361
<p>A single&nbsp; TestBench file provides the infrastructure for all
362
test cases. The actual testing is determined by the data contained in
363
six files in the ./sim/run/test_case directory. The TestBench file
364
creates a top level module named TB and instantiates a clock_reset
365
generator module to provide each test_case with a clock and a reset
366
signal. It also provides a vcd dump&nbsp; and timeout&nbsp; functions
367
for each test_case.<span style="font-family: monospace;"><br>
368
</span></p>
369
<p><span style="font-family: monospace;"><br>
370
</span></p>
371
<p><span style="font-family: monospace;"><br>
372
</span></p>
373
<h2><a name="manifesto"></a>TB.defs <br>
374
</h2>
375
<p><span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span>
376
</p>
377
<code>
378
`define&nbsp;&nbsp;&nbsp;&nbsp; TIMESCALE&nbsp;&nbsp; 1ns/1ns<br>
379
`define&nbsp;&nbsp;&nbsp;&nbsp; TIMEFORMAT&nbsp; $timeformat(-6, 2, "
380
us", 14);<br>
381
`define&nbsp;&nbsp;&nbsp;&nbsp; PERIOD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
382
40.0000 <br>
383
`define&nbsp;&nbsp;&nbsp;&nbsp; TIMEOUT&nbsp;&nbsp;&nbsp;&nbsp; 200000<br>
384
</code>
385
<p></p>
386
<p><span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------<br>
387
</span></p>
388
<p><span style="font-family: monospace;"><br>
389
</span></p>
390
<p>The TB.defs file may be used to set up the timescale and master
391
clock period for the simulation.&nbsp; Any model or lib part that needs
392
to reset the timescale back to the system default must use:<br>
393
</p>
394
<p><code>`timescale `TIMESCALE<br>
395
</code></p>
396
<p><code><br>
397
<span style="font-family: serif;">Do NOT use</span><br>
398
</code></p>
399
<p><code>`include "./timescale.v"<br>
400
</code></p>
401
<p><code><br>
402
<span style="font-family: serif;">The socgen project does not contain
403
any timescale.v file.&nbsp; All socgen rtl code is preprocessed before
404
it is passed to simulation and the value of the timescale may change
405
depending on the simulation. All ip components must only contain
406
synthesisable code and should not have any need for timescale.<br>
407
</span></code></p>
408
<p><code><span style="font-family: serif;">TIMEFORMAT will set the
409
format that is used when time is displayed using the %t format . All
410
$display statements must start by displaying $realtime using the %t
411
format so every line in the log has a time stamp. Any display statement
412
from an instantiated module must also have %m to print out it's
413
instance name. If the message is an error or a warning then the strings
414
ERROR or WARNING must be used so that this information may be parsed
415
from the log file.<br>
416
<br style="font-family: serif;">
417
</span></code></p>
418
<p><span style="font-family: monospace;"><br>
419
</span>The TB.defs file may also
420
be used to pass the size and location&nbsp; of an embedded&nbsp; bit
421
file to the device_under_test<span style="font-family: monospace;"> <br>
422
</span></p>
423
<p><span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span></p>
424
<p><span style="font-family: monospace;">`define&nbsp; ROM_WORDS 2048 <br>
425
`define&nbsp; ROM_ADDR&nbsp;&nbsp; 11&nbsp; <br>
426
`define&nbsp; ROM_WIDTH&nbsp; 12&nbsp; <br>
427
`define&nbsp; ROM_FILE "../../../../../sw/mouse/mouse.abs12"<br>
428
</span><span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span><br>
429
</p>
430
<p>The path is the relative path from the test_case run directory.<span
431
 style="font-family: monospace;"><br>
432
</span></p>
433
<p><span style="font-family: monospace;"><br>
434
</span></p>
435
<h2><a name="manifesto"></a>filelist </h2>
436
<p style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------<br>
437
</p>
438
<p style="font-family: monospace;">`include
439
"../../../rtl/gen/sim/soc_mouse.v"<br>
440
`include "../../../../pic16c5x/rtl/gen/sim/pic16c5x.v"<br>
441
`include
442
"../../../../../children/logic/ip/io_module/rtl/gen/sim/io_module_mouse.v"<br>
443
`include
444
"../../../../../children/logic/ip/ps2_interface/rtl/gen/sim/ps2_interface.v"<br>
445
`include "../../../../../children/logic/ip/uart/rtl/gen/sim/uart.v"<br>
446
</p>
447
<code style="font-family: monospace;"></code>
448
<span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span>
449
<p><br>
450
</p>
451
<p>The filelist uses `include statements to load all the rtl files into
452
the simulation.The paths are&nbsp; relative from the test_case run
453
directory. Note that all the verilog files have been post-processed and
454
search directories or include directories are not needed.
455
</p>
456
<p><br>
457
</p>
458
<h2><a name="manifesto"></a>liblist</h2>
459
<p><span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span>
460
</p>
461
<code>
462
<br>
463
`include "../../lib/cde_sram/cde_sram.v"<br>
464
`include "../../lib/cde_lifo/cde_lifo.v"<br>
465
`include "../../lib/cde_synchronizers/cde_sync_with_hysteresis.v"<br>
466
<br>
467
</code>
468
<span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span><br>
469
<p>The liblist uses `include statements to load all the generic lib
470
models&nbsp; into
471
the simulation.The paths are&nbsp; relative from the test_case run
472
directory. Note that these libs may be replaced&nbsp; by vendor
473
specific instances when the design is&nbsp; synthesised into gates.<br>
474
</p>
475
<p><br>
476
</p>
477
<p></p>
478
<p><br>
479
</p>
480
<h2><a name="manifesto"></a>modellist</h2>
481
<p><span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span>
482
</p>
483
<code><br>
484
`include "../../bench/verilog/models/clock_gen.v"<br>
485
`include "../../bench/verilog/models/ps2_model.v"&nbsp;&nbsp;&nbsp; <br>
486
`include "../../bench/verilog/models/iobuftri.v"&nbsp;&nbsp;&nbsp; <br>
487
</code><span style="font-family: monospace;"></span><code><br>
488
</code>
489
<span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span><br>
490
<br>
491
This list loads all of the simulation models used in the simulation.<br>
492
<br>
493
<p><br>
494
<br>
495
</p>
496
<h2><a name="manifesto"></a>dut<br>
497
</h2>
498
<p><span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span></p>
499
<p><code>reg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
500
device_write;<br>
501
reg&nbsp; [7:0]&nbsp;&nbsp; device_tx_data;<br>
502
reg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device_parity;<br>
503
reg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device_ack;<br>
504
reg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device_stop;<br>
505
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device_rx_read;<br>
506
wire [7:0]&nbsp;&nbsp; device_rx_data;<br>
507
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device_rx_parity;<br>
508
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps2_data_pad_oe;<br>
509
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps2_data_pad_in;<br>
510
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps2_data;<br>
511
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps2_clk_pad_oe;<br>
512
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps2_clk_pad_in;<br>
513
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps2_clk;<br>
514
<br>
515
<br>
516
<br>
517
wire [7:0]&nbsp;&nbsp;&nbsp;&nbsp; portaout;<br>
518
wire [7:0]&nbsp;&nbsp;&nbsp;&nbsp; portbout;<br>
519
wire [7:0]&nbsp;&nbsp;&nbsp;&nbsp; portcout;<br>
520
<br>
521
<br>
522
wire [9:0]&nbsp;&nbsp;&nbsp;&nbsp; y_pos;<br>
523
wire [9:0]&nbsp;&nbsp;&nbsp;&nbsp; x_pos;<br>
524
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
525
new_packet;<br>
526
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
527
ms_mid; <br>
528
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
529
ms_right;&nbsp; <br>
530
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
531
ms_left;&nbsp; <br>
532
<br>
533
<br>
534
<br>
535
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
536
txd_pad_out;<br>
537
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
538
rxd_pad_in;<br>
539
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
540
cts_pad_in;<br>
541
wire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
542
rts_pad_out;&nbsp; <br>
543
<br>
544
<br>
545
// Instantiate one CPU to be tested.<br>
546
soc_mouse<br>
547
#(<br>
548
.ROM_WORDS ( `ROM_WORDS ), <br>
549
.ROM_ADDR&nbsp; ( `ROM_ADDR&nbsp; ),&nbsp; <br>
550
.ROM_WIDTH ( `ROM_WIDTH ), <br>
551
.ROM_FILE&nbsp; ( `ROM_FILE&nbsp; )<br>
552
)<br>
553
dut(<br>
554
&nbsp;&nbsp; .clk&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (
555
clk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br>
556
&nbsp;&nbsp; .reset&nbsp;&nbsp;&nbsp; (
557
reset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br>
558
<br>
559
&nbsp;&nbsp; .ps2_data_pad_in ( ps2_data_pad_in ),<br>
560
&nbsp;&nbsp; .ps2_clk_pad_in&nbsp; ( ps2_clk_pad_in&nbsp; ),<br>
561
<br>
562
&nbsp;&nbsp; .ps2_data_pad_oe ( ps2_data_pad_oe ),<br>
563
&nbsp;&nbsp; .ps2_clk_pad_oe&nbsp; ( ps2_clk_pad_oe&nbsp; ),<br>
564
<br>
565
<br>
566
&nbsp;&nbsp; .portaout&nbsp;&nbsp;&nbsp; ( portaout&nbsp;&nbsp;&nbsp; ),<br>
567
&nbsp;&nbsp; .portbout&nbsp;&nbsp;&nbsp; ( portbout&nbsp;&nbsp;&nbsp; ),<br>
568
&nbsp;&nbsp; .portcout&nbsp;&nbsp;&nbsp; ( portcout&nbsp;&nbsp;&nbsp; ),<br>
569
<br>
570
<br>
571
&nbsp;&nbsp; .y_pos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
572
y_pos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br>
573
&nbsp;&nbsp; .x_pos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
574
x_pos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br>
575
&nbsp;&nbsp; .new_packet&nbsp; ( new_packet&nbsp; ),<br>
576
&nbsp;&nbsp; .ms_mid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
577
ms_mid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ), <br>
578
&nbsp;&nbsp; .ms_right&nbsp;&nbsp;&nbsp; ( ms_right&nbsp;&nbsp;&nbsp;
579
),&nbsp; <br>
580
&nbsp;&nbsp; .ms_left&nbsp;&nbsp;&nbsp;&nbsp; (
581
ms_left&nbsp;&nbsp;&nbsp;&nbsp; ),&nbsp; <br>
582
<br>
583
<br>
584
<br>
585
&nbsp;&nbsp; .txd_pad_out ( loop1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br>
586
&nbsp;&nbsp; .rxd_pad_in&nbsp; (
587
loop1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br>
588
&nbsp;&nbsp; .cts_pad_in&nbsp; (
589
loop2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br>
590
&nbsp;&nbsp; .rts_pad_out ( loop2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
591
)&nbsp; <br>
592
<br>
593
&nbsp;&nbsp; );<br>
594
<br>
595
<br>
596
iobuftri<br>
597
data_tri_buf<br>
598
&nbsp; (<br>
599
&nbsp;&nbsp; .i&nbsp;&nbsp; (
600
1'b0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br>
601
&nbsp;&nbsp; .oe&nbsp; ( ps2_data_pad_oe ),<br>
602
&nbsp;&nbsp; .o&nbsp;&nbsp; ( ps2_data_pad_in ),<br>
603
&nbsp;&nbsp; .pad ( ps2_data&nbsp;&nbsp;&nbsp; )<br>
604
&nbsp;&nbsp; );<br>
605
<br>
606
<br>
607
iobuftri<br>
608
clk_tri_buf<br>
609
&nbsp; (<br>
610
&nbsp;&nbsp; .i&nbsp;&nbsp; ( 1'b0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
611
),<br>
612
&nbsp;&nbsp; .oe&nbsp; ( ps2_clk_pad_oe ),<br>
613
&nbsp;&nbsp; .o&nbsp;&nbsp; ( ps2_clk_pad_in ),<br>
614
&nbsp;&nbsp; .pad ( ps2_clk&nbsp;&nbsp;&nbsp; )<br>
615
&nbsp;&nbsp; );<br>
616
<br>
617
<br>
618
<br>
619
pullup ua0(ps2_clk);<br>
620
pullup ua1(ps2_data);<br>
621
<br>
622
<br>
623
ps2_model <br>
624
#(.CLKCNT(10'h177))<br>
625
ps2<br>
626
(<br>
627
&nbsp;&nbsp;
628
.clk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
629
(
630
clk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
631
),<br>
632
&nbsp;&nbsp;
633
.reset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
634
(
635
reset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
636
),
637
<br>
638
&nbsp;&nbsp;
639
.send&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
640
(
641
device_write&nbsp;&nbsp;&nbsp;&nbsp;
642
),<br>
643
&nbsp;&nbsp;
644
.send_data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
645
(
646
device_tx_data&nbsp;&nbsp;
647
),<br>
648
&nbsp;&nbsp;
649
.device_parity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
650
device_parity&nbsp;&nbsp;&nbsp; ),<br>
651
&nbsp;&nbsp;
652
.device_ack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
653
(
654
device_ack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
655
),<br>
656
&nbsp;&nbsp;
657
.device_stop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
658
(
659
device_stop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
660
),<br>
661
&nbsp;&nbsp;
662
.device_rx_read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
663
device_rx_read&nbsp;&nbsp; ),<br>
664
&nbsp;&nbsp;
665
.device_rx_data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
666
device_rx_data&nbsp;&nbsp; ),<br>
667
&nbsp;&nbsp; .device_rx_parity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
668
device_rx_parity ),<br>
669
<br>
670
&nbsp;&nbsp;
671
.ps2_clk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
672
(
673
ps2_clk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
674
),<br>
675
&nbsp;&nbsp;
676
.ps2_data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
677
(
678
ps2_data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
679
)<br>
680
<br>
681
);<br>
682
</code><span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span><br>
683
</p>
684
<p>This file is a verilog code segment that declares all the wires and
685
regs needed in the sim (except for clk and reset). It then&nbsp;
686
instantiates the component and all needed models for the simulation.<br>
687
</p>
688
<p><br>
689
</p>
690
<p><br>
691
</p>
692
<p><br>
693
</p>
694
<h2><a name="manifesto"></a>test_define<br>
695
</h2>
696
<p><span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span></p>
697
<p><br>
698
</p>
699
<p><span style="font-family: monospace;">initial</span><br
700
 style="font-family: monospace;">
701
<span style="font-family: monospace;">begin</span><br
702
 style="font-family: monospace;">
703
<span style="font-family: monospace;">&nbsp;`TIMEFORMAT</span><br
704
 style="font-family: monospace;">
705
<span style="font-family: monospace;">$display("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
706
");</span><br style="font-family: monospace;">
707
<span style="font-family: monospace;">$display("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
708
===================================================");</span><br
709
 style="font-family: monospace;">
710
<span style="font-family: monospace;">$display("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
711
Test
712
Start");</span><br style="font-family: monospace;">
713
<span style="font-family: monospace;">$display("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
714
===================================================");</span><br
715
 style="font-family: monospace;">
716
<span style="font-family: monospace;">$display("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
717
");</span><br style="font-family: monospace;">
718
<br style="font-family: monospace;">
719
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
720
=&nbsp;
721
1'b0;</span><br style="font-family: monospace;">
722
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
723
=&nbsp; 8'h00;</span><br style="font-family: monospace;">
724
<span style="font-family: monospace;">device_ack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
725
=&nbsp;
726
1'b1;</span><br style="font-family: monospace;">
727
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
728
=&nbsp; 1'b1;</span><br style="font-family: monospace;">
729
<span style="font-family: monospace;">device_stop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
730
=&nbsp;
731
1'b1;</span><br style="font-family: monospace;">
732
<br style="font-family: monospace;">
733
<br style="font-family: monospace;">
734
<br style="font-family: monospace;">
735
<span style="font-family: monospace;">cg.next(20);</span><br
736
 style="font-family: monospace;">
737
<span style="font-family: monospace;">cg.reset_off;</span><br
738
 style="font-family: monospace;">
739
<br style="font-family: monospace;">
740
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
741
cg.next(1);</span><br style="font-family: monospace;">
742
<span style="font-family: monospace;">cg.next(2000);</span><br
743
 style="font-family: monospace;">
744
<br style="font-family: monospace;">
745
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
746
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
747
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
748
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
749
<span style="font-family: monospace;">cg.next(1);</span><br
750
 style="font-family: monospace;">
751
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
752
=&nbsp;
753
1'b1;</span><br style="font-family: monospace;">
754
<span style="font-family: monospace;">cg.next(1);</span><br
755
 style="font-family: monospace;">
756
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
757
=&nbsp;
758
1'b0;</span><br style="font-family: monospace;">
759
<br style="font-family: monospace;">
760
<br style="font-family: monospace;">
761
<br style="font-family: monospace;">
762
<br style="font-family: monospace;">
763
<span style="font-family: monospace;">cg.next(20000);</span><br
764
 style="font-family: monospace;">
765
<br style="font-family: monospace;">
766
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
767
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
768
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
769
=&nbsp; 8'haa;</span><br style="font-family: monospace;">
770
<span style="font-family: monospace;">cg.next(1);</span><br
771
 style="font-family: monospace;">
772
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
773
=&nbsp;
774
1'b1;</span><br style="font-family: monospace;">
775
<span style="font-family: monospace;">cg.next(1);</span><br
776
 style="font-family: monospace;">
777
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
778
=&nbsp;
779
1'b0;</span><br style="font-family: monospace;">
780
<br style="font-family: monospace;">
781
<br style="font-family: monospace;">
782
<br style="font-family: monospace;">
783
<br style="font-family: monospace;">
784
<br style="font-family: monospace;">
785
<br style="font-family: monospace;">
786
<span style="font-family: monospace;">cg.next(20000);</span><br
787
 style="font-family: monospace;">
788
<br style="font-family: monospace;">
789
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
790
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
791
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
792
=&nbsp; 8'h00;</span><br style="font-family: monospace;">
793
<span style="font-family: monospace;">cg.next(1);</span><br
794
 style="font-family: monospace;">
795
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
796
=&nbsp;
797
1'b1;</span><br style="font-family: monospace;">
798
<span style="font-family: monospace;">cg.next(1);</span><br
799
 style="font-family: monospace;">
800
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
801
=&nbsp;
802
1'b0;</span><br style="font-family: monospace;">
803
<br style="font-family: monospace;">
804
<br style="font-family: monospace;">
805
<br style="font-family: monospace;">
806
<br style="font-family: monospace;">
807
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
808
cg.next(1);</span><br style="font-family: monospace;">
809
<span style="font-family: monospace;">cg.next(2000);</span><br
810
 style="font-family: monospace;">
811
<br style="font-family: monospace;">
812
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
813
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
814
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
815
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
816
<span style="font-family: monospace;">cg.next(1);</span><br
817
 style="font-family: monospace;">
818
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
819
=&nbsp;
820
1'b1;</span><br style="font-family: monospace;">
821
<span style="font-family: monospace;">cg.next(1);</span><br
822
 style="font-family: monospace;">
823
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
824
=&nbsp;
825
1'b0;</span><br style="font-family: monospace;">
826
<br style="font-family: monospace;">
827
<br style="font-family: monospace;">
828
<br style="font-family: monospace;">
829
<br style="font-family: monospace;">
830
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
831
cg.next(1);</span><br style="font-family: monospace;">
832
<span style="font-family: monospace;">cg.next(2000);</span><br
833
 style="font-family: monospace;">
834
<br style="font-family: monospace;">
835
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
836
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
837
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
838
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
839
<span style="font-family: monospace;">cg.next(1);</span><br
840
 style="font-family: monospace;">
841
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
842
=&nbsp;
843
1'b1;</span><br style="font-family: monospace;">
844
<span style="font-family: monospace;">cg.next(1);</span><br
845
 style="font-family: monospace;">
846
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
847
=&nbsp;
848
1'b0;</span><br style="font-family: monospace;">
849
<br style="font-family: monospace;">
850
<br style="font-family: monospace;">
851
<br style="font-family: monospace;">
852
<br style="font-family: monospace;">
853
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
854
cg.next(1);</span><br style="font-family: monospace;">
855
<span style="font-family: monospace;">cg.next(2000);</span><br
856
 style="font-family: monospace;">
857
<br style="font-family: monospace;">
858
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
859
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
860
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
861
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
862
<span style="font-family: monospace;">cg.next(1);</span><br
863
 style="font-family: monospace;">
864
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
865
=&nbsp;
866
1'b1;</span><br style="font-family: monospace;">
867
<span style="font-family: monospace;">cg.next(1);</span><br
868
 style="font-family: monospace;">
869
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
870
=&nbsp;
871
1'b0;</span><br style="font-family: monospace;">
872
<br style="font-family: monospace;">
873
<br style="font-family: monospace;">
874
<br style="font-family: monospace;">
875
<br style="font-family: monospace;">
876
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
877
cg.next(1);</span><br style="font-family: monospace;">
878
<span style="font-family: monospace;">cg.next(2000);</span><br
879
 style="font-family: monospace;">
880
<br style="font-family: monospace;">
881
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
882
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
883
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
884
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
885
<span style="font-family: monospace;">cg.next(1);</span><br
886
 style="font-family: monospace;">
887
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
888
=&nbsp;
889
1'b1;</span><br style="font-family: monospace;">
890
<span style="font-family: monospace;">cg.next(1);</span><br
891
 style="font-family: monospace;">
892
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
893
=&nbsp;
894
1'b0;</span><br style="font-family: monospace;">
895
<br style="font-family: monospace;">
896
<br style="font-family: monospace;">
897
<br style="font-family: monospace;">
898
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
899
cg.next(1);</span><br style="font-family: monospace;">
900
<span style="font-family: monospace;">cg.next(2000);</span><br
901
 style="font-family: monospace;">
902
<br style="font-family: monospace;">
903
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
904
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
905
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
906
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
907
<span style="font-family: monospace;">cg.next(1);</span><br
908
 style="font-family: monospace;">
909
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
910
=&nbsp;
911
1'b1;</span><br style="font-family: monospace;">
912
<span style="font-family: monospace;">cg.next(1);</span><br
913
 style="font-family: monospace;">
914
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
915
=&nbsp;
916
1'b0;</span><br style="font-family: monospace;">
917
<br style="font-family: monospace;">
918
<br style="font-family: monospace;">
919
<br style="font-family: monospace;">
920
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
921
cg.next(1);</span><br style="font-family: monospace;">
922
<span style="font-family: monospace;">cg.next(2000);</span><br
923
 style="font-family: monospace;">
924
<br style="font-family: monospace;">
925
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
926
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
927
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
928
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
929
<span style="font-family: monospace;">cg.next(1);</span><br
930
 style="font-family: monospace;">
931
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
932
=&nbsp;
933
1'b1;</span><br style="font-family: monospace;">
934
<span style="font-family: monospace;">cg.next(1);</span><br
935
 style="font-family: monospace;">
936
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
937
=&nbsp;
938
1'b0;</span><br style="font-family: monospace;">
939
<br style="font-family: monospace;">
940
<br style="font-family: monospace;">
941
<br style="font-family: monospace;">
942
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
943
cg.next(1);</span><br style="font-family: monospace;">
944
<span style="font-family: monospace;">cg.next(2000);</span><br
945
 style="font-family: monospace;">
946
<br style="font-family: monospace;">
947
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
948
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
949
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
950
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
951
<span style="font-family: monospace;">cg.next(1);</span><br
952
 style="font-family: monospace;">
953
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
954
=&nbsp;
955
1'b1;</span><br style="font-family: monospace;">
956
<span style="font-family: monospace;">cg.next(1);</span><br
957
 style="font-family: monospace;">
958
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
959
=&nbsp;
960
1'b0;</span><br style="font-family: monospace;">
961
<br style="font-family: monospace;">
962
<br style="font-family: monospace;">
963
<br style="font-family: monospace;">
964
<br style="font-family: monospace;">
965
<br style="font-family: monospace;">
966
<span style="font-family: monospace;">cg.next(20000);</span><br
967
 style="font-family: monospace;">
968
<br style="font-family: monospace;">
969
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
970
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
971
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
972
=&nbsp; 8'h03;</span><br style="font-family: monospace;">
973
<span style="font-family: monospace;">cg.next(1);</span><br
974
 style="font-family: monospace;">
975
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
976
=&nbsp;
977
1'b1;</span><br style="font-family: monospace;">
978
<span style="font-family: monospace;">cg.next(1);</span><br
979
 style="font-family: monospace;">
980
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
981
=&nbsp;
982
1'b0;</span><br style="font-family: monospace;">
983
<br style="font-family: monospace;">
984
<br style="font-family: monospace;">
985
<br style="font-family: monospace;">
986
<br style="font-family: monospace;">
987
<br style="font-family: monospace;">
988
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
989
cg.next(1);</span><br style="font-family: monospace;">
990
<span style="font-family: monospace;">cg.next(2000);</span><br
991
 style="font-family: monospace;">
992
<br style="font-family: monospace;">
993
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
994
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
995
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
996
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
997
<span style="font-family: monospace;">cg.next(1);</span><br
998
 style="font-family: monospace;">
999
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1000
=&nbsp;
1001
1'b1;</span><br style="font-family: monospace;">
1002
<span style="font-family: monospace;">cg.next(1);</span><br
1003
 style="font-family: monospace;">
1004
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1005
=&nbsp;
1006
1'b0;</span><br style="font-family: monospace;">
1007
<br style="font-family: monospace;">
1008
<br style="font-family: monospace;">
1009
<br style="font-family: monospace;">
1010
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
1011
cg.next(1);</span><br style="font-family: monospace;">
1012
<span style="font-family: monospace;">cg.next(2000);</span><br
1013
 style="font-family: monospace;">
1014
<br style="font-family: monospace;">
1015
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1016
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
1017
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1018
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
1019
<span style="font-family: monospace;">cg.next(1);</span><br
1020
 style="font-family: monospace;">
1021
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1022
=&nbsp;
1023
1'b1;</span><br style="font-family: monospace;">
1024
<span style="font-family: monospace;">cg.next(1);</span><br
1025
 style="font-family: monospace;">
1026
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1027
=&nbsp;
1028
1'b0;</span><br style="font-family: monospace;">
1029
<br style="font-family: monospace;">
1030
<br style="font-family: monospace;">
1031
<br style="font-family: monospace;">
1032
<br style="font-family: monospace;">
1033
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
1034
cg.next(1);</span><br style="font-family: monospace;">
1035
<span style="font-family: monospace;">cg.next(2000);</span><br
1036
 style="font-family: monospace;">
1037
<br style="font-family: monospace;">
1038
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1039
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
1040
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1041
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
1042
<span style="font-family: monospace;">cg.next(1);</span><br
1043
 style="font-family: monospace;">
1044
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1045
=&nbsp;
1046
1'b1;</span><br style="font-family: monospace;">
1047
<span style="font-family: monospace;">cg.next(1);</span><br
1048
 style="font-family: monospace;">
1049
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1050
=&nbsp;
1051
1'b0;</span><br style="font-family: monospace;">
1052
<br style="font-family: monospace;">
1053
<br style="font-family: monospace;">
1054
<br style="font-family: monospace;">
1055
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
1056
cg.next(1);</span><br style="font-family: monospace;">
1057
<span style="font-family: monospace;">cg.next(2000);</span><br
1058
 style="font-family: monospace;">
1059
<br style="font-family: monospace;">
1060
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1061
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
1062
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1063
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
1064
<span style="font-family: monospace;">cg.next(1);</span><br
1065
 style="font-family: monospace;">
1066
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1067
=&nbsp;
1068
1'b1;</span><br style="font-family: monospace;">
1069
<span style="font-family: monospace;">cg.next(1);</span><br
1070
 style="font-family: monospace;">
1071
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1072
=&nbsp;
1073
1'b0;</span><br style="font-family: monospace;">
1074
<br style="font-family: monospace;">
1075
<br style="font-family: monospace;">
1076
<br style="font-family: monospace;">
1077
<br style="font-family: monospace;">
1078
<span style="font-family: monospace;">while (device_rx_read == 1'b0 )
1079
cg.next(1);</span><br style="font-family: monospace;">
1080
<span style="font-family: monospace;">cg.next(2000);</span><br
1081
 style="font-family: monospace;">
1082
<br style="font-family: monospace;">
1083
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1084
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
1085
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1086
=&nbsp; 8'hfa;</span><br style="font-family: monospace;">
1087
<span style="font-family: monospace;">cg.next(1);</span><br
1088
 style="font-family: monospace;">
1089
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1090
=&nbsp;
1091
1'b1;</span><br style="font-family: monospace;">
1092
<span style="font-family: monospace;">cg.next(1);</span><br
1093
 style="font-family: monospace;">
1094
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1095
=&nbsp;
1096
1'b0;</span><br style="font-family: monospace;">
1097
<br style="font-family: monospace;">
1098
<br style="font-family: monospace;">
1099
<br style="font-family: monospace;">
1100
<br style="font-family: monospace;">
1101
<br style="font-family: monospace;">
1102
<br style="font-family: monospace;">
1103
<span style="font-family: monospace;">cg.next(20000);</span><br
1104
 style="font-family: monospace;">
1105
<br style="font-family: monospace;">
1106
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1107
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
1108
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1109
=&nbsp; 8'h12;</span><br style="font-family: monospace;">
1110
<span style="font-family: monospace;">cg.next(1);</span><br
1111
 style="font-family: monospace;">
1112
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1113
=&nbsp;
1114
1'b1;</span><br style="font-family: monospace;">
1115
<span style="font-family: monospace;">cg.next(1);</span><br
1116
 style="font-family: monospace;">
1117
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1118
=&nbsp;
1119
1'b0;</span><br style="font-family: monospace;">
1120
<br style="font-family: monospace;">
1121
<br style="font-family: monospace;">
1122
<br style="font-family: monospace;">
1123
<span style="font-family: monospace;">cg.next(20000);</span><br
1124
 style="font-family: monospace;">
1125
<br style="font-family: monospace;">
1126
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1127
=&nbsp; 1'b1;</span><br style="font-family: monospace;">
1128
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1129
=&nbsp; 8'h34;</span><br style="font-family: monospace;">
1130
<span style="font-family: monospace;">cg.next(1);</span><br
1131
 style="font-family: monospace;">
1132
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1133
=&nbsp;
1134
1'b1;</span><br style="font-family: monospace;">
1135
<span style="font-family: monospace;">cg.next(1);</span><br
1136
 style="font-family: monospace;">
1137
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1138
=&nbsp;
1139
1'b0;</span><br style="font-family: monospace;">
1140
<br style="font-family: monospace;">
1141
<br style="font-family: monospace;">
1142
<br style="font-family: monospace;">
1143
<span style="font-family: monospace;">cg.next(20000);</span><br
1144
 style="font-family: monospace;">
1145
<br style="font-family: monospace;">
1146
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1147
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
1148
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1149
=&nbsp; 8'h56;</span><br style="font-family: monospace;">
1150
<span style="font-family: monospace;">cg.next(1);</span><br
1151
 style="font-family: monospace;">
1152
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1153
=&nbsp;
1154
1'b1;</span><br style="font-family: monospace;">
1155
<span style="font-family: monospace;">cg.next(1);</span><br
1156
 style="font-family: monospace;">
1157
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1158
=&nbsp;
1159
1'b0;</span><br style="font-family: monospace;">
1160
<br style="font-family: monospace;">
1161
<br style="font-family: monospace;">
1162
<br style="font-family: monospace;">
1163
<br style="font-family: monospace;">
1164
<br style="font-family: monospace;">
1165
<br style="font-family: monospace;">
1166
<br style="font-family: monospace;">
1167
<br style="font-family: monospace;">
1168
<span style="font-family: monospace;">cg.next(20000);</span><br
1169
 style="font-family: monospace;">
1170
<br style="font-family: monospace;">
1171
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1172
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
1173
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1174
=&nbsp; 8'h78;</span><br style="font-family: monospace;">
1175
<span style="font-family: monospace;">cg.next(1);</span><br
1176
 style="font-family: monospace;">
1177
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1178
=&nbsp;
1179
1'b1;</span><br style="font-family: monospace;">
1180
<span style="font-family: monospace;">cg.next(1);</span><br
1181
 style="font-family: monospace;">
1182
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1183
=&nbsp;
1184
1'b0;</span><br style="font-family: monospace;">
1185
<br style="font-family: monospace;">
1186
<br style="font-family: monospace;">
1187
<br style="font-family: monospace;">
1188
<span style="font-family: monospace;">cg.next(20000);</span><br
1189
 style="font-family: monospace;">
1190
<br style="font-family: monospace;">
1191
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1192
=&nbsp; 1'b0;</span><br style="font-family: monospace;">
1193
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1194
=&nbsp; 8'h9a;</span><br style="font-family: monospace;">
1195
<span style="font-family: monospace;">cg.next(1);</span><br
1196
 style="font-family: monospace;">
1197
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1198
=&nbsp;
1199
1'b1;</span><br style="font-family: monospace;">
1200
<span style="font-family: monospace;">cg.next(1);</span><br
1201
 style="font-family: monospace;">
1202
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1203
=&nbsp;
1204
1'b0;</span><br style="font-family: monospace;">
1205
<br style="font-family: monospace;">
1206
<br style="font-family: monospace;">
1207
<br style="font-family: monospace;">
1208
<span style="font-family: monospace;">cg.next(20000);</span><br
1209
 style="font-family: monospace;">
1210
<br style="font-family: monospace;">
1211
<span style="font-family: monospace;">device_parity&nbsp;&nbsp;&nbsp;
1212
=&nbsp; 1'b1;</span><br style="font-family: monospace;">
1213
<span style="font-family: monospace;">device_tx_data&nbsp;&nbsp;
1214
=&nbsp; 8'hbc;</span><br style="font-family: monospace;">
1215
<span style="font-family: monospace;">cg.next(1);</span><br
1216
 style="font-family: monospace;">
1217
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1218
=&nbsp;
1219
1'b1;</span><br style="font-family: monospace;">
1220
<span style="font-family: monospace;">cg.next(1);</span><br
1221
 style="font-family: monospace;">
1222
<span style="font-family: monospace;">device_write&nbsp;&nbsp;&nbsp;&nbsp;
1223
=&nbsp;
1224
1'b0;</span><br style="font-family: monospace;">
1225
<br style="font-family: monospace;">
1226
<br style="font-family: monospace;">
1227
<br style="font-family: monospace;">
1228
<br style="font-family: monospace;">
1229
<br style="font-family: monospace;">
1230
<br style="font-family: monospace;">
1231
<span style="font-family: monospace;">cg.next(20000);</span><br
1232
 style="font-family: monospace;">
1233
<br style="font-family: monospace;">
1234
<br style="font-family: monospace;">
1235
<br style="font-family: monospace;">
1236
<span style="font-family: monospace;">$display("%t&nbsp;&nbsp;&nbsp;
1237
Test&nbsp; PASSED",$realtime);</span><br style="font-family: monospace;">
1238
<span style="font-family: monospace;">$finish;</span><br
1239
 style="font-family: monospace;">
1240
<span style="font-family: monospace;">end</span><br
1241
 style="font-family: monospace;">
1242
<br style="font-family: monospace;">
1243
<br>
1244
</p>
1245
<p><br>
1246
</p>
1247
<p><br>
1248
<span style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------</span><br>
1249
</p>
1250
<p><br>
1251
</p>
1252
<h2><a name="manifesto"></a>dmp_define<br>
1253
</h2>
1254
<p style="font-family: monospace;">--------------------------------------------------------------------------------------------------------------------------------------<br>
1255
</p>
1256
<p style="font-family: monospace;">$dumpfile ("TestBench.vcd");<br>
1257
$dumpvars (0, TB);<br>
1258
--------------------------------------------------------------------------------------------------------------------------------------<br>
1259
<br>
1260
</p>
1261
<p><br>
1262
<br>
1263
</p>
1264
<p><br>
1265
<br>
1266
</p>
1267
<p><br>
1268
<br>
1269
</p>
1270
<p><br>
1271
</p>
1272
<p><br>
1273
</p>
1274
<p><br>
1275
</p>
1276
<p>This is a test<br>
1277
</p>
1278
<p><br>
1279
&nbsp;<br>
1280
</p>
1281
<p><br>
1282
<br>
1283
</p>
1284
<p><br>
1285
<br>
1286
</p>
1287
<p><br>
1288
<br>
1289
</p>
1290
<p><br>
1291
<br>
1292
</p>
1293
<p><br>
1294
<br>
1295
</p>
1296
</body>
1297
</html>

powered by: WebSVN 2.1.0

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