SURF  1.0
Pgp2bLane.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : Pgp2bLane.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2009-05-27
5 -- Last update: 2017-03-28
6 -------------------------------------------------------------------------------
7 -- Description:
8 -- Top Level Transmit/Receive interface module for the Pretty Good Protocol core.
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 -------------------------------------------------------------------------------
18 
19 LIBRARY ieee;
20 use ieee.std_logic_1164.all;
21 use ieee.std_logic_arith.all;
22 use ieee.std_logic_unsigned.all;
23 
24 use work.StdRtlPkg.all;
25 use work.Pgp2bPkg.all;
26 use work.AxiStreamPkg.all;
27 use work.SsiPkg.all;
28 
29 --! @see entity
30  --! @ingroup protocols_pgp_pgp2b_core
31 entity Pgp2bLane is
32  generic (
33  TPD_G : time := 1 ns;
34  LANE_CNT_G : integer range 1 to 2 := 1; -- Number of lanes, 1-2
35  VC_INTERLEAVE_G : integer := 1; -- Interleave Frames
36  PAYLOAD_CNT_TOP_G : integer := 7; -- Top bit for payload counter
37  NUM_VC_EN_G : integer range 1 to 4 := 4;
38  TX_ENABLE_G : boolean := true; -- Enable TX direction
39  RX_ENABLE_G : boolean := true -- Enable RX direction
40  );
41  port (
42 
43  ---------------------------------
44  -- Transmitter Interface
45  ---------------------------------
46 
47  -- System clock, reset & control
48  pgpTxClkEn : in sl := '1';
49  pgpTxClk : in sl := '0';
50  pgpTxClkRst : in sl := '0';
51 
52  -- Non-VC related IO
55 
56  -- VC Interface
58  pgpTxSlaves : out AxiStreamSlaveArray(3 downto 0);
59 
60  -- Phy interface
62  phyTxReady : in sl := '0';
63 
64  ---------------------------------
65  -- Receiver Interface
66  ---------------------------------
67 
68  -- System clock, reset & control
69  pgpRxClkEn : in sl := '1';
70  pgpRxClk : in sl := '0';
71  pgpRxClkRst : in sl := '0';
72 
73  -- Non-VC related IO
76 
77  -- VC Outputs
80 
81  -- Receive flow control
82  pgpRxCtrl : in AxiStreamCtrlArray(3 downto 0) := (others=>AXI_STREAM_CTRL_UNUSED_C);
83 
84  -- PHY interface
87  phyRxReady : in sl := '0';
88  phyRxInit : out sl
89  );
90 
91 end Pgp2bLane;
92 
93 
94 -- Define architecture
95 architecture Pgp2bLane of Pgp2bLane is
96 
97  -- Local Signals
99  signal remFifoStatus : AxiStreamCtrlArray(3 downto 0);
101 
102 begin
103 
104  -----------------------------
105  -- Transmit
106  -----------------------------
107 
108  U_TxEnGen: if TX_ENABLE_G = true generate
109 
110  -- Transmit
111  U_Pgp2bTx: entity work.Pgp2bTx
112  generic map (
113  TPD_G => TPD_G,
118  ) port map (
120  pgpTxClk => pgpTxClk,
122  pgpTxIn => pgpTxIn,
123  pgpTxOut => pgpTxOut,
124  locLinkReady => intRxOut.linkReady,
131  );
132  end generate;
133 
134  U_TxDisGen: if TX_ENABLE_G = false generate
138  end generate;
139 
140 
141  -----------------------------
142  -- Receive
143  -----------------------------
144 
145  U_RxEnGen: if RX_ENABLE_G = true generate
146 
147  -- Receive
148  U_Pgp2bRx: entity work.Pgp2bRx
149  generic map (
150  TPD_G => TPD_G,
153  ) port map (
155  pgpRxClk => pgpRxClk,
157  pgpRxIn => pgpRxIn,
158  pgpRxOut => intRxOut,
165  );
166 
167  -- Demux
168  U_RxDeMux : entity work.AxiStreamDeMux
169  generic map (
170  TPD_G => TPD_G,
171  NUM_MASTERS_G => 4
172  ) port map (
173  axisClk => pgpRxClk,
174  axisRst => pgpRxClkRst,
176  sAxisSlave => open,
179  );
180 
181  end generate;
182 
183  U_RxDisGen: if RX_ENABLE_G = false generate
188  phyRxInit <= '0';
190  end generate;
191 
192  -- De-Muxed Version
194  pgpRxOut <= intRxOut;
195 
196 end Pgp2bLane;
197 
in pgpRxClkRstsl := '0'
Definition: Pgp2bLane.vhd:71
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
TX_ENABLE_Gboolean := true
Definition: Pgp2bLane.vhd:38
Pgp2bTxOutType :=(( others => '0'),( others => '0'), '0', '0', '0', '0') PGP2B_TX_OUT_INIT_C
Definition: Pgp2bPkg.vhd:146
out phyTxLanesOutPgp2bTxPhyLaneOutArray( 0 to TX_LANE_CNT_G- 1)
Definition: Pgp2bTx.vhd:57
in pgpTxClkEnsl := '1'
Definition: Pgp2bTx.vhd:41
AxiStreamMasterType intRxMaster
Definition: Pgp2bLane.vhd:98
in pgpTxClksl
Definition: Pgp2bTx.vhd:42
out pgpTxSlavesAxiStreamSlaveArray( 3 downto 0)
Definition: Pgp2bLane.vhd:58
std_logic sl
Definition: StdRtlPkg.vhd:28
in pgpTxClkEnsl := '1'
Definition: Pgp2bLane.vhd:48
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
NUM_VC_EN_Ginteger range 1 to 4:= 4
Definition: Pgp2bTx.vhd:37
TX_LANE_CNT_Ginteger range 1 to 2:= 1
Definition: Pgp2bTx.vhd:33
out mAxisMastersAxiStreamMasterArray( NUM_MASTERS_G- 1 downto 0)
PAYLOAD_CNT_TOP_Ginteger := 7
Definition: Pgp2bRx.vhd:35
in pgpRxInPgp2bRxInType := PGP2B_RX_IN_INIT_C
Definition: Pgp2bLane.vhd:74
Pgp2bRxInType :=( '0', '0', "000") PGP2B_RX_IN_INIT_C
Definition: Pgp2bPkg.vhd:63
VC_INTERLEAVE_Ginteger := 1
Definition: Pgp2bLane.vhd:35
out phyRxInitsl
Definition: Pgp2bLane.vhd:89
in phyRxLanesInPgp2bRxPhyLaneInArray( 0 to RX_LANE_CNT_G- 1)
Definition: Pgp2bRx.vhd:53
out pgpRxOutPgp2bRxOutType
Definition: Pgp2bRx.vhd:45
in pgpRxClkEnsl := '1'
Definition: Pgp2bRx.vhd:39
RX_ENABLE_Gboolean := true
Definition: Pgp2bLane.vhd:40
PAYLOAD_CNT_TOP_Ginteger := 7
Definition: Pgp2bTx.vhd:35
in pgpTxInPgp2bTxInType
Definition: Pgp2bTx.vhd:46
array(natural range <> ) of Pgp2bTxPhyLaneOutType Pgp2bTxPhyLaneOutArray
Definition: Pgp2bPkg.vhd:192
out pgpRxOutPgp2bRxOutType
Definition: Pgp2bLane.vhd:75
TPD_Gtime := 1 ns
Definition: Pgp2bLane.vhd:33
in pgpTxMastersAxiStreamMasterArray( 3 downto 0) :=( others => AXI_STREAM_MASTER_INIT_C)
Definition: Pgp2bLane.vhd:57
out sAxisSlaveAxiStreamSlaveType
in phyRxReadysl := '0'
Definition: Pgp2bLane.vhd:87
NUM_VC_EN_Ginteger range 1 to 4:= 4
Definition: Pgp2bLane.vhd:37
in phyRxReadysl
Definition: Pgp2bRx.vhd:54
out pgpRxMasterAxiStreamMasterType
Definition: Pgp2bRx.vhd:48
Pgp2bRxInType
Definition: Pgp2bPkg.vhd:55
in remFifoStatusAxiStreamCtrlArray( 3 downto 0)
Definition: Pgp2bTx.vhd:54
PAYLOAD_CNT_TOP_Ginteger := 7
Definition: Pgp2bLane.vhd:36
VC_INTERLEAVE_Ginteger := 1
Definition: Pgp2bTx.vhd:34
in locFifoStatusAxiStreamCtrlArray( 3 downto 0)
Definition: Pgp2bTx.vhd:53
out phyRxLanesOutPgp2bRxPhyLaneOutArray( 0 to LANE_CNT_G- 1)
Definition: Pgp2bLane.vhd:85
AxiStreamSlaveType :=(tReady => '0') AXI_STREAM_SLAVE_INIT_C
Pgp2bTxInType :=( '0', '0',( others => '0'),( others => '0'), '0') PGP2B_TX_IN_INIT_C
Definition: Pgp2bPkg.vhd:119
in pgpTxClkRstsl := '0'
Definition: Pgp2bLane.vhd:50
in pgpRxCtrlAxiStreamCtrlArray( 3 downto 0) :=( others => AXI_STREAM_CTRL_UNUSED_C)
Definition: Pgp2bLane.vhd:82
Pgp2bRxOutType intRxOut
Definition: Pgp2bLane.vhd:100
TPD_Gtime := 1 ns
in sAxisMasterAxiStreamMasterType
in pgpRxInPgp2bRxInType
Definition: Pgp2bRx.vhd:44
array(natural range <> ) of AxiStreamCtrlType AxiStreamCtrlArray
RX_LANE_CNT_Ginteger range 1 to 2:= 1
Definition: Pgp2bRx.vhd:33
in pgpRxClksl := '0'
Definition: Pgp2bLane.vhd:70
array(natural range <> ) of Pgp2bRxPhyLaneOutType Pgp2bRxPhyLaneOutArray
Definition: Pgp2bPkg.vhd:163
Pgp2bRxPhyLaneInType :=(( others => '0'),( others => '0'),( others => '0'),( others => '0')) PGP2B_RX_PHY_LANE_IN_INIT_C
Definition: Pgp2bPkg.vhd:176
out pgpTxOutPgp2bTxOutType
Definition: Pgp2bLane.vhd:54
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
in phyRxLanesInPgp2bRxPhyLaneInArray( 0 to LANE_CNT_G- 1) :=( others => PGP2B_RX_PHY_LANE_IN_INIT_C)
Definition: Pgp2bLane.vhd:86
out remFifoStatusAxiStreamCtrlArray( 3 downto 0)
Definition: Pgp2bRx.vhd:49
out phyTxLanesOutPgp2bTxPhyLaneOutArray( 0 to LANE_CNT_G- 1)
Definition: Pgp2bLane.vhd:61
in pgpRxClkRstsl
Definition: Pgp2bRx.vhd:41
in pgpTxClksl := '0'
Definition: Pgp2bLane.vhd:49
LANE_CNT_Ginteger range 1 to 2:= 1
Definition: Pgp2bLane.vhd:34
out pgpTxSlavesAxiStreamSlaveArray( 3 downto 0)
Definition: Pgp2bTx.vhd:52
AxiStreamCtrlType :=(pause => '0',overflow => '0',idle => '1') AXI_STREAM_CTRL_UNUSED_C
in pgpTxClkRstsl
Definition: Pgp2bTx.vhd:43
_library_ ieeeieee
Definition: Pgp2bAxi.vhd:100
in mAxisSlavesAxiStreamSlaveArray( NUM_MASTERS_G- 1 downto 0)
in pgpTxInPgp2bTxInType := PGP2B_TX_IN_INIT_C
Definition: Pgp2bLane.vhd:53
Pgp2bRxPhyLaneOutType :=(polarity => '0') PGP2B_RX_PHY_LANE_OUT_INIT_C
Definition: Pgp2bPkg.vhd:165
Pgp2bRxOutType :=( '0', '0', "00", '0', '0', '0', '0', '0', '0',( others => '0'), '0',( others => '0'),( others => '0'),( others => '0')) PGP2B_RX_OUT_INIT_C
Definition: Pgp2bPkg.vhd:88
out phyRxInitsl
Definition: Pgp2bRx.vhd:56
out pgpRxMastersAxiStreamMasterArray( 3 downto 0)
Definition: Pgp2bLane.vhd:78
AxiStreamSlaveType :=(tReady => '1') AXI_STREAM_SLAVE_FORCE_C
in phyTxReadysl
Definition: Pgp2bTx.vhd:59
TPD_Gtime := 1 ns
Definition: Pgp2bRx.vhd:32
Pgp2bTxOutType
Definition: Pgp2bPkg.vhd:135
Pgp2bTxPhyLaneOutType :=(( others => '0'),( others => '0')) PGP2B_TX_PHY_LANE_OUT_INIT_C
Definition: Pgp2bPkg.vhd:194
AxiStreamCtrlArray( 3 downto 0) remFifoStatus
Definition: Pgp2bLane.vhd:99
in pgpRxClkEnsl := '1'
Definition: Pgp2bLane.vhd:69
in pgpRxClksl
Definition: Pgp2bRx.vhd:40
in phyTxReadysl := '0'
Definition: Pgp2bLane.vhd:62
TPD_Gtime := 1 ns
Definition: Pgp2bTx.vhd:32
array(natural range <> ) of Pgp2bRxPhyLaneInType Pgp2bRxPhyLaneInArray
Definition: Pgp2bPkg.vhd:174
out pgpTxOutPgp2bTxOutType
Definition: Pgp2bTx.vhd:47
NUM_MASTERS_Ginteger range 1 to 32:= 12
Pgp2bRxOutType
Definition: Pgp2bPkg.vhd:69
in pgpTxMastersAxiStreamMasterArray( 3 downto 0)
Definition: Pgp2bTx.vhd:51
out phyRxLanesOutPgp2bRxPhyLaneOutArray( 0 to RX_LANE_CNT_G- 1)
Definition: Pgp2bRx.vhd:52
in locLinkReadysl
Definition: Pgp2bTx.vhd:48
out pgpRxMasterMuxedAxiStreamMasterType
Definition: Pgp2bLane.vhd:79