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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [axi4_stream_lib/] [sim/] [tests/] [legacy/] [tb_recursive_axis_catenate/] [tb_recursive_axis_catenate_pkg.sv] - Blame information for rev 50

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 50 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2017 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_recursive_axis_catenate_pkg;
30
 
31
  // --------------------------------------------------------------------
32
  //
33
  import video_frame_pkg::*;
34
  import axis_video_frame_bfm_pkg::*;
35
  import avf_agent_class_pkg::*;
36
 
37
 
38
  // --------------------------------------------------------------------
39
  //
40
  localparam AW = 32; // active width
41
  localparam AH = 16; // active height
42
  localparam B = 2; // bytes per pixel
43
  localparam T = 1; // pixels per clock
44
  localparam VERTICAL_BLANKING = AW * 4;
45
  localparam N =  B * T; // data bus width in bytes
46
  localparam I = 1; // TID width
47
  localparam D = 1; // TDEST width
48
  localparam U = 3; // TUSER width
49
  // localparam U_IS_EOP = 2;
50
  localparam U_IS_EOP = -1;
51
  localparam MA = 2;
52
  localparam MD = 2 ** MA;
53
 
54
 
55
  // --------------------------------------------------------------------
56
  //
57
  class tb_recursive_axis_catenate_class;
58
 
59
    avf_config_class c_h;
60
    avf_tile_config_t   tile_config[];
61
 
62
    virtual axis_if #(.N(N), .I(I), .D(D), .U(U)) axis_out;
63
    virtual axis_if #(.N(N), .I(I), .D(D), .U(U)) axis_in[];
64
 
65
    avf_tx_class #(B, T, U) tx_h;
66
    avf_rx_class #(B, T, U) rx_h;
67
 
68
    // video_frame_class clone_h;
69
    // video_frame_class sent_f_h;
70
    // video_frame_class rx_f_h;
71
 
72
    // mailbox #(video_frame_class) q[];
73
 
74
 
75
    // --------------------------------------------------------------------
76
    //
77
    task automatic
78
      queue_frame
79
      (
80
        string pattern = "",
81
        int pixel = 0
82
      );
83
        video_frame_class clone_h;
84
 
85
        if(pattern != "")
86
          tx_h.make_frame(pattern, pixel);
87
 
88
        foreach(tx_h.tx_bfm_h[i])
89
        begin
90
          clone_h = tx_h.tx_bfm_h[i].f_h.clone();
91
          tx_h.tx_bfm_h[i].put(clone_h);
92
          // q[i].put(clone_h);
93
        end
94
 
95
        $display("^^^ %16.t | %m | using %s pattern", $time, pattern);
96
 
97
    endtask: queue_frame
98
 
99
 
100
    //--------------------------------------------------------------------
101
    //
102
    function new
103
      (
104
        virtual axis_if #(.N(N), .U(U)) axis_in[],
105
        virtual axis_if #(.N(N), .U(U)) axis_out
106
      );
107
 
108
      this.axis_out = axis_out;
109
      this.axis_in = axis_in;
110
 
111
      this.tile_config              = new[T];
112
      this.tile_config[0].direction = RIGHT_DOWN;
113
 
114
      this.c_h = new
115
      (
116
        .width(AW),
117
        .height(AH),
118
        .bytes_per_pixel(B),
119
        .bits_per_pixel(B * 8),
120
        .pixels_per_clk(T),
121
        .name("AVR_"),
122
        .vertical_blanking(VERTICAL_BLANKING),
123
        .tile(tile_config)
124
      );
125
 
126
      rx_h = new(c_h, '{axis_out});
127
      tx_h = new(c_h, axis_in);
128
 
129
    endfunction: new
130
 
131
 
132
  // --------------------------------------------------------------------
133
  //
134
  endclass: tb_recursive_axis_catenate_class
135
 
136
 
137
// --------------------------------------------------------------------
138
//
139
endpackage: tb_recursive_axis_catenate_pkg
140
 
141
 
142
 
143
 
144
 

powered by: WebSVN 2.1.0

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