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

Subversion Repositories cpu8080

[/] [cpu8080/] [trunk/] [project/] [cpu8080_tbw.tfw] - Blame information for rev 28

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

Line No. Rev Author Line
1 11 samiam9512
////////////////////////////////////////////////////////////////////////////////
2
// Copyright (c) 1995-2003 Xilinx, Inc.
3
// All Right Reserved.
4
////////////////////////////////////////////////////////////////////////////////
5
//   ____  ____
6
//  /   /\/   /
7
// /___/  \  /    Vendor: Xilinx
8
// \   \   \/     Version : 8.2.02i
9
//  \   \         Application : ISE
10
//  /   /         Filename : cpu8080_tbw.tfw
11 28 samiam9512
// /___/   /\     Timestamp : Sat Nov 18 13:39:13 2006
12 11 samiam9512
// \   \  /  \
13
//  \___\/\___\
14
//
15
//Command:
16
//Design Name: cpu8080_tbw
17
//Device: Xilinx
18
//
19
`timescale 1ns/1ps
20
 
21
module cpu8080_tbw;
22
    wire [15:0] addr;
23
    reg [7:0] data$inout$reg = 8'b00000000;
24
    wire [7:0] data = data$inout$reg;
25
    wire readmem;
26
    wire writemem;
27
    wire readio;
28
    wire writeio;
29
    wire intr;
30
    wire inta;
31 18 samiam9512
    wire waitr;
32 11 samiam9512
    wire [2:0] r;
33
    wire [2:0] g;
34
    wire [2:0] b;
35
    wire hsync_n;
36
    wire vsync_n;
37 18 samiam9512
    reg ps2_clk = 1'b0;
38
    reg ps2_data = 1'b0;
39
    reg reset_n = 1'b0;
40 11 samiam9512
    reg clock = 1'b0;
41 28 samiam9512
    wire [7:0] diag;
42 11 samiam9512
 
43
    parameter PERIOD = 40;
44
    parameter real DUTY_CYCLE = 0.5;
45
    parameter OFFSET = 100;
46
 
47
    initial    // Clock process for clock
48
    begin
49
        #OFFSET;
50
        forever
51
        begin
52
            clock = 1'b0;
53
            #(PERIOD-(PERIOD*DUTY_CYCLE)) clock = 1'b1;
54
            #(PERIOD*DUTY_CYCLE);
55
        end
56
    end
57
 
58
    testbench UUT (
59
        .addr(addr),
60
        .data(data),
61
        .readmem(readmem),
62
        .writemem(writemem),
63
        .readio(readio),
64
        .writeio(writeio),
65
        .intr(intr),
66
        .inta(inta),
67
        .waitr(waitr),
68
        .r(r),
69
        .g(g),
70
        .b(b),
71
        .hsync_n(hsync_n),
72
        .vsync_n(vsync_n),
73 18 samiam9512
        .ps2_clk(ps2_clk),
74
        .ps2_data(ps2_data),
75 11 samiam9512
        .reset_n(reset_n),
76 28 samiam9512
        .clock(clock),
77
        .diag(diag));
78 11 samiam9512
 
79
    integer TX_FILE = 0;
80
    integer TX_ERROR = 0;
81
 
82
    initial begin  // Open the results file...
83
        TX_FILE = $fopen("results.txt");
84 28 samiam9512
        #200040 // Final time:  200040 ns
85 11 samiam9512
        if (TX_ERROR == 0) begin
86
            $display("No errors or warnings.");
87
            $fdisplay(TX_FILE, "No errors or warnings.");
88
        end else begin
89
            $display("%d errors found in simulation.", TX_ERROR);
90
            $fdisplay(TX_FILE, "%d errors found in simulation.", TX_ERROR);
91
        end
92
        $fclose(TX_FILE);
93
        $stop;
94
    end
95
 
96
    initial begin
97
        // -------------  Current Time:  110ns
98
        #110;
99 18 samiam9512
        ps2_clk = 1'b1;
100
        ps2_data = 1'b1;
101 28 samiam9512
        reset_n = 1'b0;
102 11 samiam9512
        data$inout$reg = 8'bZZZZZZZZ;
103
        // -------------------------------------
104 18 samiam9512
        // -------------  Current Time:  130ns
105
        #20;
106
        CHECK_intr(1'b0);
107 28 samiam9512
        CHECK_diag(8'bXXX11X00);
108 18 samiam9512
        // -------------------------------------
109 11 samiam9512
        // -------------  Current Time:  270ns
110 18 samiam9512
        #140;
111 11 samiam9512
        reset_n = 1'b1;
112
        // -------------------------------------
113 28 samiam9512
        // -------------  Current Time:  370ns
114
        #100;
115
        CHECK_b(3'bXXX);
116
        CHECK_g(3'bXXX);
117
        CHECK_r(3'bXXX);
118
        // -------------------------------------
119 18 samiam9512
        // -------------  Current Time:  390ns
120 28 samiam9512
        #20;
121 18 samiam9512
        ps2_data = 1'b0;
122
        // -------------------------------------
123 28 samiam9512
        // -------------  Current Time:  410ns
124
        #20;
125
        CHECK_diag(8'bXXX01X00);
126
        // -------------------------------------
127 18 samiam9512
        // -------------  Current Time:  510ns
128 28 samiam9512
        #100;
129 18 samiam9512
        ps2_clk = 1'b0;
130
        // -------------------------------------
131 28 samiam9512
        // -------------  Current Time:  530ns
132
        #20;
133
        CHECK_diag(8'bXXX00X00);
134
        // -------------------------------------
135 18 samiam9512
        // -------------  Current Time:  590ns
136 28 samiam9512
        #60;
137 18 samiam9512
        ps2_clk = 1'b0;
138
        // -------------------------------------
139 28 samiam9512
        // -------------  Current Time:  650ns
140
        #60;
141
        CHECK_diag(8'bXXX00X01);
142
        // -------------------------------------
143 18 samiam9512
        // -------------  Current Time:  670ns
144 28 samiam9512
        #20;
145 18 samiam9512
        ps2_clk = 1'b1;
146
        // -------------------------------------
147 28 samiam9512
        // -------------  Current Time:  690ns
148
        #20;
149
        CHECK_diag(8'bXXX01X01);
150
        // -------------------------------------
151 18 samiam9512
        // -------------  Current Time:  830ns
152 28 samiam9512
        #140;
153 18 samiam9512
        ps2_clk = 1'b0;
154
        // -------------------------------------
155 28 samiam9512
        // -------------  Current Time:  850ns
156
        #20;
157
        CHECK_diag(8'bXXX00X01);
158
        // -------------------------------------
159 18 samiam9512
        // -------------  Current Time:  990ns
160 28 samiam9512
        #140;
161 18 samiam9512
        ps2_clk = 1'b1;
162
        // -------------------------------------
163 28 samiam9512
        // -------------  Current Time:  1010ns
164
        #20;
165
        CHECK_diag(8'bXXX01X01);
166
        // -------------------------------------
167 18 samiam9512
        // -------------  Current Time:  1150ns
168 28 samiam9512
        #140;
169 18 samiam9512
        ps2_clk = 1'b0;
170
        // -------------------------------------
171 28 samiam9512
        // -------------  Current Time:  1170ns
172
        #20;
173
        CHECK_diag(8'bXXX00X01);
174
        // -------------------------------------
175 18 samiam9512
        // -------------  Current Time:  1310ns
176 28 samiam9512
        #140;
177 18 samiam9512
        ps2_clk = 1'b1;
178
        // -------------------------------------
179 28 samiam9512
        // -------------  Current Time:  1330ns
180
        #20;
181
        CHECK_diag(8'bXXX01X01);
182
        // -------------------------------------
183 18 samiam9512
        // -------------  Current Time:  1470ns
184 28 samiam9512
        #140;
185 18 samiam9512
        ps2_clk = 1'b0;
186
        // -------------------------------------
187 28 samiam9512
        // -------------  Current Time:  1490ns
188
        #20;
189
        CHECK_diag(8'bXXX00X01);
190
        // -------------------------------------
191 18 samiam9512
        // -------------  Current Time:  1630ns
192 28 samiam9512
        #140;
193 18 samiam9512
        ps2_clk = 1'b1;
194
        ps2_data = 1'b0;
195
        // -------------------------------------
196 28 samiam9512
        // -------------  Current Time:  1650ns
197
        #20;
198
        CHECK_diag(8'bXXX01X01);
199
        // -------------------------------------
200 18 samiam9512
        // -------------  Current Time:  1790ns
201 28 samiam9512
        #140;
202 18 samiam9512
        ps2_clk = 1'b0;
203
        // -------------------------------------
204 28 samiam9512
        // -------------  Current Time:  1810ns
205
        #20;
206
        CHECK_diag(8'bXXX00X01);
207
        // -------------------------------------
208 18 samiam9512
        // -------------  Current Time:  1950ns
209 28 samiam9512
        #140;
210 18 samiam9512
        ps2_clk = 1'b1;
211
        // -------------------------------------
212 28 samiam9512
        // -------------  Current Time:  1970ns
213
        #20;
214
        CHECK_diag(8'bXXX01X01);
215
        // -------------------------------------
216 18 samiam9512
        // -------------  Current Time:  1990ns
217 28 samiam9512
        #20;
218 18 samiam9512
        ps2_data = 1'b1;
219
        // -------------------------------------
220 28 samiam9512
        // -------------  Current Time:  2010ns
221
        #20;
222
        CHECK_diag(8'bXXX11X01);
223
        // -------------------------------------
224 18 samiam9512
        // -------------  Current Time:  2110ns
225 28 samiam9512
        #100;
226 18 samiam9512
        ps2_clk = 1'b0;
227
        // -------------------------------------
228 28 samiam9512
        // -------------  Current Time:  2130ns
229
        #20;
230
        CHECK_diag(8'bXXX10X01);
231
        // -------------------------------------
232 18 samiam9512
        // -------------  Current Time:  2270ns
233 28 samiam9512
        #140;
234 18 samiam9512
        ps2_clk = 1'b1;
235
        // -------------------------------------
236 28 samiam9512
        // -------------  Current Time:  2290ns
237
        #20;
238
        CHECK_diag(8'bXXX11X01);
239
        // -------------------------------------
240 18 samiam9512
        // -------------  Current Time:  2430ns
241 28 samiam9512
        #140;
242 18 samiam9512
        ps2_clk = 1'b0;
243
        // -------------------------------------
244 28 samiam9512
        // -------------  Current Time:  2450ns
245
        #20;
246
        CHECK_diag(8'bXXX10X01);
247
        // -------------------------------------
248 18 samiam9512
        // -------------  Current Time:  2590ns
249 28 samiam9512
        #140;
250 18 samiam9512
        ps2_clk = 1'b1;
251
        // -------------------------------------
252 28 samiam9512
        // -------------  Current Time:  2610ns
253
        #20;
254
        CHECK_diag(8'bXXX11X01);
255
        // -------------------------------------
256 18 samiam9512
        // -------------  Current Time:  2750ns
257 28 samiam9512
        #140;
258 18 samiam9512
        ps2_clk = 1'b0;
259
        // -------------------------------------
260 28 samiam9512
        // -------------  Current Time:  2770ns
261
        #20;
262
        CHECK_diag(8'bXXX10X01);
263
        // -------------------------------------
264 18 samiam9512
        // -------------  Current Time:  2910ns
265 28 samiam9512
        #140;
266 18 samiam9512
        ps2_clk = 1'b1;
267
        // -------------------------------------
268 28 samiam9512
        // -------------  Current Time:  2930ns
269
        #20;
270
        CHECK_diag(8'bXXX11X01);
271
        // -------------------------------------
272 18 samiam9512
        // -------------  Current Time:  3070ns
273 28 samiam9512
        #140;
274 18 samiam9512
        ps2_clk = 1'b0;
275
        // -------------------------------------
276 28 samiam9512
        // -------------  Current Time:  3090ns
277
        #20;
278
        CHECK_diag(8'bXXX10X01);
279
        // -------------------------------------
280 18 samiam9512
        // -------------  Current Time:  3230ns
281 28 samiam9512
        #140;
282 18 samiam9512
        ps2_clk = 1'b1;
283
        // -------------------------------------
284 28 samiam9512
        // -------------  Current Time:  3250ns
285
        #20;
286
        CHECK_diag(8'bXXX11X01);
287
        // -------------------------------------
288 18 samiam9512
        // -------------  Current Time:  3310ns
289 28 samiam9512
        #60;
290 18 samiam9512
        ps2_data = 1'b0;
291
        // -------------------------------------
292 28 samiam9512
        // -------------  Current Time:  3330ns
293
        #20;
294
        CHECK_diag(8'bXXX01X01);
295
        // -------------------------------------
296 18 samiam9512
        // -------------  Current Time:  3390ns
297 28 samiam9512
        #60;
298 18 samiam9512
        ps2_clk = 1'b0;
299
        // -------------------------------------
300 28 samiam9512
        // -------------  Current Time:  3410ns
301
        #20;
302
        CHECK_diag(8'bXXX00X01);
303
        // -------------------------------------
304 18 samiam9512
        // -------------  Current Time:  3550ns
305 28 samiam9512
        #140;
306 18 samiam9512
        ps2_clk = 1'b1;
307
        // -------------------------------------
308 28 samiam9512
        // -------------  Current Time:  3570ns
309
        #20;
310
        CHECK_diag(8'bXXX01X01);
311
        // -------------------------------------
312 18 samiam9512
        // -------------  Current Time:  3590ns
313 28 samiam9512
        #20;
314 18 samiam9512
        ps2_data = 1'b1;
315
        // -------------------------------------
316 28 samiam9512
        // -------------  Current Time:  3610ns
317
        #20;
318
        CHECK_diag(8'bXXX11X01);
319
        // -------------------------------------
320 18 samiam9512
        // -------------  Current Time:  3710ns
321 28 samiam9512
        #100;
322 18 samiam9512
        ps2_clk = 1'b0;
323
        // -------------------------------------
324 28 samiam9512
        // -------------  Current Time:  3730ns
325
        #20;
326
        CHECK_diag(8'bXXX10X01);
327
        // -------------------------------------
328 18 samiam9512
        // -------------  Current Time:  3870ns
329 28 samiam9512
        #140;
330 18 samiam9512
        ps2_clk = 1'b1;
331
        // -------------------------------------
332 28 samiam9512
        // -------------  Current Time:  3890ns
333
        #20;
334
        CHECK_diag(8'bXXX11X01);
335
        // -------------------------------------
336 18 samiam9512
        // -------------  Current Time:  5910ns
337 28 samiam9512
        #2020;
338 18 samiam9512
        ps2_data = 1'b0;
339
        // -------------------------------------
340 28 samiam9512
        // -------------  Current Time:  5930ns
341
        #20;
342
        CHECK_diag(8'bXXX01X01);
343
        // -------------------------------------
344 18 samiam9512
        // -------------  Current Time:  6070ns
345 28 samiam9512
        #140;
346 18 samiam9512
        ps2_clk = 1'b0;
347
        // -------------------------------------
348 28 samiam9512
        // -------------  Current Time:  6090ns
349
        #20;
350
        CHECK_diag(8'bXXX00X01);
351
        // -------------------------------------
352 18 samiam9512
        // -------------  Current Time:  6230ns
353 28 samiam9512
        #140;
354 18 samiam9512
        ps2_clk = 1'b1;
355
        // -------------------------------------
356 28 samiam9512
        // -------------  Current Time:  6250ns
357
        #20;
358
        CHECK_diag(8'bXXX01X01);
359
        // -------------------------------------
360 18 samiam9512
        // -------------  Current Time:  6390ns
361 28 samiam9512
        #140;
362 18 samiam9512
        ps2_clk = 1'b0;
363
        // -------------------------------------
364 28 samiam9512
        // -------------  Current Time:  6410ns
365
        #20;
366
        CHECK_diag(8'bXXX00X01);
367
        // -------------------------------------
368 18 samiam9512
        // -------------  Current Time:  6550ns
369 28 samiam9512
        #140;
370 18 samiam9512
        ps2_clk = 1'b1;
371
        // -------------------------------------
372 28 samiam9512
        // -------------  Current Time:  6570ns
373
        #20;
374
        CHECK_diag(8'bXXX01X01);
375
        // -------------------------------------
376 18 samiam9512
        // -------------  Current Time:  6630ns
377 28 samiam9512
        #60;
378 18 samiam9512
        ps2_data = 1'b1;
379
        // -------------------------------------
380 28 samiam9512
        // -------------  Current Time:  6650ns
381
        #20;
382
        CHECK_diag(8'bXXX11X01);
383
        // -------------------------------------
384 18 samiam9512
        // -------------  Current Time:  6710ns
385 28 samiam9512
        #60;
386 18 samiam9512
        ps2_clk = 1'b0;
387
        // -------------------------------------
388 28 samiam9512
        // -------------  Current Time:  6730ns
389
        #20;
390
        CHECK_diag(8'bXXX10X01);
391
        // -------------------------------------
392 18 samiam9512
        // -------------  Current Time:  6870ns
393 28 samiam9512
        #140;
394 18 samiam9512
        ps2_clk = 1'b1;
395
        // -------------------------------------
396 28 samiam9512
        // -------------  Current Time:  6890ns
397
        #20;
398
        CHECK_diag(8'bXXX11X01);
399
        // -------------------------------------
400 18 samiam9512
        // -------------  Current Time:  6910ns
401 28 samiam9512
        #20;
402 18 samiam9512
        ps2_data = 1'b0;
403
        // -------------------------------------
404 28 samiam9512
        // -------------  Current Time:  6930ns
405
        #20;
406
        CHECK_diag(8'bXXX01X01);
407
        // -------------------------------------
408 18 samiam9512
        // -------------  Current Time:  7030ns
409 28 samiam9512
        #100;
410 18 samiam9512
        ps2_clk = 1'b0;
411
        // -------------------------------------
412 28 samiam9512
        // -------------  Current Time:  7050ns
413
        #20;
414
        CHECK_diag(8'bXXX00X01);
415
        // -------------------------------------
416 18 samiam9512
        // -------------  Current Time:  7190ns
417 28 samiam9512
        #140;
418 18 samiam9512
        ps2_clk = 1'b1;
419
        // -------------------------------------
420 28 samiam9512
        // -------------  Current Time:  7210ns
421
        #20;
422
        CHECK_diag(8'bXXX01X01);
423
        // -------------------------------------
424 18 samiam9512
        // -------------  Current Time:  7350ns
425 28 samiam9512
        #140;
426 18 samiam9512
        ps2_clk = 1'b0;
427
        // -------------------------------------
428 28 samiam9512
        // -------------  Current Time:  7370ns
429
        #20;
430
        CHECK_diag(8'bXXX00X01);
431
        // -------------------------------------
432 18 samiam9512
        // -------------  Current Time:  7510ns
433 28 samiam9512
        #140;
434 18 samiam9512
        ps2_clk = 1'b1;
435
        // -------------------------------------
436 28 samiam9512
        // -------------  Current Time:  7530ns
437
        #20;
438
        CHECK_diag(8'bXXX01X01);
439
        // -------------------------------------
440 18 samiam9512
        // -------------  Current Time:  7550ns
441 28 samiam9512
        #20;
442 18 samiam9512
        ps2_data = 1'b1;
443
        // -------------------------------------
444 28 samiam9512
        // -------------  Current Time:  7570ns
445
        #20;
446
        CHECK_diag(8'bXXX11X01);
447
        // -------------------------------------
448 18 samiam9512
        // -------------  Current Time:  7670ns
449 28 samiam9512
        #100;
450 18 samiam9512
        ps2_clk = 1'b0;
451
        // -------------------------------------
452 28 samiam9512
        // -------------  Current Time:  7690ns
453
        #20;
454
        CHECK_diag(8'bXXX10X01);
455
        // -------------------------------------
456 18 samiam9512
        // -------------  Current Time:  7830ns
457 28 samiam9512
        #140;
458 18 samiam9512
        ps2_clk = 1'b1;
459
        // -------------------------------------
460 28 samiam9512
        // -------------  Current Time:  7850ns
461
        #20;
462
        CHECK_diag(8'bXXX11X01);
463
        // -------------------------------------
464 18 samiam9512
        // -------------  Current Time:  7910ns
465 28 samiam9512
        #60;
466 18 samiam9512
        ps2_data = 1'b0;
467
        // -------------------------------------
468 28 samiam9512
        // -------------  Current Time:  7930ns
469
        #20;
470
        CHECK_diag(8'bXXX01X01);
471
        // -------------------------------------
472 18 samiam9512
        // -------------  Current Time:  7990ns
473 28 samiam9512
        #60;
474 18 samiam9512
        ps2_clk = 1'b0;
475
        // -------------------------------------
476 28 samiam9512
        // -------------  Current Time:  8010ns
477
        #20;
478
        CHECK_diag(8'bXXX00X01);
479
        // -------------------------------------
480 18 samiam9512
        // -------------  Current Time:  8150ns
481 28 samiam9512
        #140;
482 18 samiam9512
        ps2_clk = 1'b1;
483
        // -------------------------------------
484 28 samiam9512
        // -------------  Current Time:  8170ns
485
        #20;
486
        CHECK_diag(8'bXXX01X01);
487
        // -------------------------------------
488 18 samiam9512
        // -------------  Current Time:  8310ns
489 28 samiam9512
        #140;
490 18 samiam9512
        ps2_clk = 1'b0;
491
        // -------------------------------------
492 28 samiam9512
        // -------------  Current Time:  8330ns
493
        #20;
494
        CHECK_diag(8'bXXX00X01);
495
        // -------------------------------------
496 18 samiam9512
        // -------------  Current Time:  8470ns
497 28 samiam9512
        #140;
498 18 samiam9512
        ps2_clk = 1'b1;
499
        // -------------------------------------
500 28 samiam9512
        // -------------  Current Time:  8490ns
501
        #20;
502
        CHECK_diag(8'bXXX01X01);
503
        // -------------------------------------
504 18 samiam9512
        // -------------  Current Time:  8630ns
505 28 samiam9512
        #140;
506 18 samiam9512
        ps2_clk = 1'b0;
507
        // -------------------------------------
508 28 samiam9512
        // -------------  Current Time:  8650ns
509
        #20;
510
        CHECK_diag(8'bXXX00X01);
511
        // -------------------------------------
512 18 samiam9512
        // -------------  Current Time:  8790ns
513 28 samiam9512
        #140;
514 18 samiam9512
        ps2_clk = 1'b1;
515
        // -------------------------------------
516 28 samiam9512
        // -------------  Current Time:  8810ns
517
        #20;
518
        CHECK_diag(8'bXXX01X01);
519
        // -------------------------------------
520 18 samiam9512
        // -------------  Current Time:  8950ns
521 28 samiam9512
        #140;
522 18 samiam9512
        ps2_clk = 1'b0;
523
        // -------------------------------------
524 28 samiam9512
        // -------------  Current Time:  8970ns
525
        #20;
526
        CHECK_diag(8'bXXX00X01);
527
        // -------------------------------------
528 18 samiam9512
        // -------------  Current Time:  9110ns
529 28 samiam9512
        #140;
530 18 samiam9512
        ps2_clk = 1'b1;
531
        // -------------------------------------
532 28 samiam9512
        // -------------  Current Time:  9130ns
533
        #20;
534
        CHECK_diag(8'bXXX01X01);
535
        // -------------------------------------
536 18 samiam9512
        // -------------  Current Time:  9190ns
537 28 samiam9512
        #60;
538 18 samiam9512
        ps2_data = 1'b1;
539
        // -------------------------------------
540 28 samiam9512
        // -------------  Current Time:  9210ns
541
        #20;
542
        CHECK_diag(8'bXXX11X01);
543
        // -------------------------------------
544 18 samiam9512
        // -------------  Current Time:  9270ns
545 28 samiam9512
        #60;
546 18 samiam9512
        ps2_clk = 1'b0;
547
        // -------------------------------------
548 28 samiam9512
        // -------------  Current Time:  9290ns
549
        #20;
550
        CHECK_diag(8'bXXX10X01);
551
        // -------------------------------------
552 18 samiam9512
        // -------------  Current Time:  9430ns
553 28 samiam9512
        #140;
554 18 samiam9512
        ps2_clk = 1'b1;
555
        // -------------------------------------
556 28 samiam9512
        // -------------  Current Time:  9450ns
557
        #20;
558
        CHECK_diag(8'bXXX11X01);
559
        // -------------------------------------
560
        // -------------  Current Time:  31090ns
561
        #21640;
562
        CHECK_b(3'b000);
563
        CHECK_g(3'b000);
564
        CHECK_r(3'b000);
565
        // -------------------------------------
566
        // -------------  Current Time:  31890ns
567
        #800;
568
        CHECK_hsync_n(1'b0);
569
        // -------------------------------------
570
        // -------------  Current Time:  39890ns
571
        #8000;
572
        CHECK_hsync_n(1'b1);
573
        // -------------------------------------
574
        // -------------  Current Time:  43890ns
575
        #4000;
576
        CHECK_b(3'bXXX);
577
        CHECK_g(3'bXXX);
578
        CHECK_r(3'bXXX);
579
        // -------------------------------------
580
        // -------------  Current Time:  95090ns
581
        #51200;
582
        CHECK_b(3'b000);
583
        CHECK_g(3'b000);
584
        CHECK_r(3'b000);
585
        // -------------------------------------
586
        // -------------  Current Time:  95890ns
587
        #800;
588
        CHECK_hsync_n(1'b0);
589
        // -------------------------------------
590
        // -------------  Current Time:  103890ns
591
        #8000;
592
        CHECK_hsync_n(1'b1);
593
        // -------------------------------------
594
        // -------------  Current Time:  107890ns
595
        #4000;
596
        CHECK_b(3'bXXX);
597
        CHECK_g(3'bXXX);
598
        CHECK_r(3'bXXX);
599
        // -------------------------------------
600
        // -------------  Current Time:  159090ns
601
        #51200;
602
        CHECK_b(3'b000);
603
        CHECK_g(3'b000);
604
        CHECK_r(3'b000);
605
        // -------------------------------------
606
        // -------------  Current Time:  159890ns
607
        #800;
608
        CHECK_hsync_n(1'b0);
609
        // -------------------------------------
610
        // -------------  Current Time:  167890ns
611
        #8000;
612
        CHECK_hsync_n(1'b1);
613
        // -------------------------------------
614
        // -------------  Current Time:  171890ns
615
        #4000;
616
        CHECK_b(3'bXXX);
617
        CHECK_g(3'bXXX);
618
        CHECK_r(3'bXXX);
619
        // -------------------------------------
620 11 samiam9512
    end
621
 
622
    task CHECK_addr;
623
        input [15:0] NEXT_addr;
624
 
625
        #0 begin
626
            if (NEXT_addr !== addr) begin
627
                $display("Error at time=%dns addr=%b, expected=%b", $time, addr, NEXT_addr);
628
                $fdisplay(TX_FILE, "Error at time=%dns addr=%b, expected=%b", $time, addr, NEXT_addr);
629
                $fflush(TX_FILE);
630
                TX_ERROR = TX_ERROR + 1;
631
            end
632
        end
633
    endtask
634
    task CHECK_readmem;
635
        input NEXT_readmem;
636
 
637
        #0 begin
638
            if (NEXT_readmem !== readmem) begin
639
                $display("Error at time=%dns readmem=%b, expected=%b", $time, readmem, NEXT_readmem);
640
                $fdisplay(TX_FILE, "Error at time=%dns readmem=%b, expected=%b", $time, readmem, NEXT_readmem);
641
                $fflush(TX_FILE);
642
                TX_ERROR = TX_ERROR + 1;
643
            end
644
        end
645
    endtask
646
    task CHECK_writemem;
647
        input NEXT_writemem;
648
 
649
        #0 begin
650
            if (NEXT_writemem !== writemem) begin
651
                $display("Error at time=%dns writemem=%b, expected=%b", $time, writemem, NEXT_writemem);
652
                $fdisplay(TX_FILE, "Error at time=%dns writemem=%b, expected=%b", $time, writemem, NEXT_writemem);
653
                $fflush(TX_FILE);
654
                TX_ERROR = TX_ERROR + 1;
655
            end
656
        end
657
    endtask
658
    task CHECK_readio;
659
        input NEXT_readio;
660
 
661
        #0 begin
662
            if (NEXT_readio !== readio) begin
663
                $display("Error at time=%dns readio=%b, expected=%b", $time, readio, NEXT_readio);
664
                $fdisplay(TX_FILE, "Error at time=%dns readio=%b, expected=%b", $time, readio, NEXT_readio);
665
                $fflush(TX_FILE);
666
                TX_ERROR = TX_ERROR + 1;
667
            end
668
        end
669
    endtask
670
    task CHECK_writeio;
671
        input NEXT_writeio;
672
 
673
        #0 begin
674
            if (NEXT_writeio !== writeio) begin
675
                $display("Error at time=%dns writeio=%b, expected=%b", $time, writeio, NEXT_writeio);
676
                $fdisplay(TX_FILE, "Error at time=%dns writeio=%b, expected=%b", $time, writeio, NEXT_writeio);
677
                $fflush(TX_FILE);
678
                TX_ERROR = TX_ERROR + 1;
679
            end
680
        end
681
    endtask
682
    task CHECK_intr;
683
        input NEXT_intr;
684
 
685
        #0 begin
686
            if (NEXT_intr !== intr) begin
687
                $display("Error at time=%dns intr=%b, expected=%b", $time, intr, NEXT_intr);
688
                $fdisplay(TX_FILE, "Error at time=%dns intr=%b, expected=%b", $time, intr, NEXT_intr);
689
                $fflush(TX_FILE);
690
                TX_ERROR = TX_ERROR + 1;
691
            end
692
        end
693
    endtask
694
    task CHECK_inta;
695
        input NEXT_inta;
696
 
697
        #0 begin
698
            if (NEXT_inta !== inta) begin
699
                $display("Error at time=%dns inta=%b, expected=%b", $time, inta, NEXT_inta);
700
                $fdisplay(TX_FILE, "Error at time=%dns inta=%b, expected=%b", $time, inta, NEXT_inta);
701
                $fflush(TX_FILE);
702
                TX_ERROR = TX_ERROR + 1;
703
            end
704
        end
705
    endtask
706 18 samiam9512
    task CHECK_waitr;
707
        input NEXT_waitr;
708
 
709
        #0 begin
710
            if (NEXT_waitr !== waitr) begin
711
                $display("Error at time=%dns waitr=%b, expected=%b", $time, waitr, NEXT_waitr);
712
                $fdisplay(TX_FILE, "Error at time=%dns waitr=%b, expected=%b", $time, waitr, NEXT_waitr);
713
                $fflush(TX_FILE);
714
                TX_ERROR = TX_ERROR + 1;
715
            end
716
        end
717
    endtask
718 11 samiam9512
    task CHECK_r;
719
        input [2:0] NEXT_r;
720
 
721
        #0 begin
722
            if (NEXT_r !== r) begin
723
                $display("Error at time=%dns r=%b, expected=%b", $time, r, NEXT_r);
724
                $fdisplay(TX_FILE, "Error at time=%dns r=%b, expected=%b", $time, r, NEXT_r);
725
                $fflush(TX_FILE);
726
                TX_ERROR = TX_ERROR + 1;
727
            end
728
        end
729
    endtask
730
    task CHECK_g;
731
        input [2:0] NEXT_g;
732
 
733
        #0 begin
734
            if (NEXT_g !== g) begin
735
                $display("Error at time=%dns g=%b, expected=%b", $time, g, NEXT_g);
736
                $fdisplay(TX_FILE, "Error at time=%dns g=%b, expected=%b", $time, g, NEXT_g);
737
                $fflush(TX_FILE);
738
                TX_ERROR = TX_ERROR + 1;
739
            end
740
        end
741
    endtask
742
    task CHECK_b;
743
        input [2:0] NEXT_b;
744
 
745
        #0 begin
746
            if (NEXT_b !== b) begin
747
                $display("Error at time=%dns b=%b, expected=%b", $time, b, NEXT_b);
748
                $fdisplay(TX_FILE, "Error at time=%dns b=%b, expected=%b", $time, b, NEXT_b);
749
                $fflush(TX_FILE);
750
                TX_ERROR = TX_ERROR + 1;
751
            end
752
        end
753
    endtask
754
    task CHECK_hsync_n;
755
        input NEXT_hsync_n;
756
 
757
        #0 begin
758
            if (NEXT_hsync_n !== hsync_n) begin
759
                $display("Error at time=%dns hsync_n=%b, expected=%b", $time, hsync_n, NEXT_hsync_n);
760
                $fdisplay(TX_FILE, "Error at time=%dns hsync_n=%b, expected=%b", $time, hsync_n, NEXT_hsync_n);
761
                $fflush(TX_FILE);
762
                TX_ERROR = TX_ERROR + 1;
763
            end
764
        end
765
    endtask
766
    task CHECK_vsync_n;
767
        input NEXT_vsync_n;
768
 
769
        #0 begin
770
            if (NEXT_vsync_n !== vsync_n) begin
771
                $display("Error at time=%dns vsync_n=%b, expected=%b", $time, vsync_n, NEXT_vsync_n);
772
                $fdisplay(TX_FILE, "Error at time=%dns vsync_n=%b, expected=%b", $time, vsync_n, NEXT_vsync_n);
773
                $fflush(TX_FILE);
774
                TX_ERROR = TX_ERROR + 1;
775
            end
776
        end
777
    endtask
778 28 samiam9512
    task CHECK_diag;
779
        input [7:0] NEXT_diag;
780 11 samiam9512
 
781 28 samiam9512
        #0 begin
782
            if (NEXT_diag !== diag) begin
783
                $display("Error at time=%dns diag=%b, expected=%b", $time, diag, NEXT_diag);
784
                $fdisplay(TX_FILE, "Error at time=%dns diag=%b, expected=%b", $time, diag, NEXT_diag);
785
                $fflush(TX_FILE);
786
                TX_ERROR = TX_ERROR + 1;
787
            end
788
        end
789
    endtask
790
 
791 11 samiam9512
endmodule
792
 

powered by: WebSVN 2.1.0

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