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

Subversion Repositories oms8051mini

[/] [oms8051mini/] [trunk/] [verif/] [lib/] [tb_glbl.v] - Blame information for rev 17

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

Line No. Rev Author Line
1 2 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
  begin
25
   $display ("\n=========");
26
   $display ("Test Status: TEST PASSED");
27
   $display ("=========\n");
28
  end
29
  endtask
30
 
31
  task test_fail;
32
  begin
33
   $display ("\n=========");
34
   $display ("Test Status: TEST FAILED");
35
   $display ("=========\n");
36
 end
37
  endtask
38
 
39
 
40
  task test_err;
41
        begin
42
        err_count = err_count + 1;
43
        $display ("A200 TB => %t ns ERROR :: %m ERROR detected %d ",$time, err_count );
44
        end
45
  endtask
46
 
47
  task test_warn;
48
        begin
49
    warn_count = warn_count + 1;
50
    $display ("A200 TB => %t ns WARNING :: %m Warning %d ",$time, warn_count );
51
        end
52
  endtask
53
 
54
  task test_stats;
55
  begin
56
     $display ("\n-------------------------------------------------");
57
     $display ("Test Status");
58
     $display ("warnings: %0d, errors: %0d",warn_count,err_count);
59
  end
60
  endtask
61
 
62
  task test_finish;
63
   begin
64
     test_stats;
65
     if (err_count > 0) begin
66
       test_fail;
67
     end else begin
68
       test_pass;
69
     end
70
     #1 $finish;
71
   end
72
  endtask
73
 
74
endmodule

powered by: WebSVN 2.1.0

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