SURF  1.0
AxiAd5780Core.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : AxiAd5780Core.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2014-04-18
5 -- Last update: 2014-05-18
6 -------------------------------------------------------------------------------
7 -- Description: AXI-Lite interface to AD5780 DAC IC
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 
21 use work.StdRtlPkg.all;
22 use work.AxiLitePkg.all;
23 use work.AxiAd5780Pkg.all;
24 
25 --! @see entity
26  --! @ingroup devices_AnalogDevices_ad5780
27 entity AxiAd5780Core is
28  generic (
29  TPD_G : time := 1 ns;
30  STATUS_CNT_WIDTH_G : natural range 1 to 32 := 32;
31  USE_DSP48_G : string := "no"; -- "no" for no DSP48 implementation, "yes" to use DSP48 slices
32  AXI_CLK_FREQ_G : real := 200.0E+6; -- units of Hz
33  SPI_CLK_FREQ_G : real := 25.0E+6; -- units of Hz
35  port (
36  -- DAC Ports
39  -- DAC Data Interface (axiClk domain)
40  dacData : in slv(17 downto 0); -- 2's complement by default
41  -- AXI-Lite Register Interface (axiClk domain)
46  -- Clocks and Resets
47  axiClk : in sl;
48  axiRst : in sl);
49 end AxiAd5780Core;
50 
51 architecture rtl of AxiAd5780Core is
52 
53  signal status : AxiAd5780StatusType;
54  signal config : AxiAd5780ConfigType;
55 
56  signal dacRst : sl;
57  signal dacDataMux : slv(17 downto 0);
58 
59 begin
60 
61  status.dacData <= dacData;
62 
63  AxiAd5780Reg_Inst : entity work.AxiAd5780Reg
64  generic map(
65  TPD_G => TPD_G,
71  port map(
72  -- AXI-Lite Register Interface
77  -- Register Inputs/Outputs
78  status => status,
79  config => config,
80  -- Clock and reset
81  axiClk => axiClk,
82  axiRst => axiRst,
83  dacRst => dacRst);
84 
85  process(axiClk)
86  begin
87  if rising_edge(axiClk) then
88  if config.debugMux = '1' then
89  dacDataMux <= config.debugData after TPD_G;
90  else
91  dacDataMux <= status.dacData after TPD_G;
92  end if;
93  end if;
94  end process;
95 
96  AxiAd5780Ser_Inst : entity work.AxiAd5780Ser
97  generic map(
98  TPD_G => TPD_G,
100  port map(
101  -- DAC Ports
102  dacIn => dacIn,
103  dacOut => dacOut,
104  -- DAC Data Interface (axiClk domain)
105  halfSckPeriod => config.halfSckPeriod,
106  sdoDisable => config.sdoDisable,
107  binaryOffset => config.binaryOffset,
108  dacTriState => config.dacTriState,
109  opGnd => config.opGnd,
110  rbuf => config.rbuf,
111  dacData => dacDataMux,
112  dacUpdated => status.dacUpdated,
113  -- Clocks and Resets
114  axiClk => axiClk,
115  axiRst => axiRst,
116  dacRst => dacRst);
117 
118 end rtl;
in dacTriStatesl
out dacUpdatedsl
out dacOutAxiAd5780OutType
out axiReadSlaveAxiLiteReadSlaveType
out axiWriteSlaveAxiLiteWriteSlaveType
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
in axiWriteMasterAxiLiteWriteMasterType
SPI_CLK_FREQ_Greal := 25.0E+6
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
out axiWriteSlaveAxiLiteWriteSlaveType
in axiReadMasterAxiLiteReadMasterType
STATUS_CNT_WIDTH_Gnatural range 1 to 32:= 32
in sdoDisablesl
in statusAxiAd5780StatusType
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
Definition: AxiLitePkg.vhd:36
slv( 17 downto 0) debugData
in dacInAxiAd5780InType
out configAxiAd5780ConfigType
USE_DSP48_Gstring := "no"
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
TPD_Gtime := 1 ns
SPI_CLK_FREQ_Greal := 25.0E+6
out axiReadSlaveAxiLiteReadSlaveType
in dacDataslv( 17 downto 0)
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
in binaryOffsetsl
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
in halfSckPeriodslv( 31 downto 0)
TPD_Gtime := 1 ns
AXI_CLK_FREQ_Greal := 200.0E+6
out dacOutAxiAd5780OutType
AXI_CLK_FREQ_Greal := 200.0E+6
USE_DSP48_Gstring := "no"
in dacInAxiAd5780InType
STATUS_CNT_WIDTH_Gnatural range 1 to 32:= 32
AXI_CLK_FREQ_Greal := 200.0E+6
TPD_Gtime := 1 ns
in axiWriteMasterAxiLiteWriteMasterType
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
in axiReadMasterAxiLiteReadMasterType
in dacDataslv( 17 downto 0)