memory_interface

Bridge an AXI memory port onto mem_req/mem_rsp banks 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 and NUM_BANKS banks. 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.
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.
NUM_BANKSint unsigned1Number of banks axi_to_mem splits each data word across; 1 to 16.

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_tBank memory request.
mem_rsp_iinputmem_rsp_tBank memory response.
busy_ooutputHigh while axi_to_mem has a memory-port transaction in progress.