URL
https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk
Subversion Repositories qaz_libs
[/] [qaz_libs/] [trunk/] [axi4_stream_lib/] [src/] [recursive_axis_switch.sv] - Rev 36
Compare with Previous | Blame | View Log
////////////////////////////////////////////////////////////////////////// //////// Copyright (C) 2017 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 //////// //////////////////////////////////////////////////////////////////////////modulerecursive_axis_switch#(N, // data bus width in bytesI = 1, // TID widthD = 1, // TDEST widthU = 1, // TUSER widthSA, // mux select widthSD = 2 ** SA)(input [SA-1:0] select,axis_if axis_in,axis_if axis_out[SD-1:0],input aclk,input aresetn);// --------------------------------------------------------------------//generateif(SA == 1)begin: switch_genaxis_switch #(.N(N), .I(I), .D(D), .U(U))axis_switch_i(.*);endelsebegin: recursive_switch_gen// --------------------------------------------------------------------//axis_if #(.N(N), .I(I), .D(D), .U(U)) axis_switch_out[1:0](.*);axis_switch #(.N(N), .I(I), .D(D), .U(U))axis_switch_i(.select(select[SA-1]),.axis_out(axis_switch_out),.*);// --------------------------------------------------------------------//recursive_axis_switch #(.N(N), .I(I), .D(D), .U(U), .SA(SA - 1))switch_lo(.select(select[SA-2:0]),.axis_in(axis_switch_out[0]),.axis_out(axis_out[(SD/2)-1:0]),.*);// --------------------------------------------------------------------//recursive_axis_switch #(.N(N), .I(I), .D(D), .U(U), .SA(SA - 1))switch_hi(.select(select[SA-2:0]),.axis_in(axis_switch_out[1]),.axis_out(axis_out[SD-1:(SD/2)]),.*);endendgenerate// --------------------------------------------------------------------//endmodule
