SURF  1.0
GigEthGtp7.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : GigEthGtp7.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2016-02-07
5 -- Last update: 2017-05-12
6 -------------------------------------------------------------------------------
7 -- Description: 1000BASE-X Ethernet for Gtp7
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.EthMacPkg.all;
25 use work.GigEthPkg.all;
26 
27 --! @see entity
28  --! @ingroup ethernet_GigEthCore_gtp7
29 entity GigEthGtp7 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  -- PHY + MAC signals
55  sysClk62 : in sl;
56  sysClk125 : in sl;
57  sysRst125 : in sl;
58  extRst : in sl;
59  phyReady : out sl;
60  sigDet : in sl := '1';
61  -- Quad PLL Interface
62  qPllOutClk : in slv(1 downto 0);
63  qPllOutRefClk : in slv(1 downto 0);
64  qPllLock : in slv(1 downto 0);
65  qPllRefClkLost : in slv(1 downto 0);
66  qPllReset : out slv(1 downto 0);
67  -- MGT Ports
68  gtTxP : out sl;
69  gtTxN : out sl;
70  gtRxP : in sl;
71  gtRxN : in sl);
72 end GigEthGtp7;
73 
74 architecture mapping of GigEthGtp7 is
75 
78 
83 
84  signal gmiiTxClk : sl;
85  signal gmiiTxd : slv(7 downto 0);
86  signal gmiiTxEn : sl;
87  signal gmiiTxEr : sl;
88 
89  signal gmiiRxClk : sl;
90  signal gmiiRxd : slv(7 downto 0);
91  signal gmiiRxDv : sl;
92  signal gmiiRxEr : sl;
93 
94  signal areset : sl;
95  signal coreRst : sl;
96 
97 begin
98 
99  ------------------
100  -- Synchronization
101  ------------------
102  U_AxiLiteAsync : entity work.AxiLiteAsync
103  generic map (
104  TPD_G => TPD_G)
105  port map (
106  -- Slave Port
107  sAxiClk => axiLiteClk,
113  -- Master Port
114  mAxiClk => sysClk125,
120 
122 
123  U_PwrUpRst : entity work.PwrUpRst
124  generic map (
125  TPD_G => TPD_G,
126  DURATION_G => 1000)
127  port map (
128  clk => sysClk125,
129  arst => areset,
130  rstOut => coreRst);
131 
132  --------------------
133  -- Ethernet MAC core
134  --------------------
135  U_MAC : entity work.EthMacTop
136  generic map (
137  TPD_G => TPD_G,
138  PHY_TYPE_G => "GMII",
140  port map (
141  -- Primary Interface
142  primClk => dmaClk,
143  primRst => dmaRst,
148  -- Ethernet Interface
149  ethClk => sysClk125,
150  ethRst => sysRst125,
151  ethConfig => config.macConfig,
152  ethStatus => status.macStatus,
153  phyReady => status.phyReady,
154  -- GMII PHY Interface
155  gmiiRxDv => gmiiRxDv,
156  gmiiRxEr => gmiiRxEr,
157  gmiiRxd => gmiiRxd,
158  gmiiTxEn => gmiiTxEn,
159  gmiiTxEr => gmiiTxEr,
160  gmiiTxd => gmiiTxd);
161 
162  ------------------
163  -- 1000BASE-X core
164  ------------------
165  U_GigEthGtp7Core : entity work.GigEthGtp7Core
166  port map (
167  -- Clocks and Resets
168  gtrefclk_bufg => sysClk125, -- Used as DRP clock in IP core
169  gtrefclk => sysClk125, -- Not connected to loads in GTP7 IP core
170  independent_clock_bufg => sysClk125, -- Used as stable clock reference
171  txoutclk => open,
172  rxoutclk => open,
173  userclk => sysClk62,
174  userclk2 => sysClk125,
175  rxuserclk => sysClk62,
176  rxuserclk2 => sysClk62,
177  reset => coreRst,
178  pma_reset => coreRst,
179  resetdone => open,
180  mmcm_locked => '1',
181  mmcm_reset => open,
182  cplllock => open,
183  -- PHY Interface
184  gmii_txd => gmiiTxd,
185  gmii_tx_en => gmiiTxEn,
186  gmii_tx_er => gmiiTxEr,
187  gmii_rxd => gmiiRxd,
188  gmii_rx_dv => gmiiRxDv,
189  gmii_rx_er => gmiiRxEr,
190  gmii_isolate => open,
191  -- MGT Ports
192  txp => gtTxP,
193  txn => gtTxN,
194  rxp => gtRxP,
195  rxn => gtRxN,
196  -- Quad PLL Interface
197  gt0_pll0outclk_in => qPllOutClk(0),
198  gt0_pll0outrefclk_in => qPllOutRefClk(0),
199  gt0_pll0lock_in => qPllLock(0),
200  gt0_pll0refclklost_in => qPllRefClkLost(0),
201  gt0_pll0reset_out => qPllReset(0),
202  gt0_pll1outclk_in => qPllOutClk(1),
203  gt0_pll1outrefclk_in => qPllOutRefClk(1),
204  -- Configuration and Status
205  configuration_vector => config.coreConfig,
206  status_vector => status.coreStatus,
207  signal_detect => sigDet);
208 
211  qPllReset(1) <= '1'; -- No using QPLL[1]
212 
213  --------------------------------
214  -- Configuration/Status Register
215  --------------------------------
216  U_GigEthReg : entity work.GigEthReg
217  generic map (
218  TPD_G => TPD_G,
221  port map (
222  -- Local Configurations
223  localMac => localMac,
224  -- Clocks and resets
225  clk => sysClk125,
226  rst => sysRst125,
227  -- AXI-Lite Register Interface
232  -- Configuration and Status Interface
233  config => config,
234  status => status);
235 
236 end mapping;
EN_AXI_REG_Gboolean := false
Definition: GigEthReg.vhd:32
in statusGigEthStatusType
Definition: GigEthReg.vhd:47
in axiLiteWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
Definition: GigEthGtp7.vhd:52
TPD_Gtime := 1 ns
Definition: GigEthGtp7.vhd:31
GigEthStatusType status
Definition: GigEthGtp7.vhd:77
out axiReadSlaveAxiLiteReadSlaveType
Definition: GigEthReg.vhd:42
out dmaIbMasterAxiStreamMasterType
Definition: GigEthGtp7.vhd:43
in rstsl
Definition: GigEthReg.vhd:39
in qPllOutClkslv( 1 downto 0)
Definition: GigEthGtp7.vhd:62
in extRstsl
Definition: GigEthGtp7.vhd:58
out axiLiteReadSlaveAxiLiteReadSlaveType
Definition: GigEthGtp7.vhd:51
out rstOutsl
Definition: PwrUpRst.vhd:39
TPD_Gtime := 1 ns
Definition: PwrUpRst.vhd:30
in primClksl
Definition: EthMacTop.vhd:65
in axiWriteMasterAxiLiteWriteMasterType
Definition: GigEthReg.vhd:43
in qPllOutRefClkslv( 1 downto 0)
Definition: GigEthGtp7.vhd:63
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
in dmaRstsl
Definition: GigEthGtp7.vhd:42
out phyReadysl
Definition: GigEthGtp7.vhd:59
AxiLiteReadSlaveType mAxiReadSlave
Definition: GigEthGtp7.vhd:80
AxiLiteReadMasterType mAxiReadMaster
Definition: GigEthGtp7.vhd:79
out mAxiReadMasterAxiLiteReadMasterType
in ibMacPrimMasterAxiStreamMasterType
Definition: EthMacTop.vhd:67
in axiLiteReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
Definition: GigEthGtp7.vhd:50
in dmaObMasterAxiStreamMasterType
Definition: GigEthGtp7.vhd:45
in mAxiWriteSlaveAxiLiteWriteSlaveType
out axiLiteWriteSlaveAxiLiteWriteSlaveType
Definition: GigEthGtp7.vhd:53
out dmaObSlaveAxiStreamSlaveType
Definition: GigEthGtp7.vhd:46
in obMacPrimSlaveAxiStreamSlaveType
Definition: EthMacTop.vhd:70
out gmiiTxEnsl
Definition: EthMacTop.vhd:99
out sAxiWriteSlaveAxiLiteWriteSlaveType
out qPllResetslv( 1 downto 0)
Definition: GigEthGtp7.vhd:66
in arstsl :=not IN_POLARITY_G
Definition: PwrUpRst.vhd:37
in sAxiReadMasterAxiLiteReadMasterType
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
Definition: AxiLitePkg.vhd:36
in sAxiWriteMasterAxiLiteWriteMasterType
in primRstsl
Definition: EthMacTop.vhd:66
out obMacPrimMasterAxiStreamMasterType
Definition: EthMacTop.vhd:69
in ethRstsl
Definition: EthMacTop.vhd:63
slv( 7 downto 0) gmiiTxd
Definition: GigEthGtp7.vhd:85
GigEthConfigType
Definition: GigEthPkg.vhd:31
slv( 7 downto 0) gmiiRxd
Definition: GigEthGtp7.vhd:90
in dmaIbSlaveAxiStreamSlaveType
Definition: GigEthGtp7.vhd:44
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
AxiLiteWriteSlaveType mAxiWriteSlave
Definition: GigEthGtp7.vhd:82
GigEthConfigType config
Definition: GigEthGtp7.vhd:76
out gtTxNsl
Definition: GigEthGtp7.vhd:69
out ibMacPrimSlaveAxiStreamSlaveType
Definition: EthMacTop.vhd:68
in localMacslv( 47 downto 0) := MAC_ADDR_INIT_C
Definition: GigEthReg.vhd:36
in ethClksl
Definition: EthMacTop.vhd:62
out configGigEthConfigType
Definition: GigEthReg.vhd:46
EN_AXI_REG_Gboolean := false
Definition: GigEthGtp7.vhd:33
in clksl
Definition: PwrUpRst.vhd:38
out sAxiReadSlaveAxiLiteReadSlaveType
slv( 15 downto 0) coreStatus
Definition: GigEthPkg.vhd:44
in sysClk125sl
Definition: GigEthGtp7.vhd:56
PRIM_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
Definition: EthMacTop.vhd:49
in sigDetsl := '1'
Definition: GigEthGtp7.vhd:60
GigEthStatusType
Definition: GigEthPkg.vhd:41
out gmiiTxErsl
Definition: EthMacTop.vhd:100
DURATION_Gnatural range 0 to (( 2** 30)- 1):= 156250000
Definition: PwrUpRst.vhd:35
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
Definition: GigEthReg.vhd:33
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
in clksl
Definition: GigEthReg.vhd:38
in gmiiRxDvsl := '0'
Definition: EthMacTop.vhd:96
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
AxiLiteWriteMasterType mAxiWriteMaster
Definition: GigEthGtp7.vhd:81
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
in axiReadMasterAxiLiteReadMasterType
Definition: GigEthReg.vhd:41
in gtRxPsl
Definition: GigEthGtp7.vhd:70
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 sysClk62sl
Definition: GigEthGtp7.vhd:55
in localMacslv( 47 downto 0) := MAC_ADDR_INIT_C
Definition: GigEthGtp7.vhd:39
in mAxiReadSlaveAxiLiteReadSlaveType
in mAxiClkRstsl
in gtRxNsl
Definition: GigEthGtp7.vhd:71
in gmiiRxdslv( 7 downto 0) :=( others => '0')
Definition: EthMacTop.vhd:98
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
Definition: GigEthGtp7.vhd:34
in qPllRefClkLostslv( 1 downto 0)
Definition: GigEthGtp7.vhd:65
TPD_Gtime := 1 ns
Definition: EthMacTop.vhd:32
in axiLiteRstsl := '0'
Definition: GigEthGtp7.vhd:49
TPD_Gtime := 1 ns
in ethConfigEthMacConfigType
Definition: EthMacTop.vhd:104
in axiLiteClksl := '0'
Definition: GigEthGtp7.vhd:48
in gmiiRxErsl := '0'
Definition: EthMacTop.vhd:97
sl softRst
Definition: GigEthPkg.vhd:32
out ethStatusEthMacStatusType
Definition: EthMacTop.vhd:105
in sysRst125sl
Definition: GigEthGtp7.vhd:57
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
Definition: GigEthGtp7.vhd:36
in qPllLockslv( 1 downto 0)
Definition: GigEthGtp7.vhd:64
TPD_Gtime := 1 ns
Definition: GigEthReg.vhd:31
in dmaClksl
Definition: GigEthGtp7.vhd:41
out mAxiWriteMasterAxiLiteWriteMasterType
out gtTxPsl
Definition: GigEthGtp7.vhd:68
in sAxiClkRstsl
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
out gmiiTxdslv( 7 downto 0)
Definition: EthMacTop.vhd:101
in phyReadysl
Definition: EthMacTop.vhd:103
out axiWriteSlaveAxiLiteWriteSlaveType
Definition: GigEthReg.vhd:44