1 ------------------------------------------------------------------------------- 2 -- File : JesdSyncFsmTx.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2015-04-14 5 -- Last update: 2015-04-14 6 ------------------------------------------------------------------------------- 7 -- Description: Synchronizer TX Finite state machine 8 -- Finite state machine for sub-class 1 and sub-class 0 deterministic latency 9 -- lane synchronization. 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_arith.
all;
23 use ieee.std_logic_unsigned.
all;
29 --! @ingroup protocols_jesd204b 33 --JESD204B class (0 and 1 supported) 35 -- Number of multi-frames in ILA sequence (4-255) 42 -- JESD subclass selection: '0' or '1'(default) 48 -- Local multi frame clock 51 -- Synchronization request 54 -- GT is ready to transmit data after reset 57 -- SYSREF for subclass 1 fixed latency 60 -- Synchronization process is complete start sending data 66 -- Initial lane synchronization sequence indicator 80 type RegType is record 81 -- Synchronous FSM control outputs 86 cnt : slv(7 downto 0);
92 constant REG_INIT_C : RegType := ( 96 cnt => (others => '0'), 102 signal r : RegType := REG_INIT_C;
103 signal rin : RegType;
109 variable v : RegType;
111 -- Latch the current value 116 ---------------------------------------------------------------------- 120 v.cnt := (others => '0');
125 -- Next state condition (depending on subclass) 135 ---------------------------------------------------------------------- 139 v.cnt := (others => '0');
144 -- Next state condition 150 ---------------------------------------------------------------------- 158 -- Increase lmfc counter. 163 -- Next state condition 164 -- After NUM_ILAS_MF_G LMFC clocks the ILA sequence ends and relevant ADC data is being received. 170 ---------------------------------------------------------------------- 174 v.cnt := r.cnt+GT_WORD_SIZE_C;
-- two or four data bytes sent in parallel 179 -- Next state condition 183 ---------------------------------------------------------------------- 187 v.cnt := (others => '0');
192 -- Next state condition 194 ---------------------------------------------------------------------- 202 -- Register the variable for next clock cycle 207 seq :
process (
clk)
is 209 if rising_edge(clk) then 210 r <= rin after TPD_G;
218 ----------------------------------------------
NUM_ILAS_MF_Gpositive := 4
positive := 4 GT_WORD_SIZE_C