1 ------------------------------------------------------------------------------- 2 -- File : EthMacRxPause.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2015-09-21 5 -- Last update: 2016-10-20 6 ------------------------------------------------------------------------------- 8 -- Generic pause frame receiver for Ethernet MACs. Pause frames are dropped 9 -- from the incoming data stream. 10 ------------------------------------------------------------------------------- 11 -- This file is part of 'SLAC Firmware Standard Library'. 12 -- It is subject to the license terms in the LICENSE.txt file found in the 13 -- top-level directory of this distribution and at: 14 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 15 -- No part of 'SLAC Firmware Standard Library', including this file, 16 -- may be copied, modified, propagated, or distributed except according to 17 -- the terms contained in the LICENSE.txt file. 18 ------------------------------------------------------------------------------- 21 use ieee.std_logic_1164.
all;
22 use ieee.std_logic_arith.
all;
23 use ieee.std_logic_unsigned.
all;
30 --! @ingroup ethernet_EthMacCore 42 -- Incoming data from MAC 61 type RegType is record 64 pauseValue : slv(15 downto 0);
70 constant REG_INIT_C : RegType := ( 73 pauseValue => (others => '0'), 78 signal r : RegType := REG_INIT_C;
81 -- attribute dont_touch : string; 82 -- attribute dont_touch of r : signal is "true"; 92 variable vid : slv(11 downto 0);
94 -- Latch the current value 104 -- Update the variable 111 ---------------------------------------------------------------------- 115 -- Check for pause frame 117 (sAxisMaster.tData(47 downto 0) = x"010000c28001") and -- DST MAC (Pause MAC Address) 118 (sAxisMaster.tData(127 downto 96) = x"01000888") then -- Mac Type, Mac OpCode 137 if (vidDet = false) and (vid = VLAN_VID_G(i)) then 161 ---------------------------------------------------------------------- 163 ---------------------------------------------------------------------------------------------------------- 164 -- Refer to https://www.safaribooksonline.com/library/view/ethernet-the-definitive/1565926609/ch04s02.html 165 ---------------------------------------------------------------------------------------------------------- 168 -- Latch the pause data 182 ---------------------------------------------------------------------- 184 -- Check for a valid EOF 191 ---------------------------------------------------------------------- 195 -- Check for a valid EOF 200 ---------------------------------------------------------------------- 204 -- Check for a valid EOF 209 ---------------------------------------------------------------------- 217 -- Register the variable for next clock cycle 230 if rising_edge(ethClk) then 231 r <= rin after TPD_G;
out mAxisMastersAxiStreamMasterArray( VLAN_SIZE_G- 1 downto 0)
array(natural range <> ) of slv( 11 downto 0) Slv12Array
in sAxisMasterAxiStreamMasterType
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
out mAxisMasterAxiStreamMasterType
VLAN_EN_Gboolean := false
out rxPauseValueslv( 15 downto 0)
VLAN_VID_GSlv12Array :=( 0=> x"001")
VLAN_SIZE_Gpositive range 1 to 8:= 1
integer := 0 EMAC_EOFE_BIT_C
PAUSE_EN_Gboolean := true
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
slv( 15 downto 0) := x"0081" VLAN_TYPE_C
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