1 ------------------------------------------------------------------------------- 2 -- File : EthMacTop.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2015-09-22 5 -- Last update: 2016-10-20 6 ------------------------------------------------------------------------------- 7 -- Description: Top-level for 1GbE/10GbE/40GbE ETH MAC Module 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 ------------------------------------------------------------------------------- 19 use ieee.std_logic_1164.
all;
20 use ieee.std_logic_arith.
all;
21 use ieee.std_logic_unsigned.
all;
28 --! @ingroup ethernet_EthMacCore 31 -- Simulation Generics 39 -- RX FIFO Configurations 46 -- Non-VLAN Configurations 54 -- VLAN Configurations 61 -- Core Clock and Reset 85 -- XLGMII PHY Interface 90 -- XGMII PHY Interface 102 -- Configuration and status 129 -- attribute dont_touch : string; 130 -- attribute dont_touch of rxPauseReq : signal is "true"; 131 -- attribute dont_touch of rxPauseValue : signal is "true"; 132 -- attribute dont_touch of flowCtrl : signal is "true"; 155 -- Master Clock and Reset 185 -- Simulation Generics 187 -- MAC Configurations 193 -- Non-VLAN Configurations 195 -- VLAN Configurations 212 -- XLGMII PHY Interface 215 -- XGMII PHY Interface 218 -- GMII PHY Interface 222 -- Flow control Interface 226 pauseTx => ethStatus.txPauseCnt,
227 -- Configuration and status 234 --------------------- 235 -- Flow Control Logic 236 --------------------- 259 -- Simulation Generics 261 -- MAC Configurations 265 -- Non-VLAN Configurations 269 -- VLAN Configurations 286 -- XLGMII PHY Interface 289 -- XGMII PHY Interface 292 -- GMII PHY Interface 296 -- Flow Control Interface 299 -- Configuration and status 328 -- Slave Clock and Reset 331 -- Status (sClk domain)
AxiStreamSlaveType sBypSlave
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
VLAN_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
out xlgmiiTxdslv( 127 downto 0)
PIPE_STAGES_Gnatural := 1
array(natural range <> ) of slv( 11 downto 0) Slv12Array
VLAN_EN_Gboolean := false
AxiStreamSlaveArray( VLAN_SIZE_G- 1 downto 0) sVlanSlaves
FILT_EN_Gboolean := false
BYP_COMMON_CLK_Gboolean := false
PRIM_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
slv( 15 downto 0) rxPauseValue
out xgmiiTxdslv( 63 downto 0)
out sPrimSlaveAxiStreamSlaveType
FIFO_PAUSE_THRESH_Gpositive := 1000
in rxPauseValueslv( 15 downto 0)
in mBypCtrlAxiStreamCtrlType
VLAN_SIZE_Gpositive range 1 to 8:= 1
BYP_COMMON_CLK_Gboolean := false
PRIM_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
in xlgmiiRxcslv( 15 downto 0) :=( others => '0')
in mVlanSlavesAxiStreamSlaveArray( VLAN_SIZE_G- 1 downto 0)
in xgmiiRxcslv( 7 downto 0)
out mBypMasterAxiStreamMasterType
FIFO_ADDR_WIDTH_Gpositive := 10
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
VLAN_VID_GSlv12Array :=( 0=> x"001")
out mVlanMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
AxiStreamCtrlType mBypCtrl
in xgmiiRxcslv( 7 downto 0) :=( others => '0')
PAUSE_EN_Gboolean := true
in mVlanSlavesAxiStreamSlaveArray( VLAN_SIZE_G- 1 downto 0)
in sBypMasterAxiStreamMasterType
out obMacVlanMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
VLAN_SIZE_Gpositive range 1 to 8:= 1
out mVlanMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
in gmiiRxdslv( 7 downto 0)
VLAN_COMMON_CLK_Gboolean := false
VLAN_SIZE_Gpositive range 1 to 8:= 1
in ibMacPrimMasterAxiStreamMasterType
in mPrimSlaveAxiStreamSlaveType
in sBypMasterAxiStreamMasterType
in mBypSlaveAxiStreamSlaveType
VLAN_VID_GSlv12Array :=( 0=> x"001")
out sBypCtrlAxiStreamCtrlType
VLAN_COMMON_CLK_Gboolean := false
out xgmiiTxcslv( 7 downto 0)
CASCADE_PAUSE_SEL_Gnatural := 0
in sPrimMasterAxiStreamMasterType
AxiStreamMasterType sBypMaster
in sBypMasterAxiStreamMasterType
in mPrimSlaveAxiStreamSlaveType
AxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0) mVlanMasters
in mBypSlaveAxiStreamSlaveType
VLAN_EN_Gboolean := false
PRIM_COMMON_CLK_Gboolean := false
in mPrimCtrlAxiStreamCtrlType
in obMacPrimSlaveAxiStreamSlaveType
out mPrimMasterAxiStreamMasterType
in ibMacVlanMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0) :=( others => AXI_STREAM_MASTER_INIT_C)
in xlgmiiRxdslv( 127 downto 0)
out sBypSlaveAxiStreamSlaveType
PAUSE_EN_Gboolean := true
AxiStreamMasterType sPrimMaster
CASCADE_SIZE_Gpositive := 2
FILT_EN_Gboolean := false
PRIM_COMMON_CLK_Gboolean := false
in xlgmiiRxdslv( 127 downto 0) :=( others => '0')
BYP_ETH_TYPE_Gslv( 15 downto 0) := x"0000"
out mPrimMasterAxiStreamMasterType
AxiStreamMasterType mBypMaster
out sPrimCtrlAxiStreamCtrlType
out sPrimSlaveAxiStreamSlaveType
out mBypMasterAxiStreamMasterType
out obMacPrimMasterAxiStreamMasterType
VLAN_SIZE_Gpositive range 1 to 8:= 1
PAUSE_EN_Gboolean := true
DROP_ERR_PKT_Gboolean := true
out gmiiTxdslv( 7 downto 0)
PAUSE_512BITS_Gpositive range 1 to 1024:= 8
in xgmiiRxdslv( 63 downto 0) :=( others => '0')
FIFO_PAUSE_THRESH_Gpositive := 1000
AxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0) sVlanMasters
out mBypMasterAxiStreamMasterType
out xlgmiiTxdslv( 127 downto 0)
AxiStreamCtrlArray( VLAN_SIZE_G- 1 downto 0) mVlanCtrl
BYP_COMMON_CLK_Gboolean := false
in sVlanMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
in vlanCtrlAxiStreamCtrlArray( VLAN_SIZE_G- 1 downto 0)
in xlgmiiRxcslv( 15 downto 0)
in ethConfigEthMacConfigType
out ibMacPrimSlaveAxiStreamSlaveType
PIPE_STAGES_Gnatural := 1
out mPrimMasterAxiStreamMasterType
INT_PIPE_STAGES_Gnatural := 1
array(natural range <> ) of AxiStreamCtrlType AxiStreamCtrlArray
AxiStreamCtrlType flowCtrl
VLAN_EN_Gboolean := false
VLAN_EN_Gboolean := false
FIFO_ADDR_WIDTH_Gpositive := 10
out sVlanSlavesAxiStreamSlaveArray( VLAN_SIZE_G- 1 downto 0)
out obMacBypMasterAxiStreamMasterType
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
VLAN_VID_GSlv12Array :=( 0=> x"001")
PRIM_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
CASCADE_PAUSE_SEL_Gnatural := 0
out ibMacBypSlaveAxiStreamSlaveType
in bypCtrlAxiStreamCtrlType
VLAN_EN_Gboolean := false
in ethConfigEthMacConfigType
DROP_ERR_PKT_Gboolean := true
VLAN_COMMON_CLK_Gboolean := false
AxiStreamCtrlType mPrimCtrl
AxiStreamMasterType mPrimMaster
PHY_TYPE_Gstring := "XGMII"
out ibMacVlanSlavesAxiStreamSlaveArray( VLAN_SIZE_G- 1 downto 0)
VLAN_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
BYP_ETH_TYPE_Gslv( 15 downto 0) := x"0000"
in primCtrlAxiStreamCtrlType
BYP_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
out xgmiiTxcslv( 7 downto 0)
VLAN_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
PHY_TYPE_Gstring := "XGMII"
out rxPauseValueslv( 15 downto 0)
PRIM_COMMON_CLK_Gboolean := false
AxiStreamSlaveType :=(tReady => '1') AXI_STREAM_SLAVE_FORCE_C
in sPrimMasterAxiStreamMasterType
in sVlanMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
in gmiiRxdslv( 7 downto 0) :=( others => '0')
out flowCtrlAxiStreamCtrlType
BYP_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
out xlgmiiTxcslv( 15 downto 0)
in ethConfigEthMacConfigType
in sPrimMasterAxiStreamMasterType
in sVlanMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
in xgmiiRxdslv( 63 downto 0)
in obMacBypSlaveAxiStreamSlaveType := AXI_STREAM_SLAVE_FORCE_C
out ethStatusEthMacStatusType
PHY_TYPE_Gstring := "XGMII"
BYP_CONFIG_GAxiStreamConfigType := EMAC_AXIS_CONFIG_C
out xgmiiTxdslv( 63 downto 0)
in ibMacBypMasterAxiStreamMasterType := AXI_STREAM_MASTER_INIT_C
out mVlanMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
out sVlanSlavesAxiStreamSlaveArray( VLAN_SIZE_G- 1 downto 0)
INT_PIPE_STAGES_Gnatural := 1
in mVlanCtrlAxiStreamCtrlArray( VLAN_SIZE_G- 1 downto 0)
DROP_ERR_PKT_Gboolean := true
out sBypSlaveAxiStreamSlaveType
CASCADE_SIZE_Gpositive := 2
AxiStreamConfigType :=(TSTRB_EN_C => false,TDATA_BYTES_C => 16,TDEST_BITS_C => 8,TID_BITS_C => 0,TKEEP_MODE_C => TKEEP_COMP_C,TUSER_BITS_C => 4,TUSER_MODE_C => TUSER_FIRST_LAST_C) EMAC_AXIS_CONFIG_C
out xlgmiiTxcslv( 15 downto 0)
AxiStreamSlaveType sPrimSlave
VLAN_EN_Gboolean := false
out gmiiTxdslv( 7 downto 0)
out sVlanCtrlAxiStreamCtrlArray( VLAN_SIZE_G- 1 downto 0)
PAUSE_512BITS_Gpositive range 1 to 1024:= 8
in obMacVlanSlavesAxiStreamSlaveArray( VLAN_SIZE_G- 1 downto 0) :=( others => AXI_STREAM_SLAVE_FORCE_C)