SURF  1.0
AxiAd9467Deser.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : AxiAd9467Deser.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2014-09-23
5 -- Last update: 2014-09-24
6 -------------------------------------------------------------------------------
7 -- Description: Wrapper for AxiAd9467DeserBit modules
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 -------------------------------------------------------------------------------
17 
18 library ieee;
19 use ieee.std_logic_1164.all;
20 use ieee.std_logic_unsigned.all;
21 use ieee.std_logic_arith.all;
22 
23 use work.StdRtlPkg.all;
24 use work.AxiAd9467Pkg.all;
25 
26 library unisim;
27 use unisim.vcomponents.all;
28 
29 --! @see entity
30  --! @ingroup devices_AnalogDevices_ad9467
31 entity AxiAd9467Deser is
32  generic (
33  TPD_G : time := 1 ns;
34  DELAY_INIT_G : Slv5Array(0 to 7) := (others => "00000");
35  IODELAY_GROUP_G : string := "AXI_AD9467_IODELAY_GRP");
36  port (
37  --ADC I/O ports
38  adcDataOrP : in sl;
39  adcDataOrN : in sl;
40  adcDataInP : in slv(7 downto 0);
41  adcDataInN : in slv(7 downto 0);
42  -- ADC Interface
43  adcClk : in sl;
44  adcRst : in sl;
45  adcData : out slv(15 downto 0);
46  -- IDELAY Interface
50 end AxiAd9467Deser;
51 
52 architecture rtl of AxiAd9467Deser is
53 
54  signal adcDataPs,
55  adcDataNs,
56  adcDataP,
57  adcDataN,
58  adcDataNd,
59  adcDmuxA,
60  adcDmuxB : slv(7 downto 0) := (others => '0');
61 
62  attribute IODELAY_GROUP : string;
63  attribute IODELAY_GROUP of IDELAYCTRL_Inst : label is IODELAY_GROUP_G;
64 
65 begin
66 
67  IBUFDS_OR : IBUFDS
68  generic map (
69  DIFF_TERM => true)
70  port map(
71  I => adcDataOrP,
72  IB => adcDataOrN,
73  O => open);
74 
75  IDELAYCTRL_Inst : IDELAYCTRL
76  port map (
77  RDY => delayOut.rdy, -- 1-bit output: Ready output
78  REFCLK => refClk200MHz, -- 1-bit input: Reference clock input
79  RST => delayIn.rst); -- 1-bit input: Active high reset input
80 
81  GEN_DAT :
82  for i in 0 to 7 generate
83 
84  AxiAd9467DeserBit_Inst : entity work.AxiAd9467DeserBit
85  generic map(
86  TPD_G => TPD_G,
89  port map (
90  -- ADC Data (clk domain)
91  dataP => adcDataInP(i),
92  dataN => adcDataInN(i),
93  Q1 => adcDataPs(i),
94  Q2 => adcDataNs(i),
95  -- IO_Delay (refClk200MHz domain)
96  delayInLoad => delayIn.load,
97  delayInData => delayIn.data(i),
98  delayOutData => delayOut.data(i),
99  -- Clocks
100  clk => adcClk,
101  refClk200MHz => refClk200MHz);
102 
103  end generate GEN_DAT;
104 
105  process(adcClk)
106  variable i : integer;
107  begin
108  if rising_edge(adcClk) then
109  adcDataP <= adcDataPs after TPD_G;
110  adcDataN <= adcDataNs after TPD_G;
111  adcDataNd <= adcDataN after TPD_G;
112  if delayin.dmux = '0' then
113  adcDmuxA <= adcDataN after TPD_G;
114  adcDmuxB <= adcDataP after TPD_G;
115  else
116  adcDmuxA <= adcDataP after TPD_G;
117  adcDmuxB <= adcDataNd after TPD_G;
118  end if;
119  for i in 7 downto 0 loop
120  adcData(2*i+1) <= adcDmuxB(i) after TPD_G;
121  adcData(2*i) <= adcDmuxA(i) after TPD_G;
122  end loop;
123  end if;
124  end process;
125 
126 end rtl;
in adcDataInNslv( 7 downto 0)
out delayOutDataslv( 4 downto 0)
in adcDataInPslv( 7 downto 0)
in delayInDataslv( 4 downto 0)
DELAY_INIT_GSlv5Array( 0 to 7) :=( others => "00000")
std_logic sl
Definition: StdRtlPkg.vhd:28
_library_ ieeeieee
IODELAY_GROUP_Gstring := "AXI_AD9467_IODELAY_GRP"
TPD_Gtime := 1 ns
out delayOutAxiAd9467DelayOutType
DELAY_INIT_Gslv( 4 downto 0) :=( others => '0')
out adcDataslv( 15 downto 0)
IODELAY_GROUP_Gstring := "AXI_AD9467_IODELAY_GRP"
in delayinAxiAd9467DelayInType
array(natural range <> ) of slv( 4 downto 0) Slv5Array
Definition: StdRtlPkg.vhd:406
std_logic_vector slv
Definition: StdRtlPkg.vhd:29