1 ------------------------------------------------------------------------------- 2 -- File : AxiDac7654Reg.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-09-24 5 -- Last update: 2014-09-25 6 ------------------------------------------------------------------------------- 7 -- Description: AXI-Lite Register Access 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;
28 --! @ingroup devices_Ti_dac7654 35 -- AXI-Lite Register Interface (axiClk domain) 42 -- Register Inputs/Outputs (axiClk domain) 44 config :
out AxiDac7654ConfigType);
54 type RegType is record 55 config : AxiDac7654ConfigType;
61 constant REG_INIT_C : RegType := ( 67 signal r : RegType := REG_INIT_C;
74 ------------------------------- 75 -- Configuration Register 76 ------------------------------- 80 variable axiWriteResp : slv(1 downto 0);
81 variable axiReadResp : slv(1 downto 0);
83 -- Latch the current value 86 -- Determine the transaction type 90 -- Check for an out of 32 bit aligned address 92 -- Decode address and perform write 120 -- Check for an out of 32 bit aligned address 122 -- Reset the register 124 -- Decode address and assign read data 143 ---------------------------------------------------------------------- 146 ---------------------------------------------------------------------- 152 ---------------------------------------------------------------------- 154 -- De-assert the flag 156 -- Check for ACK strobe 157 if syncIn.spi.ack = '1' then 161 ---------------------------------------------------------------------- 169 -- Register the variable for next clock cycle 180 if rising_edge(axiClk) then 181 r <= rin after TPD_G;
185 ------------------------------- 186 -- Synchronization: Outputs 187 ------------------------------- 188 config.spi <= r.config.spi;
190 ------------------------------- 191 -- Synchronization: Inputs 192 -------------------------------
STATUS_CNT_WIDTH_Gnatural range 1 to 32:= 32
AxiLiteStatusType axiStatus
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
AxiLiteReadSlaveType :=(arready => '0',rdata =>( others => '0'),rresp =>( others => '0'),rvalid => '0') AXI_LITE_READ_SLAVE_INIT_C
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
in axiReadMasterAxiLiteReadMasterType
slv( 1 downto 0) := "00" AXI_RESP_OK_C
out configAxiDac7654ConfigType
out axiWriteSlaveAxiLiteWriteSlaveType
in axiWriteMasterAxiLiteWriteMasterType
in statusAxiDac7654StatusType
AxiLiteWriteSlaveType :=(awready => '0',wready => '0',bresp =>( others => '0'),bvalid => '0') AXI_LITE_WRITE_SLAVE_INIT_C
out axiReadSlaveAxiLiteReadSlaveType
AxiDac7654StatusType :=(spi => AXI_DAC7654_SPI_OUT_INIT_C) AXI_DAC7654_STATUS_INIT_C
AxiDac7654ConfigType :=(spi => AXI_DAC7654_SPI_IN_INIT_C) AXI_DAC7654_CONFIG_INIT_C