1 ------------------------------------------------------------------------------- 2 -- File : SsiIncrementingTx.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-04-02 5 -- Last update: 2014-07-18 6 ------------------------------------------------------------------------------- 7 -- Description: This module generates 8 -- PseudoRandom Binary Sequence (INCREMENTING) on Virtual Channel Lane. 9 ------------------------------------------------------------------------------- 10 -- This file is part of 'SLAC Firmware Standard Library'. 11 -- It is subject to the license terms in the LICENSE.txt file found in the 12 -- top-level directory of this distribution and at: 13 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 14 -- No part of 'SLAC Firmware Standard Library', including this file, 15 -- may be copied, modified, propagated, or distributed except according to 16 -- the terms contained in the LICENSE.txt file. 17 ------------------------------------------------------------------------------- 20 use ieee.std_logic_1164.
all;
21 use ieee.std_logic_unsigned.
all;
22 use ieee.std_logic_arith.
all;
29 --! @ingroup protocols_ssi 32 -- General Configurations 34 -- FIFO configurations 47 -- AXI Stream IO Config 51 -- Master Port (mAxisClk) 57 -- Trigger Signal (locClk domain) 59 locRst :
in sl := '0';
67 end SsiIncrementingTx;
72 constant PRBS_SSI_CONFIG_C : AxiStreamConfigType := ssiAxiStreamConfig(PRBS_BYTES_C, TKEEP_NORMAL_C);
81 type RegType is record 84 dataCnt : slv(31 downto 0);
91 constant REG_INIT_C : RegType := ( 100 signal r : RegType := REG_INIT_C;
101 signal rin : RegType;
108 assert (PRBS_SEED_SIZE_G mod 8 = 0) report "PRBS_SEED_SIZE_G must be a multiple of 8" severity failure;
112 variable v : RegType;
114 -- Latch the current value 118 ---------------------------------------------------------------------- 121 v.txAxisMaster.tValid := '0';
123 -- Reset the busy flag 125 -- Check for a trigger 127 -- Latch the generator seed 128 v.randomData := r.eventCnt;
131 -- Latch the configuration 133 v.txAxisMaster.tId := tId;
134 -- Check the packet length request value 136 -- Force minimum packet length of 2 (+1) 139 -- Force minimum packet length of 2 (+1) 142 -- Latch the packet length 146 v.state := SEED_RAND_S;
148 ---------------------------------------------------------------------- 151 --if txAxisSlave.tReady = '1' then 152 -- Send the random seed word 153 v.txAxisMaster.tvalid := '1';
155 -- Generate the next random data word 156 v.randomData := r.randomData + 1;
157 -- Increment the counter 158 v.eventCnt := r.eventCnt + 1;
159 -- Increment the counter 160 v.dataCnt := r.dataCnt + 1;
162 axiStreamSetUserBit(PRBS_SSI_CONFIG_C,v.txAxisMaster,SSI_SOF_C,'1',0);
167 ---------------------------------------------------------------------- 170 if txAxisSlave.tReady = '1' then 172 axiStreamSetUserBit(PRBS_SSI_CONFIG_C,v.txAxisMaster,SSI_SOF_C,'0',0);
174 -- Send the upper packetLength value 175 v.txAxisMaster.tvalid := '1';
177 -- Increment the counter 178 v.dataCnt := r.dataCnt + 1;
182 ---------------------------------------------------------------------- 185 if txAxisSlave.tReady = '1' then 186 -- Send the random data word 187 v.txAxisMaster.tValid := '1';
190 -- Generate the next random data word 191 v.randomData := r.randomData + 1;
192 -- Increment the counter 193 v.dataCnt := r.dataCnt + 1;
197 v.dataCnt := (others => '0');
198 -- Set the end of frame flag 199 v.txAxisMaster.tLast := '1';
200 -- Reset the busy flag 207 ---------------------------------------------------------------------- 209 if txAxisSlave.tReady = '1' then 210 v.txAxisMaster.tValid := '0';
211 v.txAxisMaster.tLast := '0';
215 ---------------------------------------------------------------------- 223 -- Register the variable for next clock cycle 227 txAxisMaster <= r.txAxisMaster;
234 if rising_edge(locClk) then 235 r <= rin after TPD_G;
241 -- General Configurations 244 -- FIFO configurations 255 -- AXI Stream Port Configurations
FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 9
out sAxisCtrlAxiStreamCtrlType
ALTERA_RAM_Gstring := "M9K"
in mAxisSlaveAxiStreamSlaveType
USE_BUILT_IN_Gboolean := false
in tIdslv( 7 downto 0) := X"00"
PIPE_STAGES_Gnatural range 0 to 16:= 1
FIFO_PAUSE_THRESH_Gnatural range 1 to ( 2** 24):= 2** 8
GEN_SYNC_FIFO_Gboolean := false
in packetLengthslv( 31 downto 0) := X"FFFFFFFF"
in tDestslv( 7 downto 0) := X"00"
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
XIL_DEVICE_Gstring := "7SERIES"
FIFO_FIXED_THRESH_Gboolean := true
CASCADE_SIZE_Gnatural range 1 to ( 2** 24):= 1
GEN_SYNC_FIFO_Gboolean := false
XIL_DEVICE_Gstring := "7SERIES"
MASTER_AXI_STREAM_CONFIG_GAxiStreamConfigType := ssiAxiStreamConfig( 16, TKEEP_NORMAL_C)
array(natural range <> ) of natural NaturalArray
PRBS_SEED_SIZE_Gnatural range 32 to 128:= 32
MASTER_AXI_PIPE_STAGES_Gnatural range 0 to 16:= 0
out mAxisMasterAxiStreamMasterType
PRBS_TAPS_GNaturalArray :=( 0=> 31, 1=> 6, 2=> 2, 3=> 1)
out sAxisSlaveAxiStreamSlaveType
ALTERA_SYN_Gboolean := false
FIFO_ADDR_WIDTH_Gnatural range 4 to 48:= 9
in sAxisMasterAxiStreamMasterType
out mAxisMasterAxiStreamMasterType
ALTERA_RAM_Gstring := "M9K"
in mAxisSlaveAxiStreamSlaveType
CASCADE_SIZE_Ginteger range 1 to ( 2** 24):= 1
USE_BUILT_IN_Gboolean := false
FIFO_PAUSE_THRESH_Ginteger range 1 to ( 2** 24):= 1
ALTERA_SYN_Gboolean := true
MASTER_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C