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_switch/] [tb_recursive_axis_switch_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_switch_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 SA = 2;
50
  localparam SD = 2 ** SA;
51
 
52
 
53
  // --------------------------------------------------------------------
54
  //
55
  class tb_recursive_axis_switch_class;
56
 
57
    avf_config_class c_h;
58
    avf_tile_config_t   tile_config[];
59
 
60
    virtual axis_if #(.N(N), .I(I), .D(D), .U(U)) axis_out[];
61
    virtual axis_if #(.N(N), .I(I), .D(D), .U(U)) axis_in;
62
 
63
    avf_tx_class #(B, T, U) tx_h;
64
    avf_rx_class #(B, T, U) rx_h;
65
 
66
    // video_frame_class clone_h;
67
    // video_frame_class sent_f_h;
68
    // video_frame_class rx_f_h;
69
 
70
    // mailbox #(video_frame_class) q[];
71
 
72
 
73
    // --------------------------------------------------------------------
74
    //
75
    task automatic
76
      queue_frame
77
      (
78
        string pattern = "",
79
        int pixel = 0
80
      );
81
        video_frame_class clone_h;
82
 
83
        if(pattern != "")
84
          tx_h.make_frame(pattern, pixel);
85
 
86
        foreach(tx_h.tx_bfm_h[i])
87
        begin
88
          clone_h = tx_h.tx_bfm_h[i].f_h.clone();
89
          tx_h.tx_bfm_h[i].put(clone_h);
90
          // q[i].put(clone_h);
91
        end
92
 
93
        $display("^^^ %16.t | %m | using %s pattern", $time, pattern);
94
 
95
    endtask: queue_frame
96
 
97
 
98
    //--------------------------------------------------------------------
99
    //
100
    function new
101
      (
102
        virtual axis_if #(.N(N), .U(U)) axis_in,
103
        virtual axis_if #(.N(N), .U(U)) axis_out[]
104
      );
105
 
106
      this.axis_out = axis_out;
107
      this.axis_in = axis_in;
108
 
109
      this.tile_config              = new[T];
110
      this.tile_config[0].direction = RIGHT_DOWN;
111
 
112
      this.c_h = new
113
      (
114
        .width(AW),
115
        .height(AH),
116
        .bytes_per_pixel(B),
117
        .bits_per_pixel(B * 8),
118
        .pixels_per_clk(T),
119
        .name("AVR_"),
120
        .vertical_blanking(VERTICAL_BLANKING),
121
        .tile(tile_config)
122
      );
123
 
124
      rx_h = new(c_h, axis_out);
125
      tx_h = new(c_h, '{axis_in});
126
 
127
    endfunction: new
128
 
129
 
130
  // --------------------------------------------------------------------
131
  //
132
  endclass: tb_recursive_axis_switch_class
133
 
134
 
135
// --------------------------------------------------------------------
136
//
137
endpackage: tb_recursive_axis_switch_pkg
138
 
139
 
140
 
141
 
142
 

powered by: WebSVN 2.1.0

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