SURF  1.0
XauiGthUltraScaleWrapper.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : XauiGthUltraScaleWrapper.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2015-04-08
5 -- Last update: 2016-09-29
6 -------------------------------------------------------------------------------
7 -- Description: GTH Ultra Scale Wrapper for 10 GigE XAUI
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.AxiLitePkg.all;
24 use work.XauiPkg.all;
25 
26 library unisim;
27 use unisim.vcomponents.all;
28 
29 --! @see entity
30  --! @ingroup ethernet_XauiCore_gthUltraScale
32  generic (
33  TPD_G : time := 1 ns;
34  EN_WDT_G : boolean := false;
35  STABLE_CLK_FREQ_G : real := 156.25E+6; -- Support 125MHz, 156.25MHz, or 312.5MHz
36  -- XAUI Configurations
37  XAUI_20GIGE_G : boolean := false;
38  REF_CLK_FREQ_G : real := 156.25E+6; -- Support 125MHz, 156.25MHz, or 312.5MHz
39  -- AXI-Lite Configurations
40  EN_AXI_REG_G : boolean := false;
42  -- AXI Streaming Configurations
44  port (
45  -- Local Configurations
46  localMac : in slv(47 downto 0) := MAC_ADDR_INIT_C;
47  -- Streaming DMA Interface
48  dmaClk : in sl;
49  dmaRst : in sl;
54  -- Slave AXI-Lite Interface
55  axiLiteClk : in sl := '0';
56  axiLiteRst : in sl := '0';
61  -- Misc. Signals
62  extRst : in sl := '0';
63  stableClk : in sl := '0';
64  phyClk : out sl;
65  phyRst : out sl;
66  phyReady : out sl;
67  -- Transceiver Debug Interface
68  gtTxPreCursor : in slv(19 downto 0) := (others => '0');
69  gtTxPostCursor : in slv(19 downto 0) := (others => '0');
70  gtTxDiffCtrl : in slv(15 downto 0) := x"CCCC";
71  gtRxPolarity : in slv(3 downto 0) := x"0";
72  gtTxPolarity : in slv(3 downto 0) := x"0";
73  -- MGT Clock Port (125MHz, 156.25MHz, or 312.5MHz)
74  gtClkP : in sl;
75  gtClkN : in sl;
76  -- MGT Ports
77  gtTxP : out slv(3 downto 0);
78  gtTxN : out slv(3 downto 0);
79  gtRxP : in slv(3 downto 0);
80  gtRxN : in slv(3 downto 0));
81 end XauiGthUltraScaleWrapper;
82 
83 architecture mapping of XauiGthUltraScaleWrapper is
84 
85  signal refClk : sl;
86  signal linkUp : sl;
87  signal wdtRst : sl;
88  signal wdtReset : sl;
89  signal extReset : sl;
90 
91 begin
92 
93  phyReady <= linkUp;
94 
95  IBUFDS_GTE3_Inst : IBUFDS_GTE3
96  port map (
97  I => gtClkP,
98  IB => gtClkN,
99  CEB => '0',
100  ODIV2 => open,
101  O => refClk);
102 
103  GEN_WDT : if (EN_WDT_G = true) generate
104 
105  -----------------------
106  -- 10 Second LinkUp WDT
107  -----------------------
108  U_Rst : entity work.PwrUpRst
109  generic map(
110  TPD_G => TPD_G,
111  DURATION_G => getTimeRatio(STABLE_CLK_FREQ_G, 1.0)) -- 1 s reset
112  port map (
113  arst => wdtReset,
114  clk => stableClk,
115  rstOut => extReset);
116 
117  U_WTD : entity work.WatchDogRst
118  generic map(
119  TPD_G => TPD_G,
120  DURATION_G => getTimeRatio(STABLE_CLK_FREQ_G, 0.1)) -- 10 s timeout
121  port map (
122  clk => stableClk,
123  monIn => linkUp,
124  rstOut => wdtRst);
125 
126  wdtReset <= wdtRst or extRst;
127 
128  end generate;
129 
130  BYPASS_WDT : if (EN_WDT_G = false) generate
131 
132  extReset <= extRst;
133 
134  end generate;
135 
136  ----------------------
137  -- 10 GigE XAUI Module
138  ----------------------
139  XauiGthUltraScale_Inst : entity work.XauiGthUltraScale
140  generic map (
141  TPD_G => TPD_G,
142  -- XAUI Configurations
145  -- AXI-Lite Configurations
148  -- AXI Streaming Configurations
150  port map (
151  -- Local Configurations
152  localMac => localMac,
153  -- Clocks and resets
154  dmaClk => dmaClk,
155  dmaRst => dmaRst,
160  -- Slave AXI-Lite Interface
167  -- Misc. Signals
168  extRst => extReset,
169  phyClk => phyClk,
170  phyRst => phyRst,
171  phyReady => linkUp,
172  -- Transceiver Debug Interface
178  -- MGT Ports
179  refClk => refClk,
180  gtTxP => gtTxP,
181  gtTxN => gtTxN,
182  gtRxP => gtRxP,
183  gtRxN => gtRxN);
184 
185 end mapping;
out axiLiteReadSlaveAxiLiteReadSlaveType
in gtTxPostCursorslv( 19 downto 0) :=( others => '0')
out rstOutsl
Definition: WatchDogRst.vhd:37
out gtTxNslv( 3 downto 0)
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
out rstOutsl
Definition: PwrUpRst.vhd:39
TPD_Gtime := 1 ns
Definition: WatchDogRst.vhd:29
TPD_Gtime := 1 ns
Definition: PwrUpRst.vhd:30
out axiLiteReadSlaveAxiLiteReadSlaveType
in dmaIbSlaveAxiStreamSlaveType
in gtTxPolarityslv( 3 downto 0) := x"0"
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
out dmaIbMasterAxiStreamMasterType
out axiLiteWriteSlaveAxiLiteWriteSlaveType
DURATION_Gnatural range 0 to (( 2** 31)- 1):= 156250000
Definition: WatchDogRst.vhd:33
in dmaObMasterAxiStreamMasterType
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
in gtRxPslv( 3 downto 0)
_library_ unisimunisim
in gtTxPolarityslv( 3 downto 0) := x"0"
REF_CLK_FREQ_Greal := 156.25E+6
in axiLiteReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
out gtTxPslv( 3 downto 0)
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
EN_AXI_REG_Gboolean := false
out dmaObSlaveAxiStreamSlaveType
in arstsl :=not IN_POLARITY_G
Definition: PwrUpRst.vhd:37
in axiLiteWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
in gtTxPostCursorslv( 19 downto 0) :=( others => '0')
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
Definition: AxiLitePkg.vhd:36
in gtRxPolarityslv( 3 downto 0) := x"0"
in gtTxDiffCtrlslv( 15 downto 0) := x"CCCC"
out dmaObSlaveAxiStreamSlaveType
in gtTxDiffCtrlslv( 15 downto 0) := x"CCCC"
out dmaIbMasterAxiStreamMasterType
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
in gtRxPolarityslv( 3 downto 0) := x"0"
in clksl
Definition: PwrUpRst.vhd:38
DURATION_Gnatural range 0 to (( 2** 30)- 1):= 156250000
Definition: PwrUpRst.vhd:35
in localMacslv( 47 downto 0) := MAC_ADDR_INIT_C
in gtTxPreCursorslv( 19 downto 0) :=( others => '0')
in gtTxPreCursorslv( 19 downto 0) :=( others => '0')
in localMacslv( 47 downto 0) := MAC_ADDR_INIT_C
AxiLiteReadMasterType :=(araddr =>( others => '0'),arprot =>( others => '0'),arvalid => '0',rready => '1') AXI_LITE_READ_MASTER_INIT_C
Definition: AxiLitePkg.vhd:69
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
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
in gtRxNslv( 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
out axiLiteWriteSlaveAxiLiteWriteSlaveType
in axiLiteWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
in dmaObMasterAxiStreamMasterType
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
in dmaIbSlaveAxiStreamSlaveType
in axiLiteReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
XAUI_20GIGE_Gboolean := false
std_logic_vector slv
Definition: StdRtlPkg.vhd:29