1 ------------------------------------------------------------------------------- 2 -- File : Jesd16bTo32b.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2016-02-24 5 -- Last update: 2016-02-24 6 ------------------------------------------------------------------------------- 7 -- Description: Converts the 16-bit interface to 32-bit JESD 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 -- 16-bit Write Interface 37 -- 32-bit Read Interface 47 type RegType is record 50 data : slv(31 downto 0);
53 constant REG_INIT_C : RegType := ( 56 data => (others => '0'));
58 signal r : RegType := REG_INIT_C;
67 -- Latch the current value 70 -- Check if data valid 72 if r.wordSel = '0' then 73 -- Set the flags and data bus 75 v.data(15 downto 0) := dataIn;
78 -- Set the flags and data bus 80 v.data(31 downto 16) := dataIn;
92 -- Register the variable for next clock cycle 108 -- Asynchronous Reset 110 -- Write Ports (wr_clk domain) 115 -- Read Ports (rd_clk domain) 124 seq :
process (
wrClk)
is 126 if (rising_edge(wrClk)) then 127 r <= rin after TPD_G;
in dataInslv( 15 downto 0)
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
out dataOutslv( 31 downto 0)
ALTERA_SYN_Gboolean := false
ADDR_WIDTH_Ginteger range 2 to 48:= 4
FWFT_EN_Gboolean := false
in dinslv( DATA_WIDTH_G- 1 downto 0)