1 ------------------------------------------------------------------------------- 2 -- File : AxiXcf128Reg.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-04-18 5 -- Last update: 2015-01-13 6 ------------------------------------------------------------------------------- 7 -- Description: AXI-Lite Register Access 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_Xilinx_xcf128 35 -- AXI-Lite Register Interface 40 -- Register Inputs/Outputs 42 config :
out AxiXcf128ConfigType;
60 type RegType is record 61 dataReg : slv(15 downto 0);
64 cnt : range 0 to MAX_CNT_C;
65 config : AxiXcf128ConfigType;
71 constant REG_INIT_C : RegType := ( 73 (others => (others => '0')), 81 signal r : RegType := REG_INIT_C;
86 ------------------------------- 87 -- Configuration Register 88 ------------------------------- 92 variable axiWriteResp : slv(1 downto 0);
93 variable axiReadResp : slv(1 downto 0);
95 -- Latch the current value 98 -- Determine the transaction type 101 -- Reset strobe signals 102 -- *** place holder *** 105 -- Check for an out of 32 bit aligned address 110 -- Check the write address 112 -- Set the write data bus 120 -- Set the address bus 123 v.state := CMD_LOW_S;
130 -- Check for an out of 32 bit aligned address 132 -- Reset the register 134 -- Check the read address 136 -- Get the write data bus 139 -- Get the address bus 142 -- Get the read data bus 153 ---------------------------------------------------------------------- 159 ---------------------------------------------------------------------- 166 -- Increment the counter 169 if r.cnt = MAX_CNT_C then 173 v.state := CMD_HIGH_S;
175 ---------------------------------------------------------------------- 182 -- Increment the counter 185 if r.cnt = MAX_CNT_C then 191 ---------------------------------------------------------------------- 198 -- Increment the counter 201 if r.cnt = MAX_CNT_C then 205 v.state := DATA_LOW_S;
207 ---------------------------------------------------------------------- 214 -- Increment the counter 217 if r.cnt = MAX_CNT_C then 220 -- Latch the data bus value 223 v.state := DATA_HIGH_S;
225 ---------------------------------------------------------------------- 232 -- Increment the counter 235 if r.cnt = MAX_CNT_C then 243 ---------------------------------------------------------------------- 251 -- Register the variable for next clock cycle 264 if rising_edge(axiClk) then 265 r <= rin after TPD_G;
out axiReadSlaveAxiLiteReadSlaveType
in axiWriteMasterAxiLiteWriteMasterType
in statusAxiXcf128StatusType
in axiReadMasterAxiLiteReadMasterType
out configAxiXcf128ConfigType
AxiLiteStatusType axiStatus
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
AxiXcf128ConfigType :=( '1', '1', '1', '0',( others => '1'), '1',( others => '1')) AXI_XCF128_CONFIG_INIT_C
AxiLiteReadSlaveType :=(arready => '0',rdata =>( others => '0'),rresp =>( others => '0'),rvalid => '0') AXI_LITE_READ_SLAVE_INIT_C
array(natural range <> ) of slv( 15 downto 0) Slv16Array
out axiWriteSlaveAxiLiteWriteSlaveType
slv( 1 downto 0) := "00" AXI_RESP_OK_C
AxiLiteWriteSlaveType :=(awready => '0',wready => '0',bresp =>( others => '0'),bvalid => '0') AXI_LITE_WRITE_SLAVE_INIT_C
AXI_CLK_FREQ_Greal := 200.0E+6