1 ------------------------------------------------------------------------------- 2 -- File : SsiInsertSof.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2015-08-18 5 -- Last update: 2015-10-23 6 ------------------------------------------------------------------------------- 7 -- Description: Inserts the SOF for converting a generic AXIS into a SSI bus 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 33 COMMON_CLK_G : := false;
-- True if sAxisClk and mAxisClk are the same clock 34 INSERT_USER_HDR_G : := false;
-- If True the module adds one user header word (mUserHdr = user header data) 59 type RegType is record 64 constant REG_INIT_C : RegType := ( 69 signal r : RegType := REG_INIT_C;
87 -- General Configurations 92 -- FIFO configurations 98 -- AXI Stream Port Configurations 116 variable v : RegType;
119 -- Latch the current value 124 if txSlave.tReady = '1' then 130 ---------------------------------------------------------------------- 132 -- Check if ready to move data 133 if (v.txMaster.tValid = '0') and (rxMaster.tValid = '1') then 138 v.txMaster := rxMaster;
139 -- Mask off the TUSER bits 140 for i in 127 downto 0 loop 142 v.txMaster.tUser(i) := '0';
145 -- Insert the SOF bit 148 if (rxMaster.tLast = '0') then 153 -- Insert User Header 158 -- Insert the SOF bit 164 ---------------------------------------------------------------------- 166 -- Check if ready to move data 167 if (v.txMaster.tValid = '0') and (rxMaster.tValid = '1') then 171 v.txMaster := rxMaster;
172 -- Mask off the TUSER bits 173 for i in 127 downto 0 loop 175 v.txMaster.tUser(i) := '0';
178 -- Mask off the SOF bits 181 if (rxMaster.tLast = '1') then 186 ---------------------------------------------------------------------- 194 -- Register the variable for next clock cycle 198 rxSlave <= v.rxSlave;
199 txMaster <= r.txMaster;
206 r <= rin after TPD_G;
218 -- General Configurations 223 -- FIFO configurations 229 -- AXI Stream Port Configurations
FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 9
PIPE_STAGES_Gnatural range 0 to 16:= 1
MASTER_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_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
SLAVE_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
COMMON_CLK_Gboolean := false
SLAVE_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
SLAVE_READY_EN_Gboolean := true
in sAxisMasterAxiStreamMasterType
INSERT_USER_HDR_Gboolean := false
MASTER_FIFO_Gboolean := true
in mUserHdrslv( 127 downto 0) :=( others => '0')
GEN_SYNC_FIFO_Gboolean := false
SLAVE_FIFO_Gboolean := true
TUSER_MASK_Gslv( 127 downto 0) :=( others => '1')
out sAxisSlaveAxiStreamSlaveType
AxiStreamSlaveType :=(tReady => '0') AXI_STREAM_SLAVE_INIT_C
out sAxisSlaveAxiStreamSlaveType
AxiStreamConfigType :=(TSTRB_EN_C => false,TDATA_BYTES_C => 16,TDEST_BITS_C => 4,TID_BITS_C => 0,TKEEP_MODE_C => TKEEP_NORMAL_C,TUSER_BITS_C => 4,TUSER_MODE_C => TUSER_NORMAL_C) AXI_STREAM_CONFIG_INIT_C
in mAxisSlaveAxiStreamSlaveType
in sAxisMasterAxiStreamMasterType
out mAxisMasterAxiStreamMasterType
in mAxisSlaveAxiStreamSlaveType
CASCADE_SIZE_Ginteger range 1 to ( 2** 24):= 1
USE_BUILT_IN_Gboolean := false
out mAxisMasterAxiStreamMasterType
VALID_THOLD_Ginteger range 0 to ( 2** 24):= 1
MASTER_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C