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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [BFM/] [sim/] [tests/] [tb_video_frame/] [the_test.sv] - Blame information for rev 48

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

Line No. Rev Author Line
1 34 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2015 Authors and OPENCORES.ORG                 ////
4
////                                                              ////
5
//// This source file may be used and distributed without         ////
6
//// restriction provided that this copyright statement is not    ////
7
//// removed from the file and that any derivative work contains  ////
8
//// the original copyright notice and the associated disclaimer. ////
9
////                                                              ////
10
//// This source file is free software; you can redistribute it   ////
11
//// and/or modify it under the terms of the GNU Lesser General   ////
12
//// Public License as published by the Free Software Foundation; ////
13
//// either version 2.1 of the License, or (at your option) any   ////
14
//// later version.                                               ////
15
////                                                              ////
16
//// This source is distributed in the hope that it will be       ////
17
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
18
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
19
//// PURPOSE.  See the GNU Lesser General Public License for more ////
20
//// details.                                                     ////
21
////                                                              ////
22
//// You should have received a copy of the GNU Lesser General    ////
23
//// Public License along with this source; if not, download it   ////
24
//// from http://www.opencores.org/lgpl.shtml                     ////
25
////                                                              ////
26
//////////////////////////////////////////////////////////////////////
27
 
28
`include "../../../src/video_frame_class.sv"
29
 
30
 
31
module the_test(
32
                input tb_clk,
33
                input tb_rst
34
              );
35
 
36
  // --------------------------------------------------------------------
37
  //
38
  video_frame_class f_h;
39
  video_frame_class fc_h;
40
  int return_code;
41
 
42
  initial
43
  begin
44
 
45
    f_h = new;
46
 
47
    f_h.init
48
    (
49
      .pixels_per_line('h100),
50
      .lines_per_frame('h080),
51
      .bits_per_pixel(14)
52
    );
53
 
54
    f_h.make_random();
55
 
56
    fc_h = new;
57
    f_h.copy(fc_h);
58
 
59
    return_code = f_h.compare( 16, fc_h );
60
 
61
    if( return_code == 0 )
62
      $display("^^^ %16.t | f_h == fc_h", $time );
63
    else
64
      $display("^^^ %16.t | f_h != fc_h | mismatches = %0d", $time, return_code );
65
 
66
    $display("^^^ %16.t | inserting error @ fc_h[11][22]", $time );
67
    fc_h.lines['h11].pixel['h22] = ~(fc_h.lines['h11].pixel['h22]);
68
 
69
    $display("^^^ %16.t | inserting error @ fc_h[33][44]", $time );
70
    fc_h.lines['h33].pixel['h44] = ~(fc_h.lines['h33].pixel['h44]);
71
 
72
    return_code = f_h.compare( 16, fc_h );
73
 
74
    if( return_code == 0 )
75
      $display("^^^ %16.t | f_h == fc_h", $time );
76
    else
77
      $display("^^^ %16.t | f_h != fc_h | mismatches = %0d", $time, return_code );
78
 
79
  end
80
 
81
 
82
  // --------------------------------------------------------------------
83
  //
84
  task run_the_test;
85
    begin
86
 
87
// --------------------------------------------------------------------
88
// insert test below
89
// --------------------------------------------------------------------
90
 
91
  $display("^^^---------------------------------");
92
  $display("^^^ %16.t | Testbench begun.\n", $time);
93
  $display("^^^---------------------------------");
94
 
95
 
96
  repeat(1000) @(posedge tb_clk);
97
 
98
 
99
// --------------------------------------------------------------------
100
// insert test above
101
// --------------------------------------------------------------------
102
 
103
   end
104
  endtask
105
 
106
 
107
endmodule
108
 

powered by: WebSVN 2.1.0

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