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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [video/] [src/] [avf_kernel_1x_buffer.sv] - Rev 50

Go to most recent revision | Compare with Previous | Blame | View Log

//////////////////////////////////////////////////////////////////////
////                                                              ////
//// Copyright (C) 2019 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
  avf_kernel_1x_buffer #(N, U, L, AW)
  (
    axis_if axis_in,
    axis_if axis_out,
    input   aclk,
    input   aresetn
  );

  // --------------------------------------------------------------------
  axis_if #(.N(N*L*L), .U(U+1)) a_buffer(.*);

  avf_kernel_buffer #(N, U, L, AW)
    kernel_i(.axis_out(a_buffer), .*);
    
  // --------------------------------------------------------------------
  reg [(N*8)-1:0] kernel[L][L];

  generate
    for(genvar j = 0; j < L * L; j++)
    begin: kernel_gen
      assign  kernel[j/L][j%L] = a_buffer.tdata[j*N*8 +: N*8];
    end
  endgenerate

  // --------------------------------------------------------------------
  axis_if #(.N(N), .U(U+1)) a_out(.*);
  
  axis_alias alias_i(.axis_in(a_out), .*);

  // --------------------------------------------------------------------
  assign a_buffer.tuser[3] = a_buffer.tvalid & a_buffer.tready;
  //                                              EOF   SOL   SOF
  localparam logic[U:0] TUSER_MASK[3] = '{ {1'b0, 1'b0, 1'b1, 1'b1},   // first
                                           {1'b0, 1'b0, 1'b0, 1'b0},   // middle
                                           {1'b1, 1'b1, 1'b0, 1'b0} }; // last

  axis_down_shift #(.N(N*L*L), .S(L*L), .U(U+1), .TUSER_MASK(TUSER_MASK))
    down_i(.axis_in(a_buffer), .axis_out(a_out), .*);

// --------------------------------------------------------------------
endmodule

Go to most recent revision | 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.