1 ------------------------------------------------------------------------------- 2 -- File : SsiCmdMaster.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-04-09 5 -- Last update: 2015-06-23 6 ------------------------------------------------------------------------------- 8 -- Block for Command protocol over the VC. 9 -- The receive packet is 4 x 32-bits. 10 -- Word 0 Data[1:0] = VC (unused, legacy) 11 -- Word 0 Data[7:2] = Dest_ID (unused, legacy) 12 -- Word 0 Data[31:8] = CmdCtx[31:0] (unused, legacy) 13 -- Word 1 Data[7:0] = OpCode[7:0] 14 -- Word 1 Data[31:8] = Don't Care 15 -- Word 2 = Don't Care 16 -- Word 3 = Don't Care 17 ------------------------------------------------------------------------------- 18 -- This file is part of 'SLAC Firmware Standard Library'. 19 -- It is subject to the license terms in the LICENSE.txt file found in the 20 -- top-level directory of this distribution and at: 21 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 22 -- No part of 'SLAC Firmware Standard Library', including this file, 23 -- may be copied, modified, propagated, or distributed except according to 24 -- the terms contained in the LICENSE.txt file. 25 ------------------------------------------------------------------------------- 28 use ieee.std_logic_1164.
all;
29 use ieee.std_logic_arith.
all;
30 use ieee.std_logic_unsigned.
all;
35 use work.SsiCmdMasterPkg.
all;
38 --! @ingroup protocols_ssi 43 -- AXI Stream FIFO Config 47 USE_BUILT_IN_G : := false;
--if set to true, this module is only Xilinx compatible only!!! 56 -- AXI Stream Configuration 61 -- Streaming Data Interface 80 type StateType is (IDLE_S, CMD_S, DUMP_S);
82 type RegType is record 83 txnNumber : slv(2 downto 0);
87 constant REG_INIT_C : RegType := ( 88 txnNumber => (others => '0'), 92 signal r : RegType := REG_INIT_C;
99 ---------------------------------- 101 ---------------------------------- 130 ---------------------------------- 131 -- Command State Machine 132 ---------------------------------- 137 comb :
process (
cmdRst, fifoAxisMaster, r)
is 138 variable v : RegType;
146 if (fifoAxisMaster.tValid = '1') then 147 v.txnNumber := r.txnNumber + 1;
155 v.cmdMaster.valid := fifoAxisMaster.tLast and not ssiGetUserEofe(INT_CONFIG_C, fifoAxisMaster);
157 -- Too many txns in frame, freeze counting 158 -- Will auto reset txnNumber to 0 on tLast 159 v.txnNumber := r.txnNumber;
164 --if (not axiStreamPacked(INT_CONFIG_C, fifoAxisMaster)) then 165 -- -- Fail frame if any txn is not packed 166 -- v.txnNumber := "100"; 167 -- v.cmdMaster.valid := '0'; 170 if (fifoAxisMaster.tLast = '1') then 171 -- Reset frame on tLast or EOFE 172 v.txnNumber := "000";
189 if (rising_edge(cmdClk)) then 190 r <= rin after TPD_G;
194 end architecture rtl;
FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 9
out sAxisCtrlAxiStreamCtrlType
out sAxisCtrlAxiStreamCtrlType
ALTERA_RAM_Gstring := "M9K"
XIL_DEVICE_Gstring := "7SERIES"
ALTERA_RAM_Gstring := "M9K"
SLAVE_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
SLAVE_READY_EN_Gboolean := true
FIFO_FIXED_THRESH_Gboolean := true
in sAxisMasterAxiStreamMasterType
USE_BUILT_IN_Gboolean := false
SLAVE_READY_EN_Gboolean := false
FIFO_PAUSE_THRESH_Ginteger range 1 to ( 2** 24):= 8
GEN_SYNC_FIFO_Gboolean := false
XIL_DEVICE_Gstring := "7SERIES"
out cmdMasterSsiCmdMasterType
out sAxisSlaveAxiStreamSlaveType
CASCADE_SIZE_Ginteger range 1 to ( 2** 24):= 1
AXI_STREAM_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
out sAxisSlaveAxiStreamSlaveType
ALTERA_SYN_Gboolean := false
FIFO_FIXED_THRESH_Gboolean := true
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
BRAM_EN_Gboolean := false
in sAxisMasterAxiStreamMasterType
out mAxisMasterAxiStreamMasterType
AxiStreamSlaveType :=(tReady => '1') AXI_STREAM_SLAVE_FORCE_C
FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 4
ALTERA_SYN_Gboolean := false
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
MASTER_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
GEN_SYNC_FIFO_Gboolean := false