1 -------------------------------------------------------------------------------     2 -- File       : IpV4EngineDeMux.vhd     3 -- Company    : SLAC National Accelerator Laboratory     4 -- Created    : 2015-08-12     5 -- Last update: 2016-09-16     6 -------------------------------------------------------------------------------     7 -- Description: IPv4 AXIS DEMUX 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_unsigned.
all;
    21 use ieee.std_logic_arith.
all;
    29  --! @ingroup ethernet_IpV4Engine    35       -- Local Configurations    36       localMac     : 
in  slv(
47 downto 0);  --  big-Endian 
configuration       52    constant BROADCAST_MAC_C : slv(47 downto 0) := (others => '1');
    59    type RegType is record    69    constant REG_INIT_C : RegType := (    78    signal r   : RegType := REG_INIT_C;
    86       -- Latch the current value    89       -- Reset strobing signals       98       -- Check if there is data to move   100          ----------------------------------------------------------------------   101          -- Checking for non-VLAN   102          ----------------------------------------------------------------------            106             -- Check for SOF and not EOF   111                -- Check for a valid ARP EtherType   113                   -- Check the destination MAC address   118                -- Check for a valid IPV4 EtherType and (IPVersion + Header length)   120                   -- Check the destination MAC address   126             elsif r.arpSel = '1' then   128             elsif r.ipv4Sel = '1' then   136          ----------------------------------------------------------------------   138          ----------------------------------------------------------------------            142                ----------------------------------------------------------------------   146                   -- Check for SOF and not EOF   148                      -- Check for a valid VLAN EtherType   153                         -- Latch the data bus   159                ----------------------------------------------------------------------   161                   -- Check for a valid ARP EtherType   163                      -- Check the destination MAC address   164                      if(r.dly.tData(47 downto 0) = BROADCAST_MAC_C) or (r.dly.tData(47 downto 0) = localMac) then   168                   -- Check for a valid IPV4 EtherType and (IPVersion + Header length)   170                      -- Check the destination MAC address   171                      if(r.dly.tData(47 downto 0) = BROADCAST_MAC_C) or (r.dly.tData(47 downto 0) = localMac) then   178                ----------------------------------------------------------------------   182                   if r.arpSel = '1' then   184                   elsif r.ipv4Sel = '1' then   191             ----------------------------------------------------------------------   201       -- Register the variable for next clock cycle   211    seq : 
process (
clk) 
is   213       if (rising_edge(clk)) then   214          r <= rin after TPD_G;
 
slv( 15 downto  0)  := x"0008" IPV4_TYPE_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 obMacMasterAxiStreamMasterType  
 
out ibArpMasterAxiStreamMasterType  
 
out ibIpv4MasterAxiStreamMasterType  
 
out obMacSlaveAxiStreamSlaveType  
 
slv( 15 downto  0)  := x"0608" ARP_TYPE_C
 
AxiStreamSlaveType  :=(tReady  => '0') AXI_STREAM_SLAVE_INIT_C
 
slv( 15 downto  0)  := x"0081" VLAN_TYPE_C
 
in localMacslv( 47 downto  0)  
 
in ibArpSlaveAxiStreamSlaveType  
 
in ibIpv4SlaveAxiStreamSlaveType  
 
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