1 ------------------------------------------------------------------------------- 2 -- File : Pgp2bGtp7FixedLat.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2013-06-29 5 -- Last update: 2016-12-16 6 ------------------------------------------------------------------------------- 7 -- Description: Gth7 Fixed Latency Module 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;
27 use UNISIM.VCOMPONENTS.
all;
30 --! @ingroup protocols_pgp_pgp2b_gtp7 35 ---------------------------------------------------------------------------------------------- 37 ---------------------------------------------------------------------------------------------- 44 -- TX/RX Settings - Defaults to 2.5 Gbps operation 55 -- Allow TX to run in var lat mode by altering these generics 59 -- Configure PLL sources 63 ---------------------------------------------------------------------------------------------- 65 ---------------------------------------------------------------------------------------------- 84 gtRxN : in sl;
-- GT Serial Receive Negative 85 gtRxP : in sl;
-- GT Serial Receive Positive 86 gtTxN : out sl;
-- GT Serial Transmit Negative 87 gtTxP : out sl;
-- GT Serial Transmit Positive 99 pgpRxClk : in sl;
-- Run recClk through external MMCM and sent to this input 111 -- Frame Transmit Interface - 1 Lane, Array of 4 VCs 115 -- Frame Receive Interface - 1 Lane, Array of 4 VCs 124 -- AXI-Lite Interface 132 end Pgp2bGtp7FixedLat;
135 -- Define architecture 138 -------------------------------------------------------------------------------------------------- 140 -------------------------------------------------------------------------------------------------- 144 signal gtRxResetDone : sl;
145 signal gtRxResetDoneL : sl;
146 signal gtRxUserReset : sl;
148 signal pgpRxResetInt : sl;
151 signal gtRxData : slv(19 downto 0);
-- Feed to 8B10B decoder 152 signal dataValid : sl;
-- no decode or disparity errors 156 signal phyRxInit : sl;
-- To RxRst 158 -------------------------------------------------------------------------------------------------- 160 -------------------------------------------------------------------------------------------------- 161 signal gtTxUsrClk : sl;
163 signal gtTxResetDone : sl;
169 signal stableRst : sl;
174 signal drpAddr : slv(8 downto 0);
175 signal drpDi : slv(15 downto 0);
176 signal drpDo : slv(15 downto 0);
180 pgpRxResetInt <= pgpRxReset or gtRxResetDoneL;
182 -------------------------------------------------------------------------------------------------- 184 -------------------------------------------------------------------------------------------------- 203 phyTxReady => gtTxResetDone,
--phyTxReady, -- Use txResetDone 205 pgpRxClkRst => pgpRxResetInt,
--gtRxResetDoneL, -- Hold in reset until gtp rx is up 214 phyRxInit => gtRxUserReset
-- Ignore phyRxInit, rx will reset on its own 217 -------------------------------------------------------------------------------------------------- 219 -- Hold Decoder and PgpRx in reset until GtRxResetDone. 220 -------------------------------------------------------------------------------------------------- 221 gtRxResetDoneL <= not gtRxResetDone;
229 rst => gtRxResetDone,
236 dataValid <= not (uOr(phyRxLanesIn(0).decErr) or uOr(phyRxLanesIn(0).dispErr));
240 -------------------------------------------------------------------------------------------------- 242 -------------------------------------------------------------------------------------------------- 245 -------------------------------------------------------------------------------------------------- 246 -- GTP 7 Core in Fixed Latency mode 247 -------------------------------------------------------------------------------------------------- 283 -- ALIGN_COMMA_DOUBLE_G => ALIGN_COMMA_DOUBLE_G, 284 -- ALIGN_COMMA_ENABLE_G => ALIGN_COMMA_ENABLE_G, 285 -- ALIGN_COMMA_WORD_G => ALIGN_COMMA_WORD_G, 286 -- ALIGN_MCOMMA_DET_G => ALIGN_MCOMMA_DET_G, 287 -- ALIGN_MCOMMA_VALUE_G => ALIGN_MCOMMA_VALUE_G, 288 -- ALIGN_MCOMMA_EN_G => ALIGN_MCOMMA_EN_G, 289 -- ALIGN_PCOMMA_DET_G => ALIGN_PCOMMA_DET_G, 290 -- ALIGN_PCOMMA_VALUE_G => ALIGN_PCOMMA_VALUE_G, 291 -- ALIGN_PCOMMA_EN_G => ALIGN_PCOMMA_EN_G, 292 -- SHOW_REALIGN_COMMA_G => SHOW_REALIGN_COMMA_G, 298 -- RX_DISPERR_SEQ_MATCH_G => RX_DISPERR_SEQ_MATCH_G, 299 -- DEC_MCOMMA_DETECT_G => DEC_MCOMMA_DETECT_G, 300 -- DEC_PCOMMA_DETECT_G => DEC_PCOMMA_DETECT_G, 301 -- DEC_VALID_COMMA_ONLY_G => DEC_VALID_COMMA_ONLY_G 318 rxUserRdyOut =>
open,
-- rx clock locked and stable, but alignment not yet done 324 rxSlideIn => '0',
-- Slide is controlled internally 382 U_RstSync :
entity work.
RstSync
SIM_VERSION_Gstring := "1.0"
in pgpTxMastersAxiStreamMasterArray( 3 downto 0) :=( others => AXI_STREAM_MASTER_INIT_C)
ADDR_WIDTH_Gpositive range 1 to 32:= 16
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
in pgpTxMmcmLockedsl := '1'
TX_EXT_DATA_WIDTH_Ginteger := 16
TX_ENABLE_Gboolean := true
RX_EXT_DATA_WIDTH_Ginteger := 16
TX_INT_DATA_WIDTH_Ginteger := 20
in qPllLockInslv( 1 downto 0)
RX_OS_CFG_Gbit_vector := "0001111110000"
FIXED_ALIGN_COMMA_0_Gslv := "----------0101111100"
in gtQPllLockslv( 1 downto 0) := "00"
out drpAddrslv( ADDR_WIDTH_G- 1 downto 0)
in qPllRefClkLostInslv( 1 downto 0)
SIMULATION_Gboolean := false
RX_OS_CFG_Gbit_vector := "0001111110000"
out axilWriteSlaveAxiLiteWriteSlaveType
out drpDoslv( 15 downto 0)
out pgpTxSlavesAxiStreamSlaveArray( 3 downto 0)
EN_ARBITRATION_Gboolean := false
DATA_WIDTH_Gpositive range 1 to 32:= 16
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
in pgpRxCtrlAxiStreamCtrlArray( 3 downto 0)
out pgpRxMasterMuxedAxiStreamMasterType
out axilReadSlaveAxiLiteReadSlaveType
out dataOutslv( NUM_BYTES_G* 8- 1 downto 0)
in drpDislv( 15 downto 0) := X"0000"
out rxCharIsKOutslv(( RX_EXT_DATA_WIDTH_G/ 8)- 1 downto 0)
in drpDoslv( DATA_WIDTH_G- 1 downto 0)
COMMON_CLK_Gboolean := false
in axilWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
TX_PHASE_ALIGN_Gstring := "AUTO"
in txPostCursorslv( 4 downto 0) :=( others => '0')
in pgpRxInPgp2bRxInType := PGP2B_RX_IN_INIT_C
in txCharIsKInslv(( TX_EXT_DATA_WIDTH_G/ 8)- 1 downto 0)
out txBufStatusOutslv( 1 downto 0)
TX_CLK25_DIV_Ginteger := 5
VC_INTERLEAVE_Ginteger := 1
TX_CLK25_DIV_Ginteger := 5
out pgpRxOutPgp2bRxOutType
out codeErrslv( NUM_BYTES_G- 1 downto 0)
RXCDR_CFG_Gbit_vector := x"0000107FE206001041010"
out pgpTxMmcmResetsl := '0'
out dispErrslv( NUM_BYTES_G- 1 downto 0)
in txPreCursorslv( 4 downto 0) :=( others => '0')
out qPllResetOutslv( 1 downto 0)
RX_ENABLE_Gboolean := true
FIXED_ALIGN_COMMA_1_Gslv := "----------1010000011"
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
in txMmcmLockedInsl := '1'
RXLPM_IPCM_CFG_Gbit := '0'
in gtQPllRefClkLostslv( 1 downto 0) := "00"
in txPostCursorslv( 4 downto 0) :=( others => '0')
array(natural range <> ) of Pgp2bTxPhyLaneOutType Pgp2bTxPhyLaneOutArray
out pgpRxOutPgp2bRxOutType
out axilWriteSlaveAxiLiteWriteSlaveType
out rxBufStatusOutslv( 2 downto 0)
in pgpTxMastersAxiStreamMasterArray( 3 downto 0) :=( others => AXI_STREAM_MASTER_INIT_C)
SIM_GTRESET_SPEEDUP_Gstring := "FALSE"
PAYLOAD_CNT_TOP_Ginteger := 7
in rxDataValidInsl := '1'
NUM_VC_EN_Ginteger range 1 to 4:= 4
PMA_RSV_Gbit_vector := x"00000333"
SIM_GTRESET_SPEEDUP_Gstring := "FALSE"
slv( 1 downto 0) := "11" AXI_RESP_DECERR_C
PAYLOAD_CNT_TOP_Ginteger := 7
out rxDataOutslv( RX_EXT_DATA_WIDTH_G- 1 downto 0)
RXLPM_INCM_CFG_Gbit := '1'
TX_BUF_EN_Gboolean := true
in axilReadMasterAxiLiteReadMasterType
in txDataInslv( TX_EXT_DATA_WIDTH_G- 1 downto 0)
RXCDR_CFG_Gbit_vector := x"0000107FE206001041010"
TX_ENABLE_Gboolean := true
in rxMmcmLockedInsl := '1'
in qPllRefClkInslv( 1 downto 0)
out phyRxLanesOutPgp2bRxPhyLaneOutArray( 0 to LANE_CNT_G- 1)
REF_CLK_FREQ_Greal := 125.0E6
TX_BUF_EN_Gboolean := false
in pgpRxCtrlAxiStreamCtrlArray( 3 downto 0) :=( others => AXI_STREAM_CTRL_UNUSED_C)
RX_OUTCLK_SRC_Gstring := "PLLREFCLK"
TX_PHASE_ALIGN_Gstring := "MANUAL"
in gtRxRefClkBufgsl := '0'
RX_ALIGN_MODE_Gstring := "GT"
in txDiffCtrlslv( 3 downto 0) := "1000"
in gtQPllOutRefClkslv( 1 downto 0) := "00"
array(natural range <> ) of AxiStreamCtrlType AxiStreamCtrlArray
TIMEOUT_Gpositive := 4096
in drpAddrslv( 8 downto 0) := "000000000"
SIM_VERSION_Gstring := "1.0"
array(natural range <> ) of Pgp2bRxPhyLaneOutType Pgp2bRxPhyLaneOutArray
RXSLIDE_MODE_Gstring := "PCS"
TX_OUTCLK_SRC_Gstring := "PLLREFCLK"
out pgpTxOutPgp2bTxOutType
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
in phyRxLanesInPgp2bRxPhyLaneInArray( 0 to LANE_CNT_G- 1) :=( others => PGP2B_RX_PHY_LANE_IN_INIT_C)
in gtQPllOutClkslv( 1 downto 0) := "00"
in qPllClkInslv( 1 downto 0)
out phyTxLanesOutPgp2bTxPhyLaneOutArray( 0 to LANE_CNT_G- 1)
REF_CLK_FREQ_Greal := 125.0E6
in dataInslv( NUM_BYTES_G* 10- 1 downto 0)
LANE_CNT_Ginteger range 1 to 2:= 1
out dataKOutslv( NUM_BYTES_G- 1 downto 0)
RXLPM_INCM_CFG_Gbit := '1'
AxiLiteReadMasterType :=(araddr =>( others => '0'),arprot =>( others => '0'),arvalid => '0',rready => '1') AXI_LITE_READ_MASTER_INIT_C
out rxDecErrOutslv(( RX_EXT_DATA_WIDTH_G/ 8)- 1 downto 0)
out rxDispErrOutslv(( RX_EXT_DATA_WIDTH_G/ 8)- 1 downto 0)
FIXED_ALIGN_COMMA_3_Gslv := "XXXXXXXXXXXXXXXXXXXX"
NUM_VC_EN_Ginteger range 1 to 4:= 4
in rstsl :=not RST_POLARITY_G
in axilWriteMasterAxiLiteWriteMasterType
in loopbackInslv( 2 downto 0) := "000"
in pgpTxInPgp2bTxInType := PGP2B_TX_IN_INIT_C
AxiLiteWriteMasterType :=(awaddr =>( others => '0'),awprot =>( others => '0'),awvalid => '0',wdata =>( others => '0'),wstrb =>( others => '1'),wvalid => '0',bready => '1') AXI_LITE_WRITE_MASTER_INIT_C
RX_ENABLE_Gboolean := true
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
RX_USRCLK_SRC_Gstring := "RXOUTCLK"
out pgpRxMastersAxiStreamMasterArray( 3 downto 0)
SIMULATION_Gboolean := false
TX_OUTCLK_SRC_Gstring := "PLLREFCLK"
in pgpRxMmcmLockedsl := '1'
STABLE_CLOCK_PERIOD_Greal := 4.0E-9
in txDiffCtrlslv( 3 downto 0) := "1000"
out gtQPllResetslv( 1 downto 0)
VC_INTERLEAVE_Ginteger := 0
in axilReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
FIXED_ALIGN_COMMA_2_Gslv := "XXXXXXXXXXXXXXXXXXXX"
RXLPM_IPCM_CFG_Gbit := '0'
out pgpRxMastersAxiStreamMasterArray( 3 downto 0)
RX_BUF_EN_Gboolean := true
STABLE_CLOCK_PERIOD_Greal := 4.0E-9
PMA_RSV_Gbit_vector := x"00000333"
out pgpTxSlavesAxiStreamSlaveArray( 3 downto 0)
in txPreCursorslv( 4 downto 0) :=( others => '0')
TX_8B10B_EN_Gboolean := true
RX_INT_DATA_WIDTH_Ginteger := 20
array(natural range <> ) of Pgp2bRxPhyLaneInType Pgp2bRxPhyLaneInArray
RX_CLK25_DIV_Ginteger := 5
RX_CLK25_DIV_Ginteger := 5
out axilReadSlaveAxiLiteReadSlaveType
out drpDislv( DATA_WIDTH_G- 1 downto 0)
out pgpRxMasterMuxedAxiStreamMasterType
RX_8B10B_EN_Gboolean := true
out pgpTxOutPgp2bTxOutType