SURF  1.0
EthMacRx.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : EthMacRx.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2015-09-22
5 -- Last update: 2016-10-20
6 -------------------------------------------------------------------------------
7 -- Description: Ethernet MAC RX Wrapper
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 use ieee.std_logic_arith.all;
21 use ieee.std_logic_unsigned.all;
22 
23 use work.AxiStreamPkg.all;
24 use work.StdRtlPkg.all;
25 use work.EthMacPkg.all;
26 
27 --! @see entity
28  --! @ingroup ethernet_EthMacCore
29 entity EthMacRx is
30  generic (
31  -- Simulation Generics
32  TPD_G : time := 1 ns;
33  -- MAC Configurations
34  PAUSE_EN_G : boolean := true;
35  PHY_TYPE_G : string := "XGMII";
36  JUMBO_G : boolean := true;
37  -- Non-VLAN Configurations
38  FILT_EN_G : boolean := false;
39  BYP_EN_G : boolean := false;
40  BYP_ETH_TYPE_G : slv(15 downto 0) := x"0000";
41  -- VLAN Configurations
42  VLAN_EN_G : boolean := false;
43  VLAN_SIZE_G : positive range 1 to 8 := 1;
44  VLAN_VID_G : Slv12Array := (0 => x"001"));
45  port (
46  -- Clock and Reset
47  ethClk : in sl;
48  ethRst : in sl;
49  -- Primary Interface
52  -- Bypass Interface
55  -- VLAN Interfaces
58  -- XLGMII PHY Interface
59  xlgmiiRxd : in slv(127 downto 0);
60  xlgmiiRxc : in slv(15 downto 0);
61  -- XGMII PHY Interface
62  xgmiiRxd : in slv(63 downto 0);
63  xgmiiRxc : in slv(7 downto 0);
64  -- GMII PHY Interface
65  gmiiRxDv : in sl;
66  gmiiRxEr : in sl;
67  gmiiRxd : in slv(7 downto 0);
68  -- Flow Control Interface
69  rxPauseReq : out sl;
70  rxPauseValue : out slv(15 downto 0);
71  -- Configuration and status
72  phyReady : in sl;
74  rxCountEn : out sl;
75  rxCrcError : out sl);
76 end EthMacRx;
77 
78 architecture mapping of EthMacRx is
79 
85 
86 begin
87 
88  -------------------
89  -- RX Import Module
90  -------------------
91  U_Import : entity work.EthMacRxImport
92  generic map (
93  TPD_G => TPD_G,
95  port map (
96  -- Clock and reset
97  ethClk => ethClk,
98  ethRst => ethRst,
99  -- AXIS Interface
101  -- XLGMII PHY Interface
102  xlgmiiRxd => xlgmiiRxd,
103  xlgmiiRxc => xlgmiiRxc,
104  -- XGMII PHY Interface
105  xgmiiRxd => xgmiiRxd,
106  xgmiiRxc => xgmiiRxc,
107  -- GMII PHY Interface
108  gmiiRxDv => gmiiRxDv,
109  gmiiRxEr => gmiiRxEr,
110  gmiiRxd => gmiiRxd,
111  -- Configuration and status
112  phyReady => phyReady,
113  rxCountEn => rxCountEn,
115 
116  ------------------
117  -- RX Pause Module
118  ------------------
119  U_Pause : entity work.EthMacRxPause
120  generic map (
121  TPD_G => TPD_G,
123  VLAN_EN_G => VLAN_EN_G,
126  port map (
127  -- Clock and Reset
128  ethClk => ethClk,
129  ethRst => ethRst,
130  -- Incoming data from MAC
132  -- Outgoing data
135  -- Pause Values
138 
139  ------------------------------
140  -- RX Non-VLAN Checksum Module
141  ------------------------------
142  U_Csum : entity work.EthMacRxCsum
143  generic map (
144  TPD_G => TPD_G,
145  JUMBO_G => JUMBO_G,
146  VLAN_G => false)
147  port map (
148  -- Clock and Reset
149  ethClk => ethClk,
150  ethRst => ethRst,
151  -- Configurations
152  ipCsumEn => ethConfig.ipCsumEn,
153  tcpCsumEn => ethConfig.tcpCsumEn,
154  udpCsumEn => ethConfig.udpCsumEn,
155  -- Outbound data to MAC
158 
159  --------------------------
160  -- RX VLAN Checksum Module
161  --------------------------
162  GEN_VLAN : if (VLAN_EN_G = true) generate
163  GEN_VEC :
164  for i in (VLAN_SIZE_G-1) downto 0 generate
165  U_Csum : entity work.EthMacRxCsum
166  generic map (
167  TPD_G => TPD_G,
168  JUMBO_G => JUMBO_G,
169  VLAN_G => true)
170  port map (
171  -- Clock and Reset
172  ethClk => ethClk,
173  ethRst => ethRst,
174  -- Configurations
175  ipCsumEn => '1',
176  tcpCsumEn => '1',
177  udpCsumEn => '1',
178  -- Outbound data to MAC
180  mAxisMaster => mVlanMasters(i));
181  end generate GEN_VEC;
182  end generate;
183 
184  BYPASS_VLAN : if (VLAN_EN_G = false) generate
185  -- Terminate Unused buses
186  mVlanMasters <= (others => AXI_STREAM_MASTER_INIT_C);
187  end generate;
188 
189  -------------------
190  -- RX Bypass Module
191  -------------------
192  U_Bypass : entity work.EthMacRxBypass
193  generic map (
194  TPD_G => TPD_G,
195  BYP_EN_G => BYP_EN_G,
197  port map (
198  -- Clock and Reset
199  ethClk => ethClk,
200  ethRst => ethRst,
201  -- Incoming data from MAC
203  -- Outgoing primary data
205  -- Outgoing bypass data
207 
208  -------------------
209  -- RX Filter Module
210  -------------------
211  U_Filter : entity work.EthMacRxFilter
212  generic map (
213  TPD_G => TPD_G,
214  FILT_EN_G => FILT_EN_G)
215  port map (
216  -- Clock and Reset
217  ethClk => ethClk,
218  ethRst => ethRst,
219  -- Incoming data from MAC
221  -- Outgoing data
223  mAxisCtrl => mPrimCtrl,
224  -- Configuration
225  dropOnPause => ethConfig.dropOnPause,
226  macAddress => ethConfig.macAddress,
227  filtEnable => ethConfig.filtEnable);
228 
229 end mapping;
out mPrimMasterAxiStreamMasterType
JUMBO_Gboolean := true
Definition: EthMacRx.vhd:36
out mAxisMasterAxiStreamMasterType
out mAxisMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
in xgmiiRxdslv( 63 downto 0)
in sAxisMasterAxiStreamMasterType
array(natural range <> ) of slv( 11 downto 0) Slv12Array
Definition: StdRtlPkg.vhd:399
FILT_EN_Gboolean := false
Definition: EthMacRx.vhd:38
in macAddressslv( 47 downto 0)
TPD_Gtime := 1 ns
FILT_EN_Gboolean := false
in xlgmiiRxcslv( 15 downto 0)
in sAxisMasterAxiStreamMasterType
in mBypCtrlAxiStreamCtrlType
Definition: EthMacRx.vhd:54
TPD_Gtime := 1 ns
Definition: EthMacRx.vhd:32
std_logic sl
Definition: StdRtlPkg.vhd:28
TPD_Gtime := 1 ns
in xgmiiRxcslv( 7 downto 0)
Definition: EthMacRx.vhd:63
out mAxisMasterAxiStreamMasterType
out mBypMasterAxiStreamMasterType
Definition: EthMacRx.vhd:53
AxiStreamMasterType :=(tValid => '0',tData =>( others => '0'),tStrb =>( others => '1'),tKeep =>( others => '1'),tLast => '0',tDest =>( others => '0'),tId =>( others => '0'),tUser =>( others => '0')) AXI_STREAM_MASTER_INIT_C
_library_ ieeeieee
Definition: EthMacPkg.vhd:18
out mAxisMasterAxiStreamMasterType
in xgmiiRxcslv( 7 downto 0)
PHY_TYPE_Gstring := "XGMII"
AxiStreamMasterType bypassMaster
Definition: EthMacRx.vhd:84
VLAN_SIZE_Gpositive range 1 to 8:= 1
Definition: EthMacRx.vhd:43
AxiStreamMasterType pauseMaster
Definition: EthMacRx.vhd:81
in gmiiRxdslv( 7 downto 0)
Definition: EthMacRx.vhd:67
in xlgmiiRxdslv( 127 downto 0)
VLAN_VID_GSlv12Array :=( 0=> x"001")
Definition: EthMacRx.vhd:44
out rxCountEnsl
Definition: EthMacRx.vhd:74
VLAN_EN_Gboolean := false
BYP_EN_Gboolean := false
Definition: EthMacRx.vhd:39
out rxPauseValueslv( 15 downto 0)
in ethRstsl
Definition: EthMacRx.vhd:48
BYP_EN_Gboolean := false
in mPrimCtrlAxiStreamCtrlType
Definition: EthMacRx.vhd:51
in xlgmiiRxdslv( 127 downto 0)
Definition: EthMacRx.vhd:59
JUMBO_Gboolean := true
VLAN_VID_GSlv12Array :=( 0=> x"001")
BYP_ETH_TYPE_Gslv( 15 downto 0) := x"0000"
Definition: EthMacRx.vhd:40
in phyReadysl
Definition: EthMacRx.vhd:72
VLAN_Gboolean := false
AxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0) pauseMasters
Definition: EthMacRx.vhd:82
in ethClksl
Definition: EthMacRx.vhd:47
PAUSE_EN_Gboolean := true
Definition: EthMacRx.vhd:34
in gmiiRxDvsl
Definition: EthMacRx.vhd:65
VLAN_SIZE_Gpositive range 1 to 8:= 1
TPD_Gtime := 1 ns
EthMacConfigType
Definition: EthMacPkg.vhd:68
in xlgmiiRxcslv( 15 downto 0)
Definition: EthMacRx.vhd:60
in sAxisMasterAxiStreamMasterType
out mBypMasterAxiStreamMasterType
out mPrimMasterAxiStreamMasterType
Definition: EthMacRx.vhd:50
array(natural range <> ) of AxiStreamCtrlType AxiStreamCtrlArray
PAUSE_EN_Gboolean := true
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
in ethConfigEthMacConfigType
Definition: EthMacRx.vhd:73
AxiStreamMasterType macIbMaster
Definition: EthMacRx.vhd:80
in gmiiRxdslv( 7 downto 0)
PHY_TYPE_Gstring := "XGMII"
Definition: EthMacRx.vhd:35
out rxPauseValueslv( 15 downto 0)
Definition: EthMacRx.vhd:70
out rxPauseReqsl
Definition: EthMacRx.vhd:69
out macIbMasterAxiStreamMasterType
in sAxisMasterAxiStreamMasterType
TPD_Gtime := 1 ns
AxiStreamMasterType csumMaster
Definition: EthMacRx.vhd:83
in xgmiiRxdslv( 63 downto 0)
Definition: EthMacRx.vhd:62
in gmiiRxErsl
Definition: EthMacRx.vhd:66
in mAxisCtrlAxiStreamCtrlType
out mVlanMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
Definition: EthMacRx.vhd:56
BYP_ETH_TYPE_Gslv( 15 downto 0) := x"0000"
TPD_Gtime := 1 ns
in mVlanCtrlAxiStreamCtrlArray( VLAN_SIZE_G- 1 downto 0)
Definition: EthMacRx.vhd:57
VLAN_EN_Gboolean := false
Definition: EthMacRx.vhd:42
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
out rxCrcErrorsl
Definition: EthMacRx.vhd:75