memory_interface

Bridge an AXI memory port onto a memory macro and forward an AXI-Lite CSR port.

The two ports are independent; there is no address decode between them. The memory port subtracts MEM_BASE_ADDR from AW and AR addresses and feeds axi_to_mem with a buffer depth of 1. Every request is accepted at once and the macro must return read data on the clock after the request; mem_req_o carries the clock the macro runs on. With READ_ONLY set, writes are acknowledged but never reach the macro, and mem_req_t needs only the clk, req and addr fields. The CSR port subtracts CSR_BASE_ADDR from AW and AR addresses and forwards all traffic to csr_out_*. busy_o is the axi_to_mem busy status.

Parameters

Table 1. Parameters
NameTypeDefaultDescription
MEM_ADDR_WIDTHint unsigned0Memory AXI address width; at most 64.
MEM_DATA_WIDTHint unsigned0Memory AXI and bank data width; one of 32, 64, 128, 256, 512 or 1024.
MEM_ID_WIDTHint unsigned0Memory ID width.
READ_ONLYbit1'b0Never forward writes to the macro.
CSR_ADDR_WIDTHint unsigned0CSR AXI-Lite address width; at most 64.
CSR_DATA_WIDTHint unsigned0Data width of both CSR AXI-Lite ports; 32 or 64.
CSR_BASE_ADDRlogic [31:0]0Subtracted from CSR AW and AR addresses; must be aligned to CSR_DATA_WIDTH/8 bytes.
MEM_BASE_ADDRlogic [31:0]0Subtracted from memory AW and AR addresses; must be aligned to MEM_DATA_WIDTH/8 bytes.

Ports

Table 2. Ports
NameDirectionTypeDescription
clk_iinputlogicSystem clock.
rst_niinputlogicAsync reset, active-low.
mem_axi_req_iinputmem_axi_req_tAXI memory slave request; addresses are offset by MEM_BASE_ADDR before axi_to_mem.
mem_axi_resp_ooutputmem_axi_resp_tAXI memory slave response.
csr_in_axil_req_iinputcsr_axil_req_tInbound CSR AXI-Lite request.
csr_in_axil_resp_ooutputcsr_axil_resp_tInbound CSR AXI-Lite response.
csr_out_axil_req_ooutputcsr_axil_req_tcsr_in_axil_req_i with CSR_BASE_ADDR subtracted from the AW and AR addresses.
csr_out_axil_resp_iinputcsr_axil_resp_tForwarded CSR AXI-Lite response.
mem_req_ooutputmem_req_tMacro request.
mem_rsp_iinputmem_rsp_tMacro read data, returned on the clock after mem_req_o.req.
busy_ooutputHigh while axi_to_mem has a memory-port transaction in progress.