1 ------------------------------------------------------------------------------- 2 -- File : AxiAd5780Reg.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-04-18 5 -- Last update: 2016-09-20 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 ------------------------------------------------------------------------------- 19 use ieee.std_logic_1164.
all;
20 use ieee.std_logic_unsigned.
all;
21 use ieee.std_logic_arith.
all;
28 --! @ingroup devices_AnalogDevices_ad5780 33 USE_DSP48_G : := "no";
-- "no" for no DSP48 implementation, "yes" to use DSP48 slices 38 -- AXI-Lite Register Interface 43 -- Register Inputs/Outputs 45 config :
out AxiAd5780ConfigType;
55 constant HALF_SCK_PERIOD_C : := (getTimeRatio(AXI_CLK_FREQ_G, DOUBLE_SCK_FREQ_C))-1;
56 constant HALF_SCK_PERIOD_INIT_C : slv(31 downto 0) := toSlv(HALF_SCK_PERIOD_C, 32);
58 type RegType is record 60 regOut : AxiAd5780ConfigType;
65 constant REG_INIT_C : RegType := ( 71 signal r : RegType := REG_INIT_C;
81 ------------------------------- 82 -- Configuration Register 83 ------------------------------- 87 variable axiWriteResp : slv(1 downto 0);
88 variable axiReadResp : slv(1 downto 0);
90 -- Latch the current value 93 -- Determine the transaction type 96 -- Reset strobe signals 100 -- Check for an out of 32 bit aligned address 102 -- Decode address and perform write 136 -- Check for an out of 32 bit aligned address 138 -- Decode address and assign read data 174 -- Register the variable for next clock cycle 189 if rising_edge(axiClk) then 190 r <= rin after TPD_G;
194 ------------------------------- 195 -- Synchronization: Outputs 196 ------------------------------- 199 ------------------------------- 200 -- Synchronization: Inputs 201 ------------------------------- 202 regIn.dacData <= status.dacData;
214 -- Trigger Input (locClk domain) 215 trigIn => status.dacUpdated,
216 -- Trigger Rate Output (locClk domain)
out axiReadSlaveAxiLiteReadSlaveType
in axiWriteMasterAxiLiteWriteMasterType
out axiWriteSlaveAxiLiteWriteSlaveType
STATUS_CNT_WIDTH_Gnatural range 1 to 32:= 32
in statusAxiAd5780StatusType
AxiLiteStatusType axiStatus
REFRESH_RATE_Greal := 1.0E+0
AxiAd5780StatusType :=( '0',( others => '0')) AXI_AD5780_STATUS_INIT_C
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
COMMON_CLK_Gboolean := false
slv( 17 downto 0) debugData
slv( 17 downto 0) dacData
AxiAd5780ConfigType :=(( others => '1'), '1', '0', '0', '0', '1', '0',( others => '0')) AXI_AD5780_CONFIG_INIT_C
CNT_WIDTH_Gpositive := 32
SPI_CLK_FREQ_Greal := 25.0E+6
AxiLiteReadSlaveType :=(arready => '0',rdata =>( others => '0'),rresp =>( others => '0'),rvalid => '0') AXI_LITE_READ_SLAVE_INIT_C
slv( 31 downto 0) halfSckPeriod
USE_DSP48_Gstring := "no"
REF_CLK_FREQ_Greal := 200.0E+6
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
slv( 1 downto 0) := "00" AXI_RESP_OK_C
AXI_CLK_FREQ_Greal := 200.0E+6
USE_DSP48_Gstring := "no"
out trigRateOutslv( CNT_WIDTH_G- 1 downto 0)
AxiLiteWriteSlaveType :=(awready => '0',wready => '0',bresp =>( others => '0'),bvalid => '0') AXI_LITE_WRITE_SLAVE_INIT_C
in axiReadMasterAxiLiteReadMasterType