SURF  1.0
GigEthGtx7.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : GigEthGtx7.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 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.EthMacPkg.all;
25 use work.GigEthPkg.all;
26 
27 --! @see entity
28  --! @ingroup ethernet_GigEthCore_gtx7
29 entity GigEthGtx7 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  -- MGT Ports
62  gtTxP : out sl;
63  gtTxN : out sl;
64  gtRxP : in sl;
65  gtRxN : in sl);
66 end GigEthGtx7;
67 
68 architecture mapping of GigEthGtx7 is
69 
72 
77 
78  signal gmiiTxClk : sl;
79  signal gmiiTxd : slv(7 downto 0);
80  signal gmiiTxEn : sl;
81  signal gmiiTxEr : sl;
82 
83  signal gmiiRxClk : sl;
84  signal gmiiRxd : slv(7 downto 0);
85  signal gmiiRxDv : sl;
86  signal gmiiRxEr : sl;
87 
88  signal areset : sl;
89  signal coreRst : sl;
90 
91 begin
92 
93  ------------------
94  -- Synchronization
95  ------------------
96  U_AxiLiteAsync : entity work.AxiLiteAsync
97  generic map (
98  TPD_G => TPD_G)
99  port map (
100  -- Slave Port
101  sAxiClk => axiLiteClk,
107  -- Master Port
108  mAxiClk => sysClk125,
114 
116 
117  U_PwrUpRst : entity work.PwrUpRst
118  generic map (
119  TPD_G => TPD_G,
120  DURATION_G => 1000)
121  port map (
122  clk => sysClk125,
123  arst => areset,
124  rstOut => coreRst);
125 
126  --------------------
127  -- Ethernet MAC core
128  --------------------
129  U_MAC : entity work.EthMacTop
130  generic map (
131  TPD_G => TPD_G,
132  PHY_TYPE_G => "GMII",
134  port map (
135  -- Primary Interface
136  primClk => dmaClk,
137  primRst => dmaRst,
142  -- Ethernet Interface
143  ethClk => sysClk125,
144  ethRst => sysRst125,
145  ethConfig => config.macConfig,
146  ethStatus => status.macStatus,
147  phyReady => status.phyReady,
148  -- GMII PHY Interface
149  gmiiRxDv => gmiiRxDv,
150  gmiiRxEr => gmiiRxEr,
151  gmiiRxd => gmiiRxd,
152  gmiiTxEn => gmiiTxEn,
153  gmiiTxEr => gmiiTxEr,
154  gmiiTxd => gmiiTxd);
155 
156  ------------------
157  -- 1000BASE-X core
158  ------------------
159  U_GigEthGtx7Core : entity work.GigEthGtx7Core
160  port map (
161  -- Clocks and Resets
162  gtrefclk_bufg => sysClk125, -- Used as DRP clock in IP core
163  gtrefclk => sysClk125, -- Used as CPLL clock reference
164  independent_clock_bufg => sysClk125, -- Used as stable clock reference
165  txoutclk => open,
166  rxoutclk => open,
167  userclk => sysClk62,
168  userclk2 => sysClk125,
169  rxuserclk => sysClk62,
170  rxuserclk2 => sysClk62,
171  reset => coreRst,
172  pma_reset => coreRst,
173  resetdone => open,
174  mmcm_locked => '1',
175  mmcm_reset => open,
176  cplllock => open,
177  -- PHY Interface
178  gmii_txd => gmiiTxd,
179  gmii_tx_en => gmiiTxEn,
180  gmii_tx_er => gmiiTxEr,
181  gmii_rxd => gmiiRxd,
182  gmii_rx_dv => gmiiRxDv,
183  gmii_rx_er => gmiiRxEr,
184  gmii_isolate => open,
185  -- MGT Ports
186  txp => gtTxP,
187  txn => gtTxN,
188  rxp => gtRxP,
189  rxn => gtRxN,
190  -- Quad PLL Interface
191  gt0_qplloutclk_in => '0', -- QPLL not used
192  gt0_qplloutrefclk_in => '0', -- QPLL not used
193  -- Configuration and Status
194  configuration_vector => config.coreConfig,
195  status_vector => status.coreStatus,
196  signal_detect => sigDet);
197 
200 
201  --------------------------------
202  -- Configuration/Status Register
203  --------------------------------
204  U_GigEthReg : entity work.GigEthReg
205  generic map (
206  TPD_G => TPD_G,
209  port map (
210  -- Local Configurations
211  localMac => localMac,
212  -- Clocks and resets
213  clk => sysClk125,
214  rst => sysRst125,
215  -- AXI-Lite Register Interface
220  -- Configuration and Status Interface
221  config => config,
222  status => status);
223 
224 end mapping;
EN_AXI_REG_Gboolean := false
Definition: GigEthReg.vhd:32
AxiLiteWriteMasterType mAxiWriteMaster
Definition: GigEthGtx7.vhd:75
in statusGigEthStatusType
Definition: GigEthReg.vhd:47
out axiReadSlaveAxiLiteReadSlaveType
Definition: GigEthReg.vhd:42
in rstsl
Definition: GigEthReg.vhd:39
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 dmaIbSlaveAxiStreamSlaveType
Definition: GigEthGtx7.vhd:44
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
in gtRxPsl
Definition: GigEthGtx7.vhd:64
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
Definition: GigEthGtx7.vhd:34
slv( 7 downto 0) gmiiTxd
Definition: GigEthGtx7.vhd:79
out mAxiReadMasterAxiLiteReadMasterType
in axiLiteRstsl := '0'
Definition: GigEthGtx7.vhd:49
EN_AXI_REG_Gboolean := false
Definition: GigEthGtx7.vhd:33
in axiLiteClksl := '0'
Definition: GigEthGtx7.vhd:48
in ibMacPrimMasterAxiStreamMasterType
Definition: EthMacTop.vhd:67
in sysClk125sl
Definition: GigEthGtx7.vhd:56
in sigDetsl := '1'
Definition: GigEthGtx7.vhd:60
in sysRst125sl
Definition: GigEthGtx7.vhd:57
AxiLiteWriteSlaveType mAxiWriteSlave
Definition: GigEthGtx7.vhd:76
in mAxiWriteSlaveAxiLiteWriteSlaveType
out gtTxPsl
Definition: GigEthGtx7.vhd:62
in obMacPrimSlaveAxiStreamSlaveType
Definition: EthMacTop.vhd:70
out gmiiTxEnsl
Definition: EthMacTop.vhd:99
out sAxiWriteSlaveAxiLiteWriteSlaveType
in sysClk62sl
Definition: GigEthGtx7.vhd:55
in localMacslv( 47 downto 0) := MAC_ADDR_INIT_C
Definition: GigEthGtx7.vhd:39
in axiLiteWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
Definition: GigEthGtx7.vhd:52
in arstsl :=not IN_POLARITY_G
Definition: PwrUpRst.vhd:37
in gtRxNsl
Definition: GigEthGtx7.vhd:65
TPD_Gtime := 1 ns
Definition: GigEthGtx7.vhd:31
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
AxiLiteReadSlaveType mAxiReadSlave
Definition: GigEthGtx7.vhd:74
in ethRstsl
Definition: EthMacTop.vhd:63
GigEthConfigType
Definition: GigEthPkg.vhd:31
AxiLiteReadMasterType mAxiReadMaster
Definition: GigEthGtx7.vhd:73
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
Definition: GigEthGtx7.vhd:36
in dmaClksl
Definition: GigEthGtx7.vhd:41
in dmaRstsl
Definition: GigEthGtx7.vhd:42
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
out phyReadysl
Definition: GigEthGtx7.vhd:59
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
out dmaIbMasterAxiStreamMasterType
Definition: GigEthGtx7.vhd:43
in clksl
Definition: PwrUpRst.vhd:38
out sAxiReadSlaveAxiLiteReadSlaveType
slv( 15 downto 0) coreStatus
Definition: GigEthPkg.vhd:44
in axiLiteReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
Definition: GigEthGtx7.vhd:50
PRIM_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
Definition: EthMacTop.vhd:49
GigEthStatusType
Definition: GigEthPkg.vhd:41
out gmiiTxErsl
Definition: EthMacTop.vhd:100
in extRstsl
Definition: GigEthGtx7.vhd:58
DURATION_Gnatural range 0 to (( 2** 30)- 1):= 156250000
Definition: PwrUpRst.vhd:35
out axiLiteReadSlaveAxiLiteReadSlaveType
Definition: GigEthGtx7.vhd:51
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
out axiLiteWriteSlaveAxiLiteWriteSlaveType
Definition: GigEthGtx7.vhd:53
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
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
GigEthStatusType status
Definition: GigEthGtx7.vhd:71
in axiReadMasterAxiLiteReadMasterType
Definition: GigEthReg.vhd:41
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
slv( 7 downto 0) gmiiRxd
Definition: GigEthGtx7.vhd:84
in gmiiRxdslv( 7 downto 0) :=( others => '0')
Definition: EthMacTop.vhd:98
TPD_Gtime := 1 ns
Definition: EthMacTop.vhd:32
TPD_Gtime := 1 ns
GigEthConfigType config
Definition: GigEthGtx7.vhd:70
in ethConfigEthMacConfigType
Definition: EthMacTop.vhd:104
in gmiiRxErsl := '0'
Definition: EthMacTop.vhd:97
sl softRst
Definition: GigEthPkg.vhd:32
out ethStatusEthMacStatusType
Definition: EthMacTop.vhd:105
in dmaObMasterAxiStreamMasterType
Definition: GigEthGtx7.vhd:45
TPD_Gtime := 1 ns
Definition: GigEthReg.vhd:31
out mAxiWriteMasterAxiLiteWriteMasterType
out dmaObSlaveAxiStreamSlaveType
Definition: GigEthGtx7.vhd:46
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
out gtTxNsl
Definition: GigEthGtx7.vhd:63