1 -------------------------------------------------------------------------------     2 -- File       : Jesd32bTo16b.vhd     3 -- Company    : SLAC National Accelerator Laboratory     4 -- Created    : 2016-02-24     5 -- Last update: 2016-02-24     6 -------------------------------------------------------------------------------     7 -- Description: Converts the 32-bit JESD interface to 16-bit interface     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;
    26  --! @ingroup protocols_jesd204b    31       -- 32-bit Write Interface    37       -- 16-bit Read Interface    47    type RegType is record    51       data    : slv(15 downto 0);
    54    constant REG_INIT_C : RegType := (    58       data    => (others => '0'));
    60    signal r   : RegType := REG_INIT_C;
    65    signal data  : slv(31 downto 0);
    67    -- attribute dont_touch               : string;    68    -- attribute dont_touch of r          : signal is "TRUE";    84          -- Write Ports (wr_clk domain)    89          -- Read Ports (rd_clk domain)    96    comb : 
process (data, r, 
rdRst, valid) 
is    99       -- Latch the current value   106       -- Check if FIFO has data   107       if r.valid = '1' then   108          -- Check the 16-bit word select flag   109          if r.wordSel = '0' then   110             -- Set the flags and data bus   112             v.data    := data(15 downto 0);
   114             -- Set the flags and data bus   116             v.data    := data(31 downto 16);
   117             -- Acknowledge the FIFO read   123       if (rdRst = '1') then   127       -- Register the variable for next clock cycle   137    seq : 
process (
rdClk) 
is   139       if (rising_edge(rdClk)) then   140          r <= rin after TPD_G;
 
SYNC_STAGES_Ginteger   range  3 to ( 2** 24):= 3
 
out doutslv(   DATA_WIDTH_G- 1 downto  0)  
 
DATA_WIDTH_Ginteger   range  1 to ( 2** 24):= 16
 
ALTERA_SYN_Gboolean  :=   false
 
ADDR_WIDTH_Ginteger   range  2 to  48:= 4
 
out dataOutslv( 15 downto  0)  
 
FWFT_EN_Gboolean  :=   false
 
in dataInslv( 31 downto  0)  
 
in dinslv(   DATA_WIDTH_G- 1 downto  0)