1 ------------------------------------------------------------------------------- 2 -- File : JesdTestSigGen.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2015-04-15 5 -- Last update: 2015-04-15 6 ------------------------------------------------------------------------------- 7 -- Description: Outputs a digital signal depending on thresholds 8 -- This is a test module so only F_G = 2 9 -- and is GT_WORD_SIZE_C = 4 is supported. 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;
29 --! @ingroup protocols_jesd204b 34 -- Number of bytes in a frame 43 -- Threshold for Rising edge detection 53 end entity JesdTestSigGen;
57 type RegType is record 61 constant REG_INIT_C : RegType := ( 65 signal r : RegType := REG_INIT_C;
73 -- Buffer two GT words. And compare previous and current samples to threshold. 74 -- If the difference between the previous and current sample is higher than threshold 76 --------------------------------------------------------------------- 77 --------------------------------------------------------------------- 83 -- if ( signed(s_sampleDataBr((F_G*8)-1 downto 0) ) > signed(thresoldHigh_i)) then 86 -- elsif ( signed(s_sampleDataBr((F_G*8)-1 downto 0) ) < signed(thresoldLow_i)) then 98 ----------------------------------------------------------- 101 seq :
process (
clk)
is 103 if (rising_edge(clk)) then 104 r <= rin after TPD_G;
107 --------------------------------------------------------------------- 108 --------------------------------------------------------------------- 109 end architecture rtl;
in sampleData_islv(( GT_WORD_SIZE_C* 8)- 1 downto 0)
in thresoldHigh_islv(( F_G* 8)- 1 downto 0)
positive := 4 GT_WORD_SIZE_C
in thresoldLow_islv(( F_G* 8)- 1 downto 0)