SURF  1.0
Pgp2bGtx7VarLat.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : Pgp2bGtx7VarLat.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2015-01-14
5 -- Last update: 2016-08-24
6 -------------------------------------------------------------------------------
7 -- Description: Gtx7 Variable Latency Wrapper
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 -------------------------------------------------------------------------------
17 
18 library ieee;
19 use ieee.std_logic_1164.all;
20 
21 use work.StdRtlPkg.all;
22 use work.AxiStreamPkg.all;
23 use work.Pgp2bPkg.all;
24 use work.AxiLitePkg.all;
25 
26 --! @see entity
27  --! @ingroup protocols_pgp_pgp2b_gtx7
28 entity Pgp2bGtx7VarLat is
29  generic (
30  TPD_G : time := 1 ns;
31  ----------------------------------------------------------------------------------------------
32  -- GT Settings
33  ----------------------------------------------------------------------------------------------
34  -- Sim Generics
35  SIM_GTRESET_SPEEDUP_G : string := "FALSE";
36  SIM_VERSION_G : string := "4.0";
37  STABLE_CLOCK_PERIOD_G : real := 4.0E-9; --units of seconds (default to longest timeout)
38  -- CPLL Settings
39  CPLL_REFCLK_SEL_G : bit_vector := "001";
40  CPLL_FBDIV_G : integer := 4;
41  CPLL_FBDIV_45_G : integer := 5;
42  CPLL_REFCLK_DIV_G : integer := 1;
43  RXOUT_DIV_G : integer := 2;
44  TXOUT_DIV_G : integer := 2;
45  RX_CLK25_DIV_G : integer := 7;
46  TX_CLK25_DIV_G : integer := 7;
47 
48  PMA_RSV_G : bit_vector := x"00018480";
49  RX_OS_CFG_G : bit_vector := "0000010000000"; -- Set by wizard
50  RXCDR_CFG_G : bit_vector := x"03000023ff40200020"; -- Set by wizard
51  RXDFEXYDEN_G : sl := '0'; -- Set by wizard
52 
53  -- RX Equalizer Attributes
54  RX_DFE_KL_CFG2_G : bit_vector := x"3010D90C"; -- Set by wizard
55  -- Configure PLL sources
56  TX_PLL_G : string := "QPLL";
57  RX_PLL_G : string := "CPLL";
58 
59  -- Configure Buffer usage
60  TX_BUF_EN_G : boolean := true;
61  TX_OUTCLK_SRC_G : string := "OUTCLKPMA";
62  TX_DLY_BYPASS_G : sl := '1';
63  TX_PHASE_ALIGN_G : string := "NONE";
64  TX_BUF_ADDR_MODE_G : string := "FULL";
65 
66  ----------------------------------------------------------------------------------------------
67  -- PGP Settings
68  ----------------------------------------------------------------------------------------------
69  VC_INTERLEAVE_G : integer := 0; -- No interleave Frames
70  PAYLOAD_CNT_TOP_G : integer := 7; -- Top bit for payload counter
71  NUM_VC_EN_G : integer range 1 to 4 := 4;
73  TX_ENABLE_G : boolean := true; -- Enable TX direction
74  RX_ENABLE_G : boolean := true); -- Enable RX direction
75  port (
76  -- GT Clocking
77  stableClk : in sl; -- GT needs a stable clock to "boot up"
78  gtCPllRefClk : in sl := '0'; -- Drives CPLL if used
79  gtCPllLock : out sl;
80  gtQPllRefClk : in sl := '0'; -- Signals from QPLL if used
81  gtQPllClk : in sl := '0';
82  gtQPllLock : in sl := '1';
83  gtQPllRefClkLost : in sl := '0';
84  gtQPllReset : out sl;
85  -- Gt Serial IO
86  gtTxP : out sl; -- GT Serial Transmit Positive
87  gtTxN : out sl; -- GT Serial Transmit Negative
88  gtRxP : in sl; -- GT Serial Receive Positive
89  gtRxN : in sl; -- GT Serial Receive Negative
90  -- Tx Clocking
91  pgpTxReset : in sl;
92  pgpTxClk : in sl;
93  pgpTxRecClk : out sl; -- recovered clock
95  pgpTxMmcmLocked : in sl := '1';
96  -- Rx clocking
97  pgpRxReset : in sl;
98  pgpRxRecClk : out sl; -- recovered clock
99  pgpRxClk : in sl;
101  pgpRxMmcmLocked : in sl := '1';
102  -- Non VC Rx Signals
105  -- Non VC Tx Signals
108  -- Frame Transmit Interface - Array of 4 VCs
110  pgpTxSlaves : out AxiStreamSlaveArray(3 downto 0);
111  -- Frame Receive Interface - Array of 4 VCs
114  pgpRxCtrl : in AxiStreamCtrlArray(3 downto 0);
115  -- Debug Interface
116  txPreCursor : in slv(4 downto 0) := (others => '0');
117  txPostCursor : in slv(4 downto 0) := (others => '0');
118  txDiffCtrl : in slv(3 downto 0) := "1000";
119  -- AXI-Lite Interface
120  axilClk : in sl := '0';
121  axilRst : in sl := '0';
126 end Pgp2bGtx7VarLat;
127 
128 architecture mapping of Pgp2bGtx7VarLat is
129 
130 begin
131 
132  MuliLane_Inst : entity work.Pgp2bGtx7MultiLane
133  generic map (
134  -- Sim Generics
135  TPD_G => TPD_G,
139  -- CPLL Settings
148  PMA_RSV_G => PMA_RSV_G,
152  -- RX Equalizer Attributes
154  -- Configure PLL sources
155  TX_PLL_G => TX_PLL_G,
156  RX_PLL_G => RX_PLL_G,
157  -- Configure Buffer usage
163  -- Configure Number of Lanes
164  LANE_CNT_G => 1,
165  -- PGP Settings
172  port map (
173  -- GT Clocking
174  stableClk => stableClk,
178  gtQPllClk => gtQPllClk,
182  -- Gt Serial IO
183  gtTxP(0) => gtTxP,
184  gtTxN(0) => gtTxN,
185  gtRxP(0) => gtRxP,
186  gtRxN(0) => gtRxN,
187  -- Tx Clocking
190  pgpTxClk => pgpTxClk,
193  -- Rx clocking
196  pgpRxClk => pgpRxClk,
199  -- Non VC Rx Signals
200  pgpRxIn => pgpRxIn,
201  pgpRxOut => pgpRxOut,
202  -- Non VC Tx Signals
203  pgpTxIn => pgpTxIn,
204  pgpTxOut => pgpTxOut,
205  -- Frame Transmit Interface - Array of 4 VCs
208  -- Frame Receive Interface - Array of 4 VCs
211  pgpRxCtrl => pgpRxCtrl,
212  -- Debug Interface
216  -- AXI-Lite Interface
217  axilClk => axilClk,
218  axilRst => axilRst,
219  axilReadMasters(0) => axilReadMaster,
220  axilReadSlaves(0) => axilReadSlave,
221  axilWriteMasters(0) => axilWriteMaster,
222  axilWriteSlaves(0) => axilWriteSlave);
223 
224 end mapping;
NUM_VC_EN_Ginteger range 1 to 4:= 4
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
in txDiffCtrlslv( 3 downto 0) := "1000"
out pgpRxMastersAxiStreamMasterArray( 3 downto 0)
RX_DFE_KL_CFG2_Gbit_vector := x"3010D90C"
TX_ENABLE_Gboolean := true
in txPreCursorslv( 4 downto 0) :=( others => '0')
TX_CLK25_DIV_Ginteger := 7
TX_ENABLE_Gboolean := true
out pgpTxOutPgp2bTxOutType
in gtQPllRefClkLostsl := '0'
out axilReadSlaveAxiLiteReadSlaveType
TPD_Gtime := 1 ns
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
in pgpRxMmcmLockedsl := '1'
NUM_VC_EN_Ginteger range 1 to 4:= 4
in pgpTxInPgp2bTxInType
in pgpTxMastersAxiStreamMasterArray( 3 downto 0) :=( others => AXI_STREAM_MASTER_INIT_C)
in pgpTxMmcmLockedsl := '1'
in axilRstsl := '0'
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 txPostCursorslv( 4 downto 0) :=( others => '0')
out axilWriteSlaveAxiLiteWriteSlaveType
CPLL_REFCLK_SEL_Gbit_vector := "001"
in txPostCursorslv( 4 downto 0) :=( others => '0')
in pgpTxMastersAxiStreamMasterArray( 3 downto 0) :=( others => AXI_STREAM_MASTER_INIT_C)
CPLL_REFCLK_DIV_Ginteger := 1
RXOUT_DIV_Ginteger := 2
out pgpRxMastersAxiStreamMasterArray( 3 downto 0)
CPLL_REFCLK_DIV_Ginteger := 1
RX_ENABLE_Gboolean := true
in txDiffCtrlslv( 3 downto 0) := "1000"
SIM_GTRESET_SPEEDUP_Gstring := "FALSE"
in axilClksl := '0'
RX_OS_CFG_Gbit_vector := "0000010000000"
CPLL_FBDIV_Ginteger := 4
RXCDR_CFG_Gbit_vector := x"03000023ff40200020"
LANE_CNT_Ginteger range 1 to 2:= 2
TX_BUF_EN_Gboolean := true
in gtCPllRefClksl := '0'
TX_PHASE_ALIGN_Gstring := "NONE"
RX_ENABLE_Gboolean := true
out pgpRxMasterMuxedAxiStreamMasterType
in pgpRxInPgp2bRxInType
in axilReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
CPLL_FBDIV_45_Ginteger := 5
Pgp2bRxInType
Definition: Pgp2bPkg.vhd:55
TX_OUTCLK_SRC_Gstring := "OUTCLKPMA"
slv( 1 downto 0) := "11" AXI_RESP_DECERR_C
Definition: AxiLitePkg.vhd:49
TX_BUF_EN_Gboolean := true
SIM_GTRESET_SPEEDUP_Gstring := "FALSE"
TX_OUTCLK_SRC_Gstring := "OUTCLKPMA"
TX_PHASE_ALIGN_Gstring := "NONE"
in gtQPllClksl := '0'
SIM_VERSION_Gstring := "4.0"
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
TX_PLL_Gstring := "QPLL"
TXOUT_DIV_Ginteger := 2
STABLE_CLOCK_PERIOD_Greal := 4.0E-9
SIM_VERSION_Gstring := "4.0"
in gtQPllRefClksl := '0'
in pgpRxCtrlAxiStreamCtrlArray( 3 downto 0)
array(natural range <> ) of AxiStreamCtrlType AxiStreamCtrlArray
STABLE_CLOCK_PERIOD_Greal := 6.4E-9
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
out pgpRxMasterMuxedAxiStreamMasterType
out pgpTxOutPgp2bTxOutType
PMA_RSV_Gbit_vector := x"00018480"
in gtQPllLocksl := '1'
RX_DFE_KL_CFG2_Gbit_vector := x"3010D90C"
AxiLiteReadMasterType :=(araddr =>( others => '0'),arprot =>( others => '0'),arvalid => '0',rready => '1') AXI_LITE_READ_MASTER_INIT_C
Definition: AxiLitePkg.vhd:69
RX_OS_CFG_Gbit_vector := "0000010000000"
RX_PLL_Gstring := "CPLL"
RX_PLL_Gstring := "CPLL"
in pgpRxInPgp2bRxInType
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
in axilWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
in txPreCursorslv( 4 downto 0) :=( others => '0')
TX_PLL_Gstring := "QPLL"
RXCDR_CFG_Gbit_vector := x"03000023ff40200020"
PAYLOAD_CNT_TOP_Ginteger := 7
PMA_RSV_Gbit_vector := x"00018480"
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
Definition: AxiLitePkg.vhd:125
out pgpRxOutPgp2bRxOutType
RX_CLK25_DIV_Ginteger := 7
in pgpRxCtrlAxiStreamCtrlArray( 3 downto 0)
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
TX_BUF_ADDR_MODE_Gstring := "FULL"
PAYLOAD_CNT_TOP_Ginteger := 7
VC_INTERLEAVE_Ginteger := 0
Pgp2bTxOutType
Definition: Pgp2bPkg.vhd:135
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
out pgpTxSlavesAxiStreamSlaveArray( 3 downto 0)
CPLL_REFCLK_SEL_Gbit_vector := "001"
TX_DLY_BYPASS_Gsl := '1'
in pgpTxInPgp2bTxInType
out pgpTxSlavesAxiStreamSlaveArray( 3 downto 0)
Pgp2bRxOutType
Definition: Pgp2bPkg.vhd:69
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
TX_BUF_ADDR_MODE_Gstring := "FULL"
out pgpRxOutPgp2bRxOutType