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

Subversion Repositories turbo8051

[/] [turbo8051/] [trunk/] [verif/] [lib/] [tb_glbl.v] - Blame information for rev 40

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

Line No. Rev Author Line
1 15 dinesha
// ********************************************************************************
2
//
3
// Module:       tb_gldbl
4
//
5
// Functional Description:
6
//
7
// This module has tasks for global statistics,test-pass/fail messages
8
//
9
// ********************************************************************************
10
 
11
module tb_glbl;
12
  reg [31:0] err_count;
13
  reg [31:0] warn_count;
14
 
15
 
16
  task init;
17
    begin
18
    err_count = 32'h0;
19
    warn_count = 32'h0;
20
    end
21
  endtask
22
 
23
  task test_pass;
24
   $display ("\n=========");
25
   $display ("Test Status: TEST PASSED");
26
   $display ("=========\n");
27
  endtask
28
 
29
  task test_fail;
30
   $display ("\n=========");
31
   $display ("Test Status: TEST FAILED");
32
   $display ("=========\n");
33
  endtask
34
 
35
 
36
  task test_err;
37
        begin
38
        err_count = err_count + 1;
39
        $display ("A200 TB => %t ns ERROR :: %m ERROR detected %d ",$time, err_count );
40
        end
41
  endtask
42
 
43
  task test_warn;
44
        begin
45
    warn_count = warn_count + 1;
46
    $display ("A200 TB => %t ns WARNING :: %m Warning %d ",$time, warn_count );
47
        end
48
  endtask
49
 
50
  task test_stats;
51
   $display ("\n-------------------------------------------------");
52
   $display ("Test Status");
53
   $display ("warnings: %0d, errors: %0d",warn_count,err_count);
54
  endtask
55
 
56
  task test_finish;
57
   begin
58
     test_stats;
59
     if (err_count > 0) begin
60
       test_fail;
61
     end else begin
62
       test_pass;
63
     end
64
     #1 $finish;
65
   end
66
  endtask
67
 
68
endmodule

powered by: WebSVN 2.1.0

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