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_register_slice.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                     ////
////                                                              ////
//////////////////////////////////////////////////////////////////////


module tb_top();

  // --------------------------------------------------------------------
  // test bench clock & reset
  wire clk_200mhz;
  wire tb_clk   = clk_200mhz;
  wire tb_rst;
  wire aclk     = tb_clk;
  wire aresetn  = ~tb_rst;

  tb_base #( .PERIOD(5_000) ) tb( clk_200mhz, tb_rst );


  // --------------------------------------------------------------------
  //
  localparam TILES              = 1;
  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 AVF_N = BYTES_PER_PIXEL * OUTPUTS_PER_TILE; // data bus width in bytes
  localparam AVF_U = 1;                                  // TUSER width

  axis_if #(.N(AVF_N), .U(AVF_U)) axis_in[TILES](.*);
  axis_if #(.N(AVF_N), .U(AVF_U)) axis_out[TILES](.*);


  // --------------------------------------------------------------------
  //
  axis_register_slice #(.N(AVF_N), .U(AVF_U))
    dut
    (
      .axis_en(1'b1),
      .axis_in(axis_in.slave[0]),
      .axis_out(axis_out.master[0]),
      .*
    );
  
  
  // --------------------------------------------------------------------
  //
  import axis_video_frame_bfm_pkg::*;
  import avf_agent_class_pkg::*;


  // --------------------------------------------------------------------
  //
  avf_agent_config_class avf_agent_config_h;
  avf_agent_class #(BYTES_PER_PIXEL, OUTPUTS_PER_TILE) avf_agent_h;

  initial
  begin

    avf_agent_config_h = new
    (
      .width(WIDTH),
      .height(HEIGHT),
      .bytes_per_pixel(BYTES_PER_PIXEL),
      .bits_per_pixel(BITS_PER_PIXEL),
      .tiles(TILES),
      .outputs_per_tile(OUTPUTS_PER_TILE),
      .name("AVF_"),
      .vertical_blanking(VERTICAL_BLANKING)
    );

    avf_agent_config_h.tile[0].direction = RIGHT_DOWN;

    avf_agent_h = new
    (
      .avf_agent_config(avf_agent_config_h),
      .avf_axis_in_if(axis_out),
      .avf_axis_out_if(axis_in)
    );

    avf_agent_h.init();

  end


  // --------------------------------------------------------------------
  // sim models
  //  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
  // \|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/
  //  '   '   '   '   '   '   '   '   '   '   '   '   '   '   '   '   '

  // --------------------------------------------------------------------
  //


  //  '   '   '   '   '   '   '   '   '   '   '   '   '   '   '   '   '
  // /|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\
  //  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
  // sim models
  // --------------------------------------------------------------------


  // --------------------------------------------------------------------
  //  debug wires
  for(genvar j = 0; j < TILES; j++)
    axis_video_debug #(BYTES_PER_PIXEL, OUTPUTS_PER_TILE) avf_debug(axis_out[j]);


  // --------------------------------------------------------------------
  // test
  the_test test( tb_clk, tb_rst );

  initial
    begin

      test.run_the_test();

      $display("^^^---------------------------------");
      $display("^^^ %16.t | Testbench done.", $time);
      $display("^^^---------------------------------");

      $display("^^^---------------------------------");

      $stop();

    end

endmodule



Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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