1 ------------------------------------------------------------------------------- 2 -- File : AxiStreamMux.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-04-25 5 -- Last update: 2016-11-30 6 ------------------------------------------------------------------------------- 8 -- Block to connect multiple incoming AXI streams into a single encoded 9 -- outbound stream. The destination field is updated accordingly. 10 ------------------------------------------------------------------------------- 11 -- This file is part of 'SLAC Firmware Standard Library'. 12 -- It is subject to the license terms in the LICENSE.txt file found in the 13 -- top-level directory of this distribution and at: 14 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 15 -- No part of 'SLAC Firmware Standard Library', including this file, 16 -- may be copied, modified, propagated, or distributed except according to 17 -- the terms contained in the LICENSE.txt file. 18 ------------------------------------------------------------------------------- 21 use ieee.std_logic_1164.
all;
22 use ieee.std_logic_arith.
all;
23 use ieee.std_logic_unsigned.
all;
35 MODE_G : := "INDEXED";
-- Or "ROUTED" 38 TDEST_LOW_G : range 0 to 7 := 0;
-- LSB of updated tdest for INDEX 39 ILEAVE_EN_G : := false;
-- Set to true if interleaving dests, arbitrate on gaps 40 ILEAVE_REARB_G : := 0);
-- Max number of transactions between arbitrations, 0 = unlimited 48 disableSel :
in slv(NUM_SLAVES_G-1
downto 0) := (
others => '0');
76 acks => (others => '0'), 93 report "In INDEXED mode, TDest range 7 downto " & 'image(TDEST_LOW_G) & 98 report "In ROUTED mode, length of TDEST_ROUTES_G: " & 'image(TDEST_ROUTES_G'length) & 102 -- Override tdests according to the routing table 111 for j in 7 downto 0 loop 113 tmp(i).tDest(j) := '1';
115 tmp(i).tDest(j) := '0';
131 -- Latch the current value 149 if MODE_G = "INDEXED" then 155 requests := (others => '0');
162 ---------------------------------------------------------------------- 164 -- Arbitrate between requesters 168 -- Reset the Arbitration flag 170 -- Check if need to move data 174 -- Move the AXIS data 176 -- Check for no-tLast 177 if selData.tLast = '0' then 186 v.arbCnt := (others=>'0');
187 ---------------------------------------------------------------------- 189 -- Check if need to move data 193 -- Move the AXIS data 197 if selData.tLast = '1' then 201 -- Rearbitrate after n transactions if enabled 206 -- RE-arbitrate on gaps if interleaving frames 210 ---------------------------------------------------------------------- 218 -- Register the variable for next clock cycle PIPE_STAGES_Gnatural range 0 to 16:= 0
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
slv( ARB_BITS_C- 1 downto 0) acks
AxiStreamSlaveArray( NUM_SLAVES_G- 1 downto 0) slaves
slv( DEST_SIZE_C- 1 downto 0) ackNum
integer := bitSize( NUM_SLAVES_G- 1) DEST_SIZE_C
AxiStreamMasterType :=(tValid => '0',tData =>( others => '0'),tStrb =>( others => '1'),tKeep =>( others => '1'),tLast => '0',tDest =>( others => '0'),tId =>( others => '0'),tUser =>( others => '0')) AXI_STREAM_MASTER_INIT_C
TDEST_ROUTES_GSlv8Array :=( 0=> "--------")
out sAxisSlaveAxiStreamSlaveType
AxiStreamMasterType master
TDEST_LOW_Ginteger range 0 to 7:= 0
in mAxisSlaveAxiStreamSlaveType
AxiStreamMasterType pipeAxisMaster
integer := bitSize(ILEAVE_REARB_G ) ACNT_SIZE_G
RegType :=(state => IDLE_S,acks =>( others => '0'),ackNum => toSlv( NUM_SLAVES_G- 1, DEST_SIZE_C),valid => '0',arbCnt =>( others => '0'),slaves =>( others => AXI_STREAM_SLAVE_INIT_C),master => AXI_STREAM_MASTER_INIT_C) REG_INIT_C
MODE_Gstring := "INDEXED"
ILEAVE_REARB_Gnatural := 0
ILEAVE_EN_Gboolean := false
out mAxisMasterAxiStreamMasterType
NUM_SLAVES_Ginteger range 1 to 32:= 4
in sAxisMasterAxiStreamMasterType
AxiStreamSlaveType :=(tReady => '0') AXI_STREAM_SLAVE_INIT_C
in sAxisMastersAxiStreamMasterArray( NUM_SLAVES_G- 1 downto 0)
integer := 2** DEST_SIZE_C ARB_BITS_C
AxiStreamMasterArray( NUM_SLAVES_G- 1 downto 0) sAxisMastersTmp
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
out sAxisSlavesAxiStreamSlaveArray( NUM_SLAVES_G- 1 downto 0)
AxiStreamSlaveType pipeAxisSlave
out mAxisMasterAxiStreamMasterType
in disableSelslv( NUM_SLAVES_G- 1 downto 0) :=( others => '0')
slv( ACNT_SIZE_G- 1 downto 0) arbCnt
array(natural range <> ) of slv( 7 downto 0) Slv8Array
in mAxisSlaveAxiStreamSlaveType
(IDLE_S,MOVE_S) StateType
PIPE_STAGES_Ginteger range 0 to 16:= 0