1 ------------------------------------------------------------------------------- 2 -- File : AxiAd9467Mon.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-09-23 5 -- Last update: 2014-09-24 6 ------------------------------------------------------------------------------- 7 -- Description: AD9467 Monitor Module 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 devices_AnalogDevices_ad9467 40 constant MAX_CNT_C : := getTimeRatio(ADC_CLK_FREQ_G, 1.
0);
-- 1 second refresh rate 46 type RegType is record 47 cnt : range 0 to MAX_CNT_C;
48 smplCnt : range 0 to 15;
53 constant REG_INIT_C : RegType := ( 59 signal r : RegType := REG_INIT_C;
67 -- Latch the current value 70 -- Increment the counter 75 ---------------------------------------------------------------------- 78 if r.cnt = MAX_CNT_C then 84 ---------------------------------------------------------------------- 86 -- Sample the ADC value 88 -- Increment the counter 89 v.smplCnt := r.smplCnt + 1;
91 if r.smplCnt = 15 then 97 ---------------------------------------------------------------------- 105 -- Register the variable for next clock cycle 115 if rising_edge(adcClk) then 116 r <= rin after TPD_G;
in adcDataslv( 15 downto 0)
out adcDataMonSlv16Array( 0 to 15)
ADC_CLK_FREQ_Greal := 250.0E+6
array(natural range <> ) of slv( 15 downto 0) Slv16Array