1 -------------------------------------------------------------------------------     2 -- File       : RawEthFramer.vhd     3 -- Company    : SLAC National Accelerator Laboratory     4 -- Created    : 2016-05-23     5 -- Last update: 2016-05-26     6 -------------------------------------------------------------------------------     7 -- Description: Top-level Raw L2 Ethernet Framer     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;
    27  --! @ingroup ethernet_RawEthFramer    31       ETH_TYPE_G : slv(15 downto 0) := x"0010");
  --  0x1000 (big-Endian configuration)    33       -- Local Configurations    34       localMac    : 
in  slv(
47 downto 0);         --  big-Endian 
configuration    37       -- Interface to Ethernet Media Access Controller (MAC)    42       -- Interface to Application engine(s)    59    type RegType is record    62       rxMac : slv(47 downto 0);
    63       txMac : slv(47 downto 0);
    68    constant REG_INIT_C : RegType := (    71       rxMac => (others => '0'),    72       txMac => (others => '0'),    74       tDest => (others => '0'),    77    signal r   : RegType := REG_INIT_C;
    82    signal rxDest : slv(7 downto 0);
    83    signal txDest : slv(7 downto 0);
    86    signal rxMac  : slv(47 downto 0);
    87    signal txMac  : slv(47 downto 0);
    89    -- attribute dont_touch           : string;    90    -- attribute dont_touch of r      : signal is "TRUE";    99          -- Local Configurations   105          -- Interface to Ethernet Media Access Controller (MAC)   108          -- Interface to Application engine(s)   120          -- Local Configurations   126          -- Interface to Ethernet Media Access Controller (MAC)   129          -- Interface to Application engine(s)   136    comb : 
process (r, 
remoteMac, 
rst, rxDest, rxReq, txDest, txReq) 
is   137       variable v : RegType;
   139       -- Latch the current value   151          ----------------------------------------------------------------------   153             -- Check for RX request   154             if (r.rxAck = '0') and (rxReq = '1') then   161             elsif (r.txAck = '0') and (txReq = '1') then   169          ----------------------------------------------------------------------   171             -- Check if data is ready   180          ----------------------------------------------------------------------   182             -- Check if data is ready   191       ----------------------------------------------------------------------   199       -- Register the variable for next clock cycle   211    seq : 
process (
clk) 
is   213       if rising_edge(clk) then   214          r <= rin after TPD_G;
 
in ibAppSlaveAxiStreamSlaveType  
 
in ibAppSlaveAxiStreamSlaveType  
 
out ibMacMasterAxiStreamMasterType  
 
out ibAppMasterAxiStreamMasterType  
 
ETH_TYPE_Gslv( 15 downto  0)  := x"0010"
 
in remoteMacslv( 47 downto  0)  
 
out obAppSlaveAxiStreamSlaveType  
 
out tDestslv( 7 downto  0)  
 
in obAppMasterAxiStreamMasterType  
 
in remoteMacslv( 47 downto  0)  
 
out ibMacMasterAxiStreamMasterType  
 
in ibMacSlaveAxiStreamSlaveType  
 
in obMacMasterAxiStreamMasterType  
 
out tDestslv( 7 downto  0)  
 
in localMacslv( 47 downto  0)  
 
out obMacSlaveAxiStreamSlaveType  
 
ETH_TYPE_Gslv( 15 downto  0)  := x"0010"
 
in obMacMasterAxiStreamMasterType  
 
out obAppSlaveAxiStreamSlaveType  
 
out ibAppMasterAxiStreamMasterType  
 
out obMacSlaveAxiStreamSlaveType  
 
in remoteMacslv( 47 downto  0)  
 
in localMacslv( 47 downto  0)  
 
in ibMacSlaveAxiStreamSlaveType  
 
in obAppMasterAxiStreamMasterType  
 
ETH_TYPE_Gslv( 15 downto  0)  := x"0010"
 
in localMacslv( 47 downto  0)  
 
out tDestslv( 7 downto  0)