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
| Name | Type | Default | Description |
|---|---|---|---|
MEM_ADDR_WIDTH | int unsigned | 0 | Memory AXI address width; at most 64. |
MEM_DATA_WIDTH | int unsigned | 0 | Memory AXI and bank data width; one of 32, 64, 128, 256, 512 or 1024. |
MEM_ID_WIDTH | int unsigned | 0 | Memory ID width. |
CSR_ADDR_WIDTH | int unsigned | 0 | CSR AXI-Lite address width; at most 64. |
CSR_DATA_WIDTH | int unsigned | 0 | Data width of both CSR AXI-Lite ports; 32 or 64. |
CSR_BASE_ADDR | logic [31:0] | 0 | Subtracted from CSR AW and AR addresses; must be aligned to CSR_DATA_WIDTH/8 bytes. |
MEM_BASE_ADDR | logic [31:0] | 0 | Subtracted from memory AW and AR addresses; must be aligned to MEM_DATA_WIDTH/8 bytes. |
NUM_BANKS | int unsigned | 1 | Number of banks axi_to_mem splits each data word across; 1 to 16. |
Ports
| Name | Direction | Type | Description |
|---|---|---|---|
clk_i | input | logic | System clock. |
rst_ni | input | logic | Async reset, active-low. |
mem_axi_req_i | input | mem_axi_req_t | AXI memory slave request; addresses are offset by MEM_BASE_ADDR before axi_to_mem. |
mem_axi_resp_o | output | mem_axi_resp_t | AXI memory slave response. |
csr_in_axil_req_i | input | csr_axil_req_t | Inbound CSR AXI-Lite request. |
csr_in_axil_resp_o | output | csr_axil_resp_t | Inbound CSR AXI-Lite response. |
csr_out_axil_req_o | output | csr_axil_req_t | csr_in_axil_req_i with CSR_BASE_ADDR subtracted from the AW and AR addresses. |
csr_out_axil_resp_i | input | csr_axil_resp_t | Forwarded CSR AXI-Lite response. |
mem_req_o | output | mem_req_t | Bank memory request. |
mem_rsp_i | input | mem_rsp_t | Bank memory response. |
busy_o | output | | High while axi_to_mem has a memory-port transaction in progress. |