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_class_pkg.sv] - Rev 49

Compare with Previous | Blame | View Log

//////////////////////////////////////////////////////////////////////
////                                                              ////
//// Copyright (C) 2015 Authors and OPENCORES.ORG                 ////
////                                                              ////
//// This source file may be used and distributed without         ////
//// restriction provided that this copyright statement is not    ////
//// removed from the file and that any derivative work contains  ////
//// the original copyright notice and the associated disclaimer. ////
////                                                              ////
//// This source file is free software; you can redistribute it   ////
//// and/or modify it under the terms of the GNU Lesser General   ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any   ////
//// later version.                                               ////
////                                                              ////
//// This source is distributed in the hope that it will be       ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
//// PURPOSE.  See the GNU Lesser General Public License for more ////
//// details.                                                     ////
////                                                              ////
//// You should have received a copy of the GNU Lesser General    ////
//// Public License along with this source; if not, download it   ////
//// from http://www.opencores.org/lgpl.shtml                     ////
////                                                              ////
//////////////////////////////////////////////////////////////////////


package tb_axis_upsizer_class_pkg;

  // --------------------------------------------------------------------
  //
  import axis_video_frame_bfm_pkg::*;
  import tb_axis_upsizer_agent_class_pkg::*;


  // --------------------------------------------------------------------
  //
  localparam WIDTH              = 32; // tile width
  localparam HEIGHT             = 16; // tile height
  localparam OUTPUTS_PER_TILE   = 1;  // outputs per tile
  localparam BYTES_PER_PIXEL    = 2;
  localparam BITS_PER_PIXEL     = 16;
  localparam VERTICAL_BLANKING  = 20;

  localparam S = 4;                                       // tdata size multiplier
  localparam AVF_N = BYTES_PER_PIXEL * OUTPUTS_PER_TILE;  // data bus width in bytes
  localparam AVF_U = 3;                                   // TUSER width


  // --------------------------------------------------------------------
  //
  class tb_axis_upsizer_class
    extends tb_axis_upsizer_agent_class #(BYTES_PER_PIXEL, OUTPUTS_PER_TILE, AVF_N, AVF_U, S);

    avf_config_class in_c_h;
    avf_config_class out_c_h;
    avf_tile_config_t   tile_config[];


    //--------------------------------------------------------------------
    //
    function new
      (
        virtual axis_if #(.N(AVF_N * S), .U(AVF_U)) avf_axis_in_if,
        virtual axis_if #(.N(AVF_N), .U(AVF_U)) avf_axis_out_if
      );

      super.new(avf_axis_in_if, avf_axis_out_if);

      this.tile_config              = new[1];
      this.tile_config[0].direction = RIGHT_DOWN;

      this.in_c_h = new
      (
        .width(WIDTH),
        .height(HEIGHT),
        .bytes_per_pixel(BYTES_PER_PIXEL),
        .bits_per_pixel(BITS_PER_PIXEL),
        .pixels_per_clk(OUTPUTS_PER_TILE * S),
        .name("IN_"),
        .vertical_blanking(VERTICAL_BLANKING),
        .tile(tile_config)
      );

      this.out_c_h = new
      (
        .width(WIDTH),
        .height(HEIGHT),
        .bytes_per_pixel(BYTES_PER_PIXEL),
        .bits_per_pixel(BITS_PER_PIXEL),
        .pixels_per_clk(OUTPUTS_PER_TILE),
        .name("OUT_"),
        .vertical_blanking(VERTICAL_BLANKING),
        .tile(tile_config)
      );

      super.init(in_c_h, out_c_h);

    endfunction: new


  // --------------------------------------------------------------------
  //
  endclass: tb_axis_upsizer_class

// --------------------------------------------------------------------
//
endpackage: tb_axis_upsizer_class_pkg





Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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