1 ------------------------------------------------------------------------------- 2 -- File : RawEthFramerRx.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2016-05-23 5 -- Last update: 2016-05-26 6 ------------------------------------------------------------------------------- 7 -- Description: Raw L2 Ethernet Framer's RX Engine 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_unsigned.
all;
21 use ieee.std_logic_arith.
all;
29 --! @ingroup ethernet_RawEthFramer 33 ETH_TYPE_G : slv(15 downto 0) := x"0010");
-- 0x1000 (big-Endian configuration) 35 -- Local Configurations 36 localMac :
in slv(
47 downto 0); -- big-Endian
configuration 41 -- Interface to Ethernet Media Access Controller (MAC) 44 -- Interface to Application engine(s) 54 constant BC_MAC_C : slv(47 downto 0) := x"FFFFFFFFFFFF";
62 type RegType is record 65 dstMac : slv(47 downto 0);
66 srcMac : slv(47 downto 0);
67 minByteCnt : range 0 to 127;
75 constant REG_INIT_C : RegType := ( 78 dstMac => (others => '0'), 79 srcMac => (others => '0'), 88 signal r : RegType := REG_INIT_C;
91 -- attribute dont_touch : string; 92 -- attribute dont_touch of r : signal is "TRUE"; 99 -- Latch the current value 113 ---------------------------------------------------------------------- 119 -- Latch the DST MAC and SRC MAC 124 -- Check the DEST MAC 131 ---------------------------------------------------------------------- 139 -- Latch the tDest & BC 142 -- Get the min. byte cache count 144 -- Check for invalid size or invalid EtherType 148 -- Check for invalid size 149 elsif (v.minByteCnt /= 0) and (v.minByteCnt <= 16) then 152 -- Check for invalid broadcast message 153 elsif (v.bcf = '1') and ((v.ibAppMaster.tDest /= x"FF") or (r.dstMac /= BC_MAC_C)) then 163 ---------------------------------------------------------------------- 165 if (ack = '1') or (r.bcf = '1') then 169 if r.minByteCnt = 0 then 175 -- Remove the header offset 176 v.minByteCnt := r.minByteCnt - 16;
178 -- Check for valid SRC MAC or broadcast 187 ---------------------------------------------------------------------- 189 -- Check if ready to move data 201 -- Set the SOF and BCF 216 -- Check if TX engine had min. ETH cache 218 -- Check for last transfer 219 if (r.minByteCnt <= 8) then 229 -- Decrement the counter 230 v.minByteCnt := r.minByteCnt - 8;
234 ---------------------------------------------------------------------- 242 -- Register the variable for next clock cycle 253 seq :
process (
clk)
is 255 if rising_edge(clk) then 256 r <= rin after TPD_G;
AxiStreamConfigType := ssiAxiStreamConfig( 8, TKEEP_COMP_C, TUSER_FIRST_LAST_C, 8, 3) RAW_ETH_CONFIG_INIT_C
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
in ibAppSlaveAxiStreamSlaveType
out ibAppMasterAxiStreamMasterType
out tDestslv( 7 downto 0)
in remoteMacslv( 47 downto 0)
in obMacMasterAxiStreamMasterType
AxiStreamSlaveType :=(tReady => '0') AXI_STREAM_SLAVE_INIT_C
out obMacSlaveAxiStreamSlaveType
ETH_TYPE_Gslv( 15 downto 0) := x"0010"
in localMacslv( 47 downto 0)