SURF  1.0
TenGigEthGth7.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : TenGigEthGth7.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2015-02-12
5 -- Last update: 2016-09-29
6 -------------------------------------------------------------------------------
7 -- Description: 10GBASE-R Ethernet for Gth7
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.TenGigEthPkg.all;
25 use work.EthMacPkg.all;
26 
27 --! @see entity
28  --! @ingroup ethernet_TenGigEthCore_gth7
29 entity TenGigEthGth7 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  -- SFP+ Ports
55  sigDet : in sl := '1';
56  txFault : in sl := '0';
57  txDisable : out sl;
58  -- Misc. Signals
59  extRst : in sl;
60  phyClk : in sl;
61  phyRst : in sl;
62  phyReady : out sl;
63  -- Quad PLL Ports
64  qplllock : in sl;
65  qplloutclk : in sl;
67  qpllRst : out sl;
68  -- MGT Ports
69  gtTxP : out sl;
70  gtTxN : out sl;
71  gtRxP : in sl;
72  gtRxN : in sl);
73 end TenGigEthGth7;
74 
75 architecture mapping of TenGigEthGth7 is
76 
81 
82  signal phyRxd : slv(63 downto 0);
83  signal phyRxc : slv(7 downto 0);
84  signal phyTxd : slv(63 downto 0);
85  signal phyTxc : slv(7 downto 0);
86 
87  signal areset : sl;
88  signal txClk322 : sl;
89  signal txUsrClk : sl;
90  signal txUsrClk2 : sl;
91  signal txUsrRdy : sl;
92 
93  signal drpReqGnt : sl;
94  signal drpEn : sl;
95  signal drpWe : sl;
96  signal drpAddr : slv(15 downto 0);
97  signal drpDi : slv(15 downto 0);
98  signal drpRdy : sl;
99  signal drpDo : slv(15 downto 0);
100 
101  signal configurationVector : slv(535 downto 0) := (others => '0');
102 
105 
110 
111 begin
112 
114  areset <= extRst or config.softRst;
116 
117  ------------------
118  -- Synchronization
119  ------------------
120  U_AxiLiteAsync : entity work.AxiLiteAsync
121  generic map (
122  TPD_G => TPD_G)
123  port map (
124  -- Slave Port
125  sAxiClk => axiLiteClk,
131  -- Master Port
132  mAxiClk => phyClk,
133  mAxiClkRst => phyRst,
138 
140 
141  U_Sync : entity work.SynchronizerVector
142  generic map (
143  TPD_G => TPD_G,
144  WIDTH_G => 3)
145  port map (
146  clk => phyClk,
147  -- Input
148  dataIn(0) => sigDet,
149  dataIn(1) => txFault,
150  dataIn(2) => txUsrRdy,
151  -- Output
152  dataOut(0) => status.sigDet,
153  dataOut(1) => status.txFault,
154  dataOut(2) => status.txUsrRdy);
155 
156  --------------------
157  -- Ethernet MAC core
158  --------------------
159  U_MAC : entity work.EthMacTop
160  generic map (
161  TPD_G => TPD_G,
162  PHY_TYPE_G => "XGMII",
164  port map (
165  -- Primary Interface
166  primClk => dmaClk,
167  primRst => dmaRst,
172  -- Ethernet Interface
173  ethClk => phyClk,
174  ethRst => phyRst,
175  ethConfig => config.macConfig,
176  ethStatus => status.macStatus,
177  phyReady => status.phyReady,
178  -- XGMII PHY Interface
179  xgmiiRxd => phyRxd,
180  xgmiiRxc => phyRxc,
181  xgmiiTxd => phyTxd,
182  xgmiiTxc => phyTxc);
183 
184  -----------------
185  -- 10GBASE-R core
186  -----------------
187  U_TenGigEthGth7Core : entity work.TenGigEthGth7Core
188  port map (
189  -- Clocks and Resets
190  rxrecclk_out => open,
191  coreclk => phyClk,
192  dclk => phyClk,
193  txusrclk => txUsrClk,
194  txusrclk2 => txUsrClk2,
195  areset => areset,
196  txoutclk => txClk322,
197  areset_coreclk => phyRst,
198  gttxreset => status.gtTxRst,
199  gtrxreset => status.gtRxRst,
200  txuserrdy => txUsrRdy,
201  reset_counter_done => status.rstCntDone,
202  -- Quad PLL Interface
203  qplllock => status.qplllock,
204  qplloutclk => qplloutclk,
205  qplloutrefclk => qplloutrefclk,
206  -- MGT Ports
207  txp => gtTxP,
208  txn => gtTxN,
209  rxp => gtRxP,
210  rxn => gtRxN,
211  -- PHY Interface
212  xgmii_txd => phyTxd,
213  xgmii_txc => phyTxc,
214  xgmii_rxd => phyRxd,
215  xgmii_rxc => phyRxc,
216  -- Configuration and Status
217  sim_speedup_control => '0',
218  configuration_vector => configurationVector,
219  status_vector => open,
220  core_status => status.core_status,
221  tx_resetdone => status.txRstdone,
222  rx_resetdone => status.rxRstdone,
223  signal_detect => status.sigDet,
224  tx_fault => status.txFault,
225  tx_disable => status.txDisable,
226  pma_pmd_type => config.pma_pmd_type,
227  -- DRP interface
228  -- Note: If no arbitration is required on the GT DRP ports
229  -- then connect REQ to GNT and connect other signals i <= o;
230  drp_req => drpReqGnt,
231  drp_gnt => drpReqGnt,
232  drp_den_o => drpEn,
233  drp_dwe_o => drpWe,
234  drp_daddr_o => drpAddr,
235  drp_di_o => drpDi,
236  drp_drdy_o => drpRdy,
237  drp_drpdo_o => drpDo,
238  drp_den_i => drpEn,
239  drp_dwe_i => drpWe,
240  drp_daddr_i => drpAddr,
241  drp_di_i => drpDi,
242  drp_drdy_i => drpRdy,
243  drp_drpdo_i => drpDo);
244 
245  -------------------------------------
246  -- 10GBASE-R's Reset Module
247  -------------------------------------
248  U_TenGigEthRst : entity work.TenGigEthRst
249  generic map (
250  TPD_G => TPD_G)
251  port map (
252  -- Clocks and Resets
253  extRst => extRst,
254  phyClk => phyClk,
255  phyRst => phyRst,
256  txClk322 => txClk322,
257  txUsrClk => txUsrClk,
258  txUsrClk2 => txUsrClk2,
259  gtTxRst => status.gtTxRst,
260  gtRxRst => status.gtRxRst,
261  txUsrRdy => txUsrRdy,
262  rstCntDone => status.rstCntDone,
263  -- Quad PLL Ports
264  qplllock => status.qplllock,
265  qpllRst => qpllRst);
266 
267  -------------------------------
268  -- Configuration Vector Mapping
269  -------------------------------
270  configurationVector(0) <= config.pma_loopback;
271  configurationVector(15) <= config.pma_reset;
272  configurationVector(110) <= config.pcs_loopback;
273  configurationVector(111) <= config.pcs_reset;
274  configurationVector(399 downto 384) <= x"4C4B"; -- timer_ctrl = 0x4C4B (default)
275 
276  ----------------------
277  -- Core Status Mapping
278  ----------------------
280 
281  --------------------------------
282  -- Configuration/Status Register
283  --------------------------------
284  U_TenGigEthReg : entity work.TenGigEthReg
285  generic map (
286  TPD_G => TPD_G,
289  port map (
290  -- Local Configurations
291  localMac => localMac,
292  -- Clocks and resets
293  clk => phyClk,
294  rst => phyRst,
295  -- AXI-Lite Register Interface
300  -- Configuration and Status Interface
301  config => config,
302  status => status);
303 
304 end mapping;
in axiReadMasterAxiLiteReadMasterType
out dmaObSlaveAxiStreamSlaveType
EN_AXI_REG_Gboolean := false
slv( 15 downto 0) drpDi
in localMacslv( 47 downto 0) := MAC_ADDR_INIT_C
in axiLiteWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
slv( 535 downto 0) :=( others => '0') configurationVector
in primClksl
Definition: EthMacTop.vhd:65
out xgmiiTxdslv( 63 downto 0)
Definition: EthMacTop.vhd:93
TenGigEthStatus status
AxiStreamSlaveType macTxAxisSlave
out rstCntDonesl
AxiLiteWriteMasterType mAxiWriteMaster
slv( 7 downto 0) phyRxc
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
in dmaIbSlaveAxiStreamSlaveType
out txUsrClksl
in xgmiiRxcslv( 7 downto 0) :=( others => '0')
Definition: EthMacTop.vhd:92
out mAxiReadMasterAxiLiteReadMasterType
slv( 63 downto 0) phyRxd
in axiLiteReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
in ibMacPrimMasterAxiStreamMasterType
Definition: EthMacTop.vhd:67
out axiReadSlaveAxiLiteReadSlaveType
slv( 7 downto 0) core_status
out xgmiiTxcslv( 7 downto 0)
Definition: EthMacTop.vhd:94
in mAxiWriteSlaveAxiLiteWriteSlaveType
out gtRxRstsl
out txUsrRdysl
slv( 7 downto 0) phyTxc
in obMacPrimSlaveAxiStreamSlaveType
Definition: EthMacTop.vhd:70
in statusTenGigEthStatus
out sAxiWriteSlaveAxiLiteWriteSlaveType
AxiLiteReadSlaveType mAxiReadSlave
TenGigEthConfig config
out axiLiteWriteSlaveAxiLiteWriteSlaveType
in dmaObMasterAxiStreamMasterType
TPD_Gtime := 1 ns
in axiLiteRstsl := '0'
in sAxiReadMasterAxiLiteReadMasterType
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
Definition: AxiLitePkg.vhd:36
in sAxiWriteMasterAxiLiteWriteMasterType
slv( 63 downto 0) phyTxd
out gtTxRstsl
in primRstsl
Definition: EthMacTop.vhd:66
out obMacPrimMasterAxiStreamMasterType
Definition: EthMacTop.vhd:69
AxiStreamMasterType macRxAxisMaster
in ethRstsl
Definition: EthMacTop.vhd:63
in txFaultsl := '0'
in xgmiiRxdslv( 63 downto 0) :=( others => '0')
Definition: EthMacTop.vhd:91
AxiLiteReadMasterType mAxiReadMaster
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
AxiLiteWriteSlaveType mAxiWriteSlave
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
out axiWriteSlaveAxiLiteWriteSlaveType
out qpllRstsl
out ibMacPrimSlaveAxiStreamSlaveType
Definition: EthMacTop.vhd:68
in ethClksl
Definition: EthMacTop.vhd:62
AxiStreamCtrlType macRxAxisCtrl
EN_AXI_REG_Gboolean := false
out sAxiReadSlaveAxiLiteReadSlaveType
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
PRIM_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
Definition: EthMacTop.vhd:49
out axiLiteReadSlaveAxiLiteReadSlaveType
in axiWriteMasterAxiLiteWriteMasterType
slv( 15 downto 0) drpAddr
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
out configTenGigEthConfig
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
in localMacslv( 47 downto 0) := MAC_ADDR_INIT_C
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 mAxiReadSlaveAxiLiteReadSlaveType
in mAxiClkRstsl
TPD_Gtime := 1 ns
Definition: EthMacTop.vhd:32
TPD_Gtime := 1 ns
in ethConfigEthMacConfigType
Definition: EthMacTop.vhd:104
in axiLiteClksl := '0'
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
out ethStatusEthMacStatusType
Definition: EthMacTop.vhd:105
out txUsrClk2sl
slv( 15 downto 0) drpDo
AxiStreamMasterType macTxAxisMaster
_library_ ieeeieee
TPD_Gtime := 1 ns
out mAxiWriteMasterAxiLiteWriteMasterType
TPD_Gtime := 1 ns
in sAxiClkRstsl
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
in sigDetsl := '1'
out dmaIbMasterAxiStreamMasterType
in phyReadysl
Definition: EthMacTop.vhd:103