SURF  1.0
XauiGtx7.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : XauiGtx7.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2015-02-12
5 -- Last update: 2016-09-29
6 -------------------------------------------------------------------------------
7 -- Description: 10 GigE XAUI for Gtx7
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 use work.EthMacPkg.all;
26 
27 --! @see entity
28  --! @ingroup ethernet_XauiCore_gtx7
29 entity XauiGtx7 is
30  generic (
31  TPD_G : time := 1 ns;
32  -- AXI-Lite Configurations
33  EN_AXI_REG_G : boolean := false;
35  -- AXI Streaming Configurations
37  port (
38  -- Local Configurations
39  localMac : in slv(47 downto 0) := MAC_ADDR_INIT_C;
40  -- Streaming DMA Interface
41  dmaClk : in sl;
42  dmaRst : in sl;
47  -- Slave AXI-Lite Interface
48  axiLiteClk : in sl := '0';
49  axiLiteRst : in sl := '0';
54  -- Misc. Signals
55  extRst : in sl;
56  phyClk : out sl;
57  phyRst : out sl;
58  phyReady : out sl;
59  -- MGT Ports
60  gtRefClk : in sl;
61  gtTxP : out slv(3 downto 0);
62  gtTxN : out slv(3 downto 0);
63  gtRxP : in slv(3 downto 0);
64  gtRxN : in slv(3 downto 0));
65 end XauiGtx7;
66 
67 architecture mapping of XauiGtx7 is
68 
69  signal phyRxd : slv(63 downto 0);
70  signal phyRxc : slv(7 downto 0);
71  signal phyTxd : slv(63 downto 0);
72  signal phyTxc : slv(7 downto 0);
73 
74  signal areset : sl;
75  signal phyClock : sl;
76  signal phyReset : sl;
77 
78  signal config : XauiConfig;
79  signal status : XauiStatus;
80 
85 
86 begin
87 
88  phyClk <= phyClock;
89  phyRst <= phyReset;
91 
92  --------------------
93  -- Ethernet MAC core
94  --------------------
95  U_MAC : entity work.EthMacTop
96  generic map (
97  TPD_G => TPD_G,
98  PHY_TYPE_G => "XGMII",
100  port map (
101  -- Primary Interface
102  primClk => dmaClk,
103  primRst => dmaRst,
108  -- Ethernet Interface
109  ethClk => phyClock,
110  ethRst => phyReset,
111  ethConfig => config.macConfig,
112  ethStatus => status.macStatus,
113  phyReady => status.phyReady,
114  -- XGMII PHY Interface
115  xgmiiRxd => phyRxd,
116  xgmiiRxc => phyRxc,
117  xgmiiTxd => phyTxd,
118  xgmiiTxc => phyTxc);
119 
120  --------------------
121  -- 10 GigE XAUI Core
122  --------------------
123  U_XauiGtx7Core : entity work.XauiGtx7Core
124  port map (
125  -- Clocks and Resets
126  dclk => gtRefClk,
127  reset => areset,
128  clk156_out => phyClock,
129  clk156_lock => status.clkLock,
130  refclk => gtRefClk,
131  -- PHY Interface
132  xgmii_txd => phyTxd,
133  xgmii_txc => phyTxc,
134  xgmii_rxd => phyRxd,
135  xgmii_rxc => phyRxc,
136  -- MGT Ports
137  xaui_tx_l0_p => gtTxP(0),
138  xaui_tx_l0_n => gtTxN(0),
139  xaui_tx_l1_p => gtTxP(1),
140  xaui_tx_l1_n => gtTxN(1),
141  xaui_tx_l2_p => gtTxP(2),
142  xaui_tx_l2_n => gtTxN(2),
143  xaui_tx_l3_p => gtTxP(3),
144  xaui_tx_l3_n => gtTxN(3),
145  xaui_rx_l0_p => gtRxP(0),
146  xaui_rx_l0_n => gtRxN(0),
147  xaui_rx_l1_p => gtRxP(1),
148  xaui_rx_l1_n => gtRxN(1),
149  xaui_rx_l2_p => gtRxP(2),
150  xaui_rx_l2_n => gtRxN(2),
151  xaui_rx_l3_p => gtRxP(3),
152  xaui_rx_l3_n => gtRxN(3),
153  -- Configuration and Status
154  signal_detect => (others => '1'),
155  debug => status.debugVector,
156  configuration_vector => config.configVector,
157  status_vector => status.statusVector);
158 
160 
161  --------------------------
162  -- 10GBASE-R's Reset Logic
163  --------------------------
165 
166  RstSync_0 : entity work.RstSync
167  generic map (
168  TPD_G => TPD_G,
169  IN_POLARITY_G => '1',
170  OUT_POLARITY_G => '1',
171  RELEASE_DELAY_G => 4)
172  port map (
173  clk => gtRefClk,
174  asyncRst => status.areset,
175  syncRst => areset);
176 
177  RstSync_1 : entity work.RstSync
178  generic map (
179  TPD_G => TPD_G,
180  IN_POLARITY_G => '0',
181  OUT_POLARITY_G => '1',
182  RELEASE_DELAY_G => 4)
183  port map (
184  clk => gtRefClk,
185  asyncRst => status.clkLock,
186  syncRst => phyReset);
187 
188  --------------------------------
189  -- Configuration/Status Register
190  --------------------------------
191  U_XauiReg : entity work.XauiReg
192  generic map (
193  TPD_G => TPD_G,
196  port map (
197  -- Local Configurations
198  localMac => localMac,
199  -- AXI-Lite Register Interface
200  axiClk => axiLiteClk,
201  axiRst => axiLiteRst,
206  -- Configuration and Status Interface
207  phyClk => phyClock,
208  phyRst => phyReset,
209  config => config,
210  status => status);
211 
212 end mapping;
in xaui_rx_l1_nstd_logic
in resetstd_logic
out xaui_tx_l1_pstd_logic
out axiLiteWriteSlaveAxiLiteWriteSlaveType
Definition: XauiGtx7.vhd:53
in statusXauiStatus
Definition: XauiReg.vhd:48
in primClksl
Definition: EthMacTop.vhd:65
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
Definition: XauiGtx7.vhd:34
out syncRstsl
Definition: RstSync.vhd:36
in localMacslv( 47 downto 0) := MAC_ADDR_INIT_C
Definition: XauiReg.vhd:36
out xaui_tx_l0_pstd_logic
out xgmiiTxdslv( 63 downto 0)
Definition: EthMacTop.vhd:93
IN_POLARITY_Gsl := '1'
Definition: RstSync.vhd:28
in phyRstsl
Definition: XauiReg.vhd:46
out phyClksl
Definition: XauiGtx7.vhd:56
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
in axiRstsl
Definition: XauiReg.vhd:39
std_logic sl
Definition: StdRtlPkg.vhd:28
in phyClksl
Definition: XauiReg.vhd:45
out configXauiConfig
Definition: XauiReg.vhd:47
out xaui_tx_l2_pstd_logic
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
Definition: XauiReg.vhd:33
in xgmiiRxcslv( 7 downto 0) :=( others => '0')
Definition: EthMacTop.vhd:92
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
Definition: XauiGtx7.vhd:36
in axiClksl
Definition: XauiReg.vhd:38
in xaui_rx_l3_nstd_logic
in axiLiteWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
Definition: XauiGtx7.vhd:52
in ibMacPrimMasterAxiStreamMasterType
Definition: EthMacTop.vhd:67
in refclkstd_logic
XauiConfig
Definition: XauiPkg.vhd:31
AxiStreamSlaveType macTxAxisSlave
Definition: XauiGtx7.vhd:84
in axiLiteReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
Definition: XauiGtx7.vhd:50
out xgmiiTxcslv( 7 downto 0)
Definition: EthMacTop.vhd:94
out clk156_lockstd_logic
in extRstsl
Definition: XauiGtx7.vhd:55
out xaui_tx_l0_nstd_logic
in signal_detectstd_logic_vector( 3 downto 0)
in asyncRstsl
Definition: RstSync.vhd:35
in axiLiteClksl := '0'
Definition: XauiGtx7.vhd:48
in xaui_rx_l0_nstd_logic
in obMacPrimSlaveAxiStreamSlaveType
Definition: EthMacTop.vhd:70
in axiReadMasterAxiLiteReadMasterType
Definition: XauiReg.vhd:40
in dmaObMasterAxiStreamMasterType
Definition: XauiGtx7.vhd:45
in clksl
Definition: RstSync.vhd:34
in dmaIbSlaveAxiStreamSlaveType
Definition: XauiGtx7.vhd:44
OUT_POLARITY_Gsl := '1'
Definition: RstSync.vhd:29
out clk156_outstd_logic
out xaui_tx_l3_nstd_logic
TPD_Gtime := 1 ns
Definition: XauiReg.vhd:31
out axiReadSlaveAxiLiteReadSlaveType
Definition: XauiReg.vhd:41
in xgmii_txdstd_logic_vector( 63 downto 0)
out gtTxPslv( 3 downto 0)
Definition: XauiGtx7.vhd:61
out xaui_tx_l1_nstd_logic
XauiStatus status
Definition: XauiGtx7.vhd:79
in xaui_rx_l2_pstd_logic
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
Definition: AxiLitePkg.vhd:36
RELEASE_DELAY_Ginteger range 3 to positive'high:= 3
Definition: RstSync.vhd:31
out xgmii_rxcstd_logic_vector( 7 downto 0)
in gtRxPslv( 3 downto 0)
Definition: XauiGtx7.vhd:63
in primRstsl
Definition: EthMacTop.vhd:66
out obMacPrimMasterAxiStreamMasterType
Definition: EthMacTop.vhd:69
out status_vectorstd_logic_vector( 7 downto 0)
in ethRstsl
Definition: EthMacTop.vhd:63
out gtTxNslv( 3 downto 0)
Definition: XauiGtx7.vhd:62
in xgmiiRxdslv( 63 downto 0) :=( others => '0')
Definition: EthMacTop.vhd:91
out xaui_tx_l3_pstd_logic
in xaui_rx_l1_pstd_logic
slv( 63 downto 0) phyRxd
Definition: XauiGtx7.vhd:69
in gtRefClksl
Definition: XauiGtx7.vhd:60
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
in dmaRstsl
Definition: XauiGtx7.vhd:42
slv( 5 downto 0) debugVector
Definition: XauiPkg.vhd:47
slv( 7 downto 0) phyRxc
Definition: XauiGtx7.vhd:70
out ibMacPrimSlaveAxiStreamSlaveType
Definition: EthMacTop.vhd:68
TPD_Gtime := 1 ns
Definition: RstSync.vhd:27
in ethClksl
Definition: EthMacTop.vhd:62
AxiStreamCtrlType macRxAxisCtrl
Definition: XauiGtx7.vhd:82
slv( 7 downto 0) phyTxc
Definition: XauiGtx7.vhd:72
out phyRstsl
Definition: XauiGtx7.vhd:57
XauiStatus
Definition: XauiPkg.vhd:41
in dclkstd_logic
PRIM_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
Definition: EthMacTop.vhd:49
EN_AXI_REG_Gboolean := false
Definition: XauiReg.vhd:32
PHY_TYPE_Gstring := "XGMII"
Definition: EthMacTop.vhd:36
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
sl softRst
Definition: XauiPkg.vhd:32
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
in xaui_rx_l2_nstd_logic
in axiWriteMasterAxiLiteWriteMasterType
Definition: XauiReg.vhd:42
in xaui_rx_l3_pstd_logic
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 localMacslv( 47 downto 0) := MAC_ADDR_INIT_C
Definition: XauiGtx7.vhd:39
in gtRxNslv( 3 downto 0)
Definition: XauiGtx7.vhd:64
XauiConfig config
Definition: XauiGtx7.vhd:78
in configuration_vectorstd_logic_vector( 6 downto 0)
TPD_Gtime := 1 ns
Definition: EthMacTop.vhd:32
out phyReadysl
Definition: XauiGtx7.vhd:58
slv( 63 downto 0) phyTxd
Definition: XauiGtx7.vhd:71
in ethConfigEthMacConfigType
Definition: EthMacTop.vhd:104
out dmaObSlaveAxiStreamSlaveType
Definition: XauiGtx7.vhd:46
out ethStatusEthMacStatusType
Definition: EthMacTop.vhd:105
in xaui_rx_l0_pstd_logic
TPD_Gtime := 1 ns
Definition: XauiGtx7.vhd:31
in xgmii_txcstd_logic_vector( 7 downto 0)
EN_AXI_REG_Gboolean := false
Definition: XauiGtx7.vhd:33
AxiStreamMasterType macRxAxisMaster
Definition: XauiGtx7.vhd:81
out xaui_tx_l2_nstd_logic
out axiLiteReadSlaveAxiLiteReadSlaveType
Definition: XauiGtx7.vhd:51
AxiStreamMasterType macTxAxisMaster
Definition: XauiGtx7.vhd:83
out debugstd_logic_vector( 5 downto 0)
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
out xgmii_rxdstd_logic_vector( 63 downto 0)
out dmaIbMasterAxiStreamMasterType
Definition: XauiGtx7.vhd:43
in axiLiteRstsl := '0'
Definition: XauiGtx7.vhd:49
in dmaClksl
Definition: XauiGtx7.vhd:41
out axiWriteSlaveAxiLiteWriteSlaveType
Definition: XauiReg.vhd:43
in phyReadysl
Definition: EthMacTop.vhd:103