1 ------------------------------------------------------------------------------- 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-04-25 5 -- Last update: 2016-05-04 6 ------------------------------------------------------------------------------- 7 -- Description: SSI Package File 8 ------------------------------------------------------------------------------- 9 -- This file is part of 'SLAC Firmware Standard Library'. 10 -- It is subject to the license terms in the LICENSE.txt file found in the 11 -- top-level directory of this distribution and at: 12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 13 -- No part of 'SLAC Firmware Standard Library', including this file, 14 -- may be copied, modified, propagated, or distributed except according to 15 -- the terms contained in the LICENSE.txt file. 16 ------------------------------------------------------------------------------- 19 use ieee.std_logic_1164.
all;
20 use ieee.std_logic_unsigned.
all;
21 use ieee.std_logic_arith.
all;
28 --! @ingroup protocols_ssi 40 tData => (others => '0'), 41 tStrb => (others => '1'), 42 tKeep => (others => '1'), 44 tDest => (others => '0'), 45 tId => (others => '0'), 46 tUser => x"01010101010101010101010101010101");
-- EOFE 48 ------------------------------------------------------------------------------------------------- 49 -- Build an SSI configuration 50 ------------------------------------------------------------------------------------------------- 55 tDestBits :
range 0 to 8 :=
4;
56 tUserBits :
range 2 to 8 :=
2)
59 -- A default SSI config is useful to have 62 ------------------------------------------------------------------------------------------------- 63 -- SSI Records and AXI-Stream conversion functions 64 ------------------------------------------------------------------------------------------------- 69 keep : slv(
15 downto 0);
115 -- constant SSI_MASTER_INIT_C : SsiMasterType := axis2SsiMaster(SSI_CONFIG_INIT_C, AXI_STREAM_MASTER_INIT_C); 116 -- constant SSI_SLAVE_INIT_C : SsiSlaveType := axis2SsiSlave(AXI_STREAM_SLAVE_INIT_C, AXI_STREAM_CTRL_UNUSED_C); 119 ------------------------------------------------------------------------------------------------- 120 -- Functions to interpret TUSER bits 121 ------------------------------------------------------------------------------------------------- 153 tDestBits :
range 0 to 8 :=
4;
154 tUserBits :
range 2 to 8 :=
2)
164 ret.
TUSER_MODE_C := tUserMode;
-- User field valid on last only 166 end function ssiAxiStreamConfig;
174 ret := axiStreamGetUserBit
(axisConfig, axisMaster,
SSI_EOFE_C);
178 ------------------------------------------------------------------------------------------------- 193 ssiSetUserSof
(axisConfig, ret, ssiMaster.
sof);
194 ssiSetUserEofe
(axisConfig, ret, ssiMaster.
eofe);
196 end function ssi2AxisMaster;
206 end function ssi2AxisSlave;
217 end function ssi2AxisCtrl;
230 ret.
packed := toSl
(axiStreamPacked
(axisConfig, axisMaster
));
232 ret.
sof := ssiGetUserSof
(axisConfig, axisMaster
);
234 ret.
eofe := ssiGetUserEofe
(axisConfig, axisMaster
);
236 end function axis2SsiMaster;
250 end function axis2SsiSlave;
260 end function ssiMasterInit;
267 end function ssiSlaveInit;
270 ------------------------------------------------------------------------------------------------- 285 ret := axiStreamGetUserBit
(axisConfig, axisMaster,
SSI_SOF_C,
0);
294 axiStreamSetUserBit
(axisConfig, axisMaster,
SSI_SOF_C,
sof,
0);
301 axisMaster.
tLast := '
0';
302 axisMaster.
tUser :=
(others => '
0'
);
305 end package body SsiPkg;
natural range 0 to 8 TDEST_BITS_C
(TUSER_NORMAL_C,TUSER_FIRST_LAST_C,TUSER_LAST_C,TUSER_NONE_C) TUserModeType
ssiSetUserEofeaxisConfig,axisMaster,eofe,
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
AxiStreamMasterType ssi2AxisMasteraxisConfig,ssiMaster,
SsiMasterType ssiMasterInitaxisConfig,
natural range 1 to 16 TDATA_BYTES_C
sl ssiGetUserEofeaxisConfig,axisMaster,
TkeepModeType TKEEP_MODE_C
natural range 0 to 8 TID_BITS_C
integer := 0 SSI_TID_BITS_C
SsiMasterType axis2SsiMasteraxisConfig,axisMaster,
sl ssiGetUserSofaxisConfig,axisMaster,
AxiStreamSlaveType :=(tReady => '0') AXI_STREAM_SLAVE_INIT_C
integer := 2 SSI_TUSER_BITS_C
ssiSetUserSofaxisConfig,axisMaster,sof,
TUserModeType TUSER_MODE_C
boolean := false SSI_TSTRB_EN_C
integer := 4 SSI_TDEST_BITS_C
natural range 0 to 8 TUSER_BITS_C
AxiStreamSlaveType ssi2AxisSlavessiSlave,
slv( SSI_TDEST_BITS_C- 1 downto 0) dest
AxiStreamConfigType ssiAxiStreamConfigdataBytes,tKeepMode,tUserMode,tDestBits,tUserBits,
AxiStreamConfigType := ssiAxiStreamConfig( 16) SSI_CONFIG_INIT_C
AxiStreamCtrlType :=(pause => '0',overflow => '0',idle => '1') AXI_STREAM_CTRL_UNUSED_C
AxiStreamMasterType :=(tValid => '1',tData =>( others => '0'),tStrb =>( others => '1'),tKeep =>( others => '1'),tLast => '1',tDest =>( others => '0'),tId =>( others => '0'),tUser => x"01010101010101010101010101010101") SSI_MASTER_FORCE_EOFE_C
(TKEEP_NORMAL_C,TKEEP_COMP_C,TKEEP_FIXED_C) TKeepModeType
SsiSlaveType ssiSlaveInitaxisConfig,
AxiStreamCtrlType ssi2AxisCtrlssiSlave,
SsiSlaveType axis2SsiSlaveaxisConfig,axisSlave,axisCtrl,