1 ------------------------------------------------------------------------------- 2 -- File : AxiLiteToDrp.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2016-02-10 5 -- Last update: 2016-02-17 6 ------------------------------------------------------------------------------- 7 -- Description: AXI-Lite to Xilinx DRP Bridge 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_arith.
all;
21 use ieee.std_logic_unsigned.
all;
48 drpGnt : in sl := '1';
-- Used if EN_ARBITRATION_G = true 49 drpReq : out sl;
-- Used if EN_ARBITRATION_G = true 57 end entity AxiLiteToDrp;
66 type RegType is record 79 constant REG_INIT_C : RegType := ( 85 drpDi => (others => '0'), 91 signal r : RegType := REG_INIT_C;
99 -- attribute dont_touch : string; 100 -- attribute dont_touch of r : signal is "true"; 137 variable v : RegType;
139 variable axiResp : slv(1 downto 0);
141 -- Latch the current value 149 -- Determine the transaction type 150 axiSlaveWaitTxn(writeMaster, readMaster, v.writeSlave, v.readSlave, axiStatus);
154 ---------------------------------------------------------------------- 159 -- Check for a write request 161 -- Set the write address bus (32-bit access alignment) 163 -- Set the write data bus 165 -- Check for DRP request/grant 170 -- Send a write command 176 -- Check for a read request 178 -- Set the write address bus (32-bit access alignment) 180 -- Check for DRP request/grant 185 -- Send a read command 192 ---------------------------------------------------------------------- 194 -- Request the DRP bus 196 -- Check for DRP bus access granted 198 -- Check for a write request 200 -- Check for non-timeout 204 -- Send a write command 210 -- Check for a read request 212 -- Check for non-timeout 216 -- Send a read command 227 -- Increment the timer 228 v.timer := r.timer + 1;
230 ---------------------------------------------------------------------- 232 -- Check for DRP acknowledgement of command 234 -- Check for non-timeout 236 -- Return good transaction 239 -- Return good transaction 241 -- Attempt to re-initialize the DRP interface 244 -- Check for a write request 246 -- Send AXI-Lite response 247 axiSlaveWriteResponse(v.writeSlave, axiResp);
248 -- Check for a read request 252 -- Send AXI-Lite Response 253 axiSlaveReadResponse(v.readSlave, axiResp);
258 -- Increment the timer 259 v.timer := r.timer + 1;
261 ---------------------------------------------------------------------- 269 -- Register the variable for next clock cycle 273 readSlave <= r.readSlave;
274 writeSlave <= r.writeSlave;
286 if (rising_edge(drpClk)) then 287 r <= rin after TPD_G;
291 end architecture rtl;
ADDR_WIDTH_Gpositive range 1 to 32:= 16
out drpAddrslv( ADDR_WIDTH_G- 1 downto 0)
EN_ARBITRATION_Gboolean := false
DATA_WIDTH_Gpositive range 1 to 32:= 16
out axilReadSlaveAxiLiteReadSlaveType
in drpDoslv( DATA_WIDTH_G- 1 downto 0)
COMMON_CLK_Gboolean := false
out mAxiReadMasterAxiLiteReadMasterType
in mAxiWriteSlaveAxiLiteWriteSlaveType
out sAxiWriteSlaveAxiLiteWriteSlaveType
out axilWriteSlaveAxiLiteWriteSlaveType
AxiLiteStatusType axiStatus
in sAxiReadMasterAxiLiteReadMasterType
in sAxiWriteMasterAxiLiteWriteMasterType
slv( 1 downto 0) := "11" AXI_RESP_DECERR_C
in axilReadMasterAxiLiteReadMasterType
TIMEOUT_Gpositive := 4096
AxiLiteReadSlaveType :=(arready => '0',rdata =>( others => '0'),rresp =>( others => '0'),rvalid => '0') AXI_LITE_READ_SLAVE_INIT_C
out sAxiReadSlaveAxiLiteReadSlaveType
in axilWriteMasterAxiLiteWriteMasterType
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
in mAxiReadSlaveAxiLiteReadSlaveType
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
out mAxiWriteMasterAxiLiteWriteMasterType
out drpDislv( DATA_WIDTH_G- 1 downto 0)