SURF  1.0
Pgp2bGtp7VarLat.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : Pgp2bGtp7VarLat.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2013-06-29
5 -- Last update: 2016-08-24
6 -------------------------------------------------------------------------------
7 -- Description: Gtp7 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.Pgp2bPkg.all;
23 use work.AxiStreamPkg.all;
24 use work.AxiLitePkg.all;
25 
26 --! @see entity
27  --! @ingroup protocols_pgp_pgp2b_gtp7
28 entity Pgp2bGtp7VarLat 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 := "1.0";
37  STABLE_CLOCK_PERIOD_G : real := 4.0E-9; --units of seconds
38  -- Configure PLL
39  RXOUT_DIV_G : integer := 2;
40  TXOUT_DIV_G : integer := 2;
41  RX_CLK25_DIV_G : integer := 7; -- Set by wizard
42  TX_CLK25_DIV_G : integer := 7; -- Set by wizard
43  PMA_RSV_G : bit_vector := x"00000333"; -- Set by wizard
44  RX_OS_CFG_G : bit_vector := "0001111110000"; -- Set by wizard
45  RXCDR_CFG_G : bit_vector := x"0000107FE206001041010"; -- Set by wizard
46  RXLPM_INCM_CFG_G : bit := '1'; -- Set by wizard
47  RXLPM_IPCM_CFG_G : bit := '0'; -- Set by wizard
48  TX_PLL_G : string := "PLL0";
49  RX_PLL_G : string := "PLL1";
50  -- Configure Buffer usage
51  TX_BUF_EN_G : boolean := true;
52  TX_OUTCLK_SRC_G : string := "OUTCLKPMA";
53  TX_DLY_BYPASS_G : sl := '1';
54  TX_PHASE_ALIGN_G : string := "NONE";
55  TX_BUF_ADDR_MODE_G : string := "FULL";
56  ----------------------------------------------------------------------------------------------
57  -- PGP Settings
58  ----------------------------------------------------------------------------------------------
59  VC_INTERLEAVE_G : integer := 0; -- No interleave Frames
60  PAYLOAD_CNT_TOP_G : integer := 7; -- Top bit for payload counter
61  NUM_VC_EN_G : integer range 1 to 4 := 4;
63  TX_ENABLE_G : boolean := true; -- Enable TX direction
64  RX_ENABLE_G : boolean := true); -- Enable RX direction
65  port (
66  -- GT Clocking
67  stableClk : in sl; -- GT needs a stable clock to "boot up"
68  gtQPllOutRefClk : in slv(1 downto 0);
69  gtQPllOutClk : in slv(1 downto 0);
70  gtQPllLock : in slv(1 downto 0);
71  gtQPllRefClkLost : in slv(1 downto 0);
72  gtQPllReset : out slv(1 downto 0);
73  -- Gt Serial IO
74  gtTxP : out sl; -- GT Serial Transmit Positive
75  gtTxN : out sl; -- GT Serial Transmit Negative
76  gtRxP : in sl; -- GT Serial Receive Positive
77  gtRxN : in sl; -- GT Serial Receive Negative
78  -- Tx Clocking
79  pgpTxReset : in sl;
80  pgpTxRecClk : out sl; -- recovered clock
81  pgpTxClk : in sl;
83  pgpTxMmcmLocked : in sl := '1';
84  -- Rx clocking
85  pgpRxReset : in sl;
86  pgpRxRecClk : out sl; -- recovered clock
87  pgpRxClk : in sl;
89  pgpRxMmcmLocked : in sl := '1';
90  -- Non VC Rx Signals
93  -- Non VC Tx Signals
96  -- Frame Transmit Interface - Array of 4 VCs
98  pgpTxSlaves : out AxiStreamSlaveArray(3 downto 0);
99  -- Frame Receive Interface - Array of 4 VCs
102  pgpRxCtrl : in AxiStreamCtrlArray(3 downto 0);
103  -- Debug Interface
104  txPreCursor : in slv(4 downto 0) := (others => '0');
105  txPostCursor : in slv(4 downto 0) := (others => '0');
106  txDiffCtrl : in slv(3 downto 0) := "1000";
107  -- AXI-Lite Interface
108  axilClk : in sl := '0';
109  axilRst : in sl := '0';
114 end Pgp2bGtp7VarLat;
115 
116 architecture mapping of Pgp2bGtp7VarLat is
117 
118 begin
119 
120  MuliLane_Inst : entity work.Pgp2bGtp7MultiLane
121  generic map (
122  TPD_G => TPD_G,
123  -- SIM Generics
127  -- Configure PLL
132  PMA_RSV_G => PMA_RSV_G,
137  TX_PLL_G => TX_PLL_G,
138  RX_PLL_G => RX_PLL_G,
139  -- Configure Buffer usage
145  -- PGP Settings
152  port map (
153  -- GT Clocking
154  stableClk => stableClk,
160  -- Gt Serial IO
161  gtTxP(0) => gtTxP,
162  gtTxN(0) => gtTxN,
163  gtRxP(0) => gtRxP,
164  gtRxN(0) => gtRxN,
165  -- Tx Clocking
168  pgpTxClk => pgpTxClk,
171  -- Rx clocking
174  pgpRxClk => pgpRxClk,
177  -- Non VC Rx Signals
178  pgpRxIn => pgpRxIn,
179  pgpRxOut => pgpRxOut,
180  -- Non VC Tx Signals
181  pgpTxIn => pgpTxIn,
182  pgpTxOut => pgpTxOut,
183  -- Frame Transmit Interface - Array of 4 VCs
186  -- Frame Receive Interface - Array of 4 VCs
189  pgpRxCtrl => pgpRxCtrl,
190  -- Debug Interface
194  -- AXI-Lite Interface
195  axilClk => axilClk,
196  axilRst => axilRst,
197  axilReadMasters(0) => axilReadMaster,
198  axilReadSlaves(0) => axilReadSlave,
199  axilWriteMasters(0) => axilWriteMaster,
200  axilWriteSlaves(0) => axilWriteSlave);
201 
202 end mapping;
NUM_VC_EN_Ginteger range 1 to 4:= 4
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
PMA_RSV_Gbit_vector := x"00000333"
out pgpRxMastersAxiStreamMasterArray( 3 downto 0)
in txPreCursorslv( 4 downto 0) :=( others => '0')
RXCDR_CFG_Gbit_vector := x"0000107FE206001041010"
TX_PLL_Gstring := "PLL0"
TX_ENABLE_Gboolean := true
SIM_GTRESET_SPEEDUP_Gstring := "FALSE"
PMA_RSV_Gbit_vector := x"00000333"
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
in txPreCursorslv( 4 downto 0) :=( others => '0')
in pgpTxMastersAxiStreamMasterArray( 3 downto 0) :=( others => AXI_STREAM_MASTER_INIT_C)
STABLE_CLOCK_PERIOD_Greal := 4.0E-9
RX_CLK25_DIV_Ginteger := 7
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
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
STABLE_CLOCK_PERIOD_Greal := 4.0E-9
in pgpRxCtrlAxiStreamCtrlArray( 3 downto 0)
in txPostCursorslv( 4 downto 0) :=( others => '0')
RXCDR_CFG_Gbit_vector := x"0000107FE206001041010"
in txDiffCtrlslv( 3 downto 0) := "1000"
out pgpTxSlavesAxiStreamSlaveArray( 3 downto 0)
TX_DLY_BYPASS_Gsl := '1'
RX_OS_CFG_Gbit_vector := "0001111110000"
in gtQPllOutRefClkslv( 1 downto 0)
SIM_GTRESET_SPEEDUP_Gstring := "FALSE"
RX_OS_CFG_Gbit_vector := "0001111110000"
in pgpRxInPgp2bRxInType
TX_BUF_EN_Gboolean := true
in gtQPllOutClkslv( 1 downto 0)
in axilWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
in gtQPllLockslv( 1 downto 0)
PAYLOAD_CNT_TOP_Ginteger := 7
TX_PHASE_ALIGN_Gstring := "NONE"
RX_ENABLE_Gboolean := true
in gtQPllRefClkLostslv( 1 downto 0)
VC_INTERLEAVE_Ginteger := 0
in pgpRxInPgp2bRxInType
in txDiffCtrlslv( 3 downto 0) := "1000"
TX_ENABLE_Gboolean := true
Pgp2bRxInType
Definition: Pgp2bPkg.vhd:55
RX_PLL_Gstring := "PLL1"
slv( 1 downto 0) := "11" AXI_RESP_DECERR_C
Definition: AxiLitePkg.vhd:49
TX_CLK25_DIV_Ginteger := 7
out gtQPllResetslv( 1 downto 0)
out pgpTxOutPgp2bTxOutType
TX_OUTCLK_SRC_Gstring := "OUTCLKPMA"
in gtQPllOutClkslv( 1 downto 0)
out axilReadSlaveAxiLiteReadSlaveType
in pgpRxMmcmLockedsl := '1'
in pgpTxInPgp2bTxInType
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
in axilRstsl := '0'
RXLPM_INCM_CFG_Gbit := '1'
in txPostCursorslv( 4 downto 0) :=( others => '0')
TX_BUF_ADDR_MODE_Gstring := "FULL"
out gtQPllResetslv( 1 downto 0)
SIM_VERSION_Gstring := "1.0"
out pgpRxOutPgp2bRxOutType
in pgpTxMastersAxiStreamMasterArray( 3 downto 0) :=( others => AXI_STREAM_MASTER_INIT_C)
array(natural range <> ) of AxiStreamCtrlType AxiStreamCtrlArray
RXOUT_DIV_Ginteger := 2
out pgpRxMastersAxiStreamMasterArray( 3 downto 0)
RX_PLL_Gstring := "PLL1"
RX_ENABLE_Gboolean := true
out pgpTxOutPgp2bTxOutType
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
out pgpRxMasterMuxedAxiStreamMasterType
in axilClksl := '0'
AxiLiteReadMasterType :=(araddr =>( others => '0'),arprot =>( others => '0'),arvalid => '0',rready => '1') AXI_LITE_READ_MASTER_INIT_C
Definition: AxiLitePkg.vhd:69
in gtQPllLockslv( 1 downto 0)
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
TPD_Gtime := 1 ns
NUM_VC_EN_Ginteger range 1 to 4:= 4
in pgpRxCtrlAxiStreamCtrlArray( 3 downto 0)
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
in pgpTxMmcmLockedsl := '1'
TX_BUF_ADDR_MODE_Gstring := "FULL"
TX_PLL_Gstring := "PLL0"
out pgpRxOutPgp2bRxOutType
PAYLOAD_CNT_TOP_Ginteger := 7
out axilWriteSlaveAxiLiteWriteSlaveType
out pgpRxMasterMuxedAxiStreamMasterType
Pgp2bTxOutType
Definition: Pgp2bPkg.vhd:135
in gtQPllRefClkLostslv( 1 downto 0)
in axilReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
SIM_VERSION_Gstring := "1.0"
RXLPM_IPCM_CFG_Gbit := '0'
TX_OUTCLK_SRC_Gstring := "OUTCLKPMA"
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
TX_BUF_EN_Gboolean := true
in pgpTxInPgp2bTxInType
out pgpTxSlavesAxiStreamSlaveArray( 3 downto 0)
TX_PHASE_ALIGN_Gstring := "NONE"
Pgp2bRxOutType
Definition: Pgp2bPkg.vhd:69
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
TXOUT_DIV_Ginteger := 2
in gtQPllOutRefClkslv( 1 downto 0)