1 -------------------------------------------------------------------------------     2 -- File       : SspFramer.vhd     3 -- Company    : SLAC National Accelerator Laboratory     4 -- Created    : 2014-07-14     5 -- Last update: 2017-05-01     6 -------------------------------------------------------------------------------     7 -- Description: SimpleStreamingProtocol - A simple protocol layer for inserting     8 -- idle and framing control characters into a raw data stream. The output of     9 -- module should be attached to an 8b10b encoder.    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_UNSIGNED.
all;
    23 use IEEE.STD_LOGIC_ARITH.
all;
    28  --! @ingroup protocols_ssp    63    constant IDLE_MODE_C : sl := '0';
    64    constant DATA_MODE_C : sl := '1';
    66    type RegType is record    78    constant REG_INIT_C : RegType := (    84       dataInLast  => (others => '0'),    89    signal r   : RegType := REG_INIT_C;
   111          -- Send commas while waiting for valid, then send SOF   112          if (r.mode = IDLE_MODE_C) then   118                v.mode     := DATA_MODE_C;
   121          -- Send pipline delayed data, send eof when delayed valid falls   122          elsif (r.mode = DATA_MODE_C) then   125             v.eof      := r.validInLast and r.eofLast;
   126             if (r.validInLast = '0') then   130                   v.mode     := IDLE_MODE_C;
   132                   -- if not auto framing and valid drops, insert idle char   154    -- Sequential process   155    seq : 
process (
clk, 
rst) 
is   158          r <= REG_INIT_C after TPD_G;
   159       elsif (rising_edge(clk)) then   160          r <= rin after TPD_G;
   164 end architecture rtl;
 
in rstsl  :=   RST_POLARITY_G
 
in dataInslv(   WORD_SIZE_G- 1 downto  0)  
 
out dataKOutslv(   K_SIZE_G- 1 downto  0)  
 
out dataOutslv(   WORD_SIZE_G- 1 downto  0)  
 
FLOW_CTRL_EN_Gboolean  :=   false
 
RST_ASYNC_Gboolean  :=   true
 
AUTO_FRAME_Gboolean  :=   true