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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [axi4_stream_lib/] [sim/] [src/] [legacy/] [tb_axis_upsizer_agent_class_pkg.sv] - Blame information for rev 49

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 49 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
 
29
package tb_axis_upsizer_agent_class_pkg;
30
 
31
  // --------------------------------------------------------------------
32
  //
33
  import video_frame_pkg::*;
34
  import axis_video_frame_bfm_pkg::*;
35
 
36
 
37
  // --------------------------------------------------------------------
38
  //
39
  class tb_axis_upsizer_agent_class #(BYTES_PER_PIXEL, OUTPUTS_PER_TILE, AVF_N, AVF_U, S);
40
 
41
    virtual axis_if #(.N(AVF_N * S), .U(AVF_U)) avf_axis_in_if;
42
    virtual axis_if #(.N(AVF_N), .U(AVF_U)) avf_axis_out_if;
43
 
44
    avf_config_class c_h;
45
 
46
    avf_tx_class #(BYTES_PER_PIXEL, OUTPUTS_PER_TILE, AVF_U) tx_h;
47
    avf_rx_class #(BYTES_PER_PIXEL, OUTPUTS_PER_TILE * S, AVF_U) rx_h;
48
 
49
    video_frame_class clone_h;
50
    video_frame_class sent_f_h;
51
    video_frame_class rx_f_h;
52
 
53
    mailbox #(video_frame_class) q;
54
 
55
 
56
    // --------------------------------------------------------------------
57
    //
58
    virtual task
59
      queue_frame
60
      (
61
        string pattern = "",
62
        int pixel = 0
63
      );
64
 
65
        if(pattern != "")
66
          tx_h.make_frame(pattern, pixel);
67
 
68
        clone_h = tx_h.tx_bfm_h[0].f_h.clone();
69
        tx_h.tx_bfm_h[0].put(clone_h);
70
        q.put(clone_h);
71
 
72
        $display("^^^ %16.t | %m | using %s pattern", $time, pattern);
73
 
74
    endtask: queue_frame
75
 
76
 
77
    // --------------------------------------------------------------------
78
    //
79
    virtual task automatic
80
      compare_frame;
81
 
82
      int mismatch_count;
83
 
84
      $display("^^^ %16.t | %m", $time);
85
 
86
      q.get(sent_f_h);
87
      rx_h.rx_bfm_h[0].get(rx_f_h);
88
      mismatch_count = sent_f_h.compare(8, rx_f_h);
89
 
90
    endtask: compare_frame
91
 
92
 
93
    //--------------------------------------------------------------------
94
    //
95
    function void init(avf_config_class in_c_h, avf_config_class out_c_h);
96
 
97
      rx_h = new(in_c_h, '{avf_axis_in_if});
98
      tx_h = new(out_c_h, '{avf_axis_out_if});
99
 
100
      this.q = new();
101
 
102
    endfunction: init
103
 
104
 
105
    //--------------------------------------------------------------------
106
    //
107
    function new
108
      (
109
        virtual axis_if #(.N(AVF_N * S), .U(AVF_U)) avf_axis_in_if,
110
        virtual axis_if #(.N(AVF_N), .U(AVF_U)) avf_axis_out_if
111
      );
112
 
113
      this.avf_axis_in_if = avf_axis_in_if;
114
      this.avf_axis_out_if = avf_axis_out_if;
115
    endfunction: new
116
 
117
 
118
  // --------------------------------------------------------------------
119
  //
120
  endclass: tb_axis_upsizer_agent_class
121
 
122
// --------------------------------------------------------------------
123
//
124
endpackage: tb_axis_upsizer_agent_class_pkg
125
 
126
 
127
 
128
 
129
 

powered by: WebSVN 2.1.0

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