Use Cases
- AXI-Stream datapath integration where module boundaries need explicit ready/valid behavior.
- Memory-mapped control/status integration with software-visible register maps.
Block Diagram
VHDL Include And Instantiation Template
File Header
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library radhdl;
-- Direct entity instantiation below does not require importing the entity name.
use radhdl.interfaces.all;
-- Narrower alternative: use radhdl.interfaces_axi.all;Component Declaration
component radif_axi4_axis_dma is
generic (
REG_DATA_WIDTH : integer := 32;
REG_ADDR_WIDTH : integer := 16;
AXI_ADDR_WIDTH : integer := 32;
AXI_DATA_WIDTH : integer := 32;
AXIS_DATA_WIDTH : integer := 32;
ENABLE_MM2S : boolean := true;
ENABLE_S2MM : boolean := true;
FIFO_DEPTH : integer := 1024;
FIFO_FWFT : boolean := true;
MAX_BURST_LEN : integer := 16;
VENDOR_TAG : string := "XILINX";
PRODUCT_SERIES_TAG : string := "GENERIC"
);
port (
m_axis_tdata : out std_logic_vector(AXIS_DATA_WIDTH - 1 downto 0);
m_axis_tvalid : out std_logic;
m_axis_tready : in std_logic;
m_axis_tlast : out std_logic;
s_axis_tdata : in std_logic_vector(AXIS_DATA_WIDTH - 1 downto 0);
s_axis_tvalid : in std_logic;
s_axis_tready : out std_logic;
s_axis_tlast : in std_logic;
m_axi_awaddr : out std_logic_vector(AXI_ADDR_WIDTH - 1 downto 0);
m_axi_awlen : out std_logic_vector(7 downto 0);
m_axi_awsize : out std_logic_vector(2 downto 0);
m_axi_awburst : out std_logic_vector(1 downto 0);
m_axi_awvalid : out std_logic;
m_axi_awready : in std_logic;
m_axi_wdata : out std_logic_vector(AXI_DATA_WIDTH - 1 downto 0);
m_axi_wstrb : out std_logic_vector((AXI_DATA_WIDTH / 8) - 1 downto 0);
m_axi_wlast : out std_logic;
m_axi_wvalid : out std_logic;
m_axi_wready : in std_logic;
m_axi_bresp : in std_logic_vector(1 downto 0);
m_axi_bvalid : in std_logic;
m_axi_bready : out std_logic;
m_axi_araddr : out std_logic_vector(AXI_ADDR_WIDTH - 1 downto 0);
m_axi_arlen : out std_logic_vector(7 downto 0);
m_axi_arsize : out std_logic_vector(2 downto 0);
m_axi_arburst : out std_logic_vector(1 downto 0);
m_axi_arvalid : out std_logic;
m_axi_arready : in std_logic;
m_axi_rdata : in std_logic_vector(AXI_DATA_WIDTH - 1 downto 0);
m_axi_rresp : in std_logic_vector(1 downto 0);
m_axi_rlast : in std_logic;
m_axi_rvalid : in std_logic;
m_axi_rready : out std_logic;
clk : in std_logic;
rstn : in std_logic;
reg_wr_addr : in std_logic_vector(REG_ADDR_WIDTH - 1 downto 0);
reg_rd_addr : in std_logic_vector(REG_ADDR_WIDTH - 1 downto 0);
reg_wr_en : in std_logic;
reg_rd_en : in std_logic;
reg_data_in : in std_logic_vector(REG_DATA_WIDTH - 1 downto 0);
reg_data_out : out std_logic_vector(REG_DATA_WIDTH - 1 downto 0);
reg_wr_rdy : out std_logic;
reg_rd_rdy : out std_logic;
reg_wr_valid : out std_logic;
reg_rd_valid : out std_logic;
reg_error : out std_logic;
irq_o : out std_logic
);
end component;Direct Entity Instantiation
u_radif_axi4_axis_dma : entity radhdl.radif_axi4_axis_dma
generic map (
REG_DATA_WIDTH => 32,
REG_ADDR_WIDTH => 16,
AXI_ADDR_WIDTH => 32,
AXI_DATA_WIDTH => 32,
AXIS_DATA_WIDTH => 32,
ENABLE_MM2S => true,
ENABLE_S2MM => true,
FIFO_DEPTH => 1024,
FIFO_FWFT => true,
MAX_BURST_LEN => 16,
VENDOR_TAG => "XILINX",
PRODUCT_SERIES_TAG => "GENERIC"
)
port map (
m_axis_tdata => <m_axis_tdata_signal>,
m_axis_tvalid => <m_axis_tvalid_signal>,
m_axis_tready => <m_axis_tready_signal>,
m_axis_tlast => <m_axis_tlast_signal>,
s_axis_tdata => <s_axis_tdata_signal>,
s_axis_tvalid => <s_axis_tvalid_signal>,
s_axis_tready => <s_axis_tready_signal>,
s_axis_tlast => <s_axis_tlast_signal>,
m_axi_awaddr => <m_axi_awaddr_signal>,
m_axi_awlen => <m_axi_awlen_signal>,
m_axi_awsize => <m_axi_awsize_signal>,
m_axi_awburst => <m_axi_awburst_signal>,
m_axi_awvalid => <m_axi_awvalid_signal>,
m_axi_awready => <m_axi_awready_signal>,
m_axi_wdata => <m_axi_wdata_signal>,
m_axi_wstrb => <m_axi_wstrb_signal>,
m_axi_wlast => <m_axi_wlast_signal>,
m_axi_wvalid => <m_axi_wvalid_signal>,
m_axi_wready => <m_axi_wready_signal>,
m_axi_bresp => <m_axi_bresp_signal>,
m_axi_bvalid => <m_axi_bvalid_signal>,
m_axi_bready => <m_axi_bready_signal>,
m_axi_araddr => <m_axi_araddr_signal>,
m_axi_arlen => <m_axi_arlen_signal>,
m_axi_arsize => <m_axi_arsize_signal>,
m_axi_arburst => <m_axi_arburst_signal>,
m_axi_arvalid => <m_axi_arvalid_signal>,
m_axi_arready => <m_axi_arready_signal>,
m_axi_rdata => <m_axi_rdata_signal>,
m_axi_rresp => <m_axi_rresp_signal>,
m_axi_rlast => <m_axi_rlast_signal>,
m_axi_rvalid => <m_axi_rvalid_signal>,
m_axi_rready => <m_axi_rready_signal>,
clk => <clk_signal>,
rstn => <rstn_signal>,
reg_wr_addr => <reg_wr_addr_signal>,
reg_rd_addr => <reg_rd_addr_signal>,
reg_wr_en => <reg_wr_en_signal>,
reg_rd_en => <reg_rd_en_signal>,
reg_data_in => <reg_data_in_signal>,
reg_data_out => <reg_data_out_signal>,
reg_wr_rdy => <reg_wr_rdy_signal>,
reg_rd_rdy => <reg_rd_rdy_signal>,
reg_wr_valid => <reg_wr_valid_signal>,
reg_rd_valid => <reg_rd_valid_signal>,
reg_error => <reg_error_signal>,
irq_o => <irq_o_signal>
);Generics
| Name | Type | Default | Description |
|---|---|---|---|
| REG_DATA_WIDTH | integer | 32 | Sets the bit width for REG DATA WIDTH values carried by this module. |
| REG_ADDR_WIDTH | integer | 16 | Sets the bit width for REG ADDR WIDTH values carried by this module. |
| AXI_ADDR_WIDTH | integer | 32 | Sets the bit width for AXI ADDR WIDTH values carried by this module. |
| AXI_DATA_WIDTH | integer | 32 | Sets the bit width for AXI DATA WIDTH values carried by this module. |
| AXIS_DATA_WIDTH | integer | 32 | Sets the bit width for AXIS DATA WIDTH values carried by this module. |
| ENABLE_MM2S | boolean | true | Configures ENABLE MM2S for this instance. |
| ENABLE_S2MM | boolean | true | Configures ENABLE S2MM for this instance. |
| FIFO_DEPTH | integer | 1024 | Sets the storage depth, frame length, or number of buffered samples used internally. |
| FIFO_FWFT | boolean | true | Configures FIFO FWFT for this instance. |
| MAX_BURST_LEN | integer | 16 | Configures MAX BURST LEN for this instance. |
| VENDOR_TAG | string | "XILINX" | Selects the vendor-specific implementation path, usually XILINX for DSP48/XPM-backed builds or generic for portable RTL. |
| PRODUCT_SERIES_TAG | string | "GENERIC" | Identifies the target FPGA family so wrappers can choose the correct primitive or conservative portable behavior. |
Ports
| Name | Direction | Type | Description |
|---|---|---|---|
| m_axis_tdata | out | std_logic_vector(AXIS_DATA_WIDTH - 1 downto 0) | Output AXI-stream payload containing packed processed result lanes. |
| m_axis_tvalid | out | std_logic | Output AXI-stream valid qualifier for the current result beat. |
| m_axis_tready | in | std_logic | Output AXI-stream ready input from the downstream block. |
| m_axis_tlast | out | std_logic | Output AXI-stream frame marker aligned with the processed result beat. |
| s_axis_tdata | in | std_logic_vector(AXIS_DATA_WIDTH - 1 downto 0) | Input AXI-stream payload containing packed sample or feature lanes. |
| s_axis_tvalid | in | std_logic | Input AXI-stream valid qualifier for the current sample beat. |
| s_axis_tready | out | std_logic | Input AXI-stream ready response indicating this block can accept a beat. |
| s_axis_tlast | in | std_logic | Input AXI-stream frame marker for the final beat of a frame. |
| m_axi_awaddr | out | std_logic_vector(AXI_ADDR_WIDTH - 1 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_awlen | out | std_logic_vector(7 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_awsize | out | std_logic_vector(2 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_awburst | out | std_logic_vector(1 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_awvalid | out | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_awready | in | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_wdata | out | std_logic_vector(AXI_DATA_WIDTH - 1 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_wstrb | out | std_logic_vector((AXI_DATA_WIDTH / 8) - 1 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_wlast | out | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_wvalid | out | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_wready | in | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_bresp | in | std_logic_vector(1 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_bvalid | in | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_bready | out | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_araddr | out | std_logic_vector(AXI_ADDR_WIDTH - 1 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_arlen | out | std_logic_vector(7 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_arsize | out | std_logic_vector(2 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_arburst | out | std_logic_vector(1 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_arvalid | out | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_arready | in | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_rdata | in | std_logic_vector(AXI_DATA_WIDTH - 1 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_rresp | in | std_logic_vector(1 downto 0) | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_rlast | in | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_rvalid | in | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| m_axi_rready | out | std_logic | AXI master-channel signal used for memory-mapped transfer generation. |
| clk | in | std_logic | Clock for the associated synchronous logic and handshake domain. |
| rstn | in | std_logic | Active-low reset for this clock domain. |
| reg_wr_addr | in | std_logic_vector(REG_ADDR_WIDTH - 1 downto 0) | Register write address issued to the internal RadIF register target. |
| reg_rd_addr | in | std_logic_vector(REG_ADDR_WIDTH - 1 downto 0) | Register read address issued to the internal RadIF register target. |
| reg_wr_en | in | std_logic | One-cycle write request pulse for the internal register target. |
| reg_rd_en | in | std_logic | One-cycle read request pulse for the internal register target. |
| reg_data_in | in | std_logic_vector(REG_DATA_WIDTH - 1 downto 0) | Write data presented to the internal register target. |
| reg_data_out | out | std_logic_vector(REG_DATA_WIDTH - 1 downto 0) | Read data returned by the internal register target. |
| reg_wr_rdy | out | std_logic | Write-side ready indication from the internal register target. |
| reg_rd_rdy | out | std_logic | Read-side ready indication from the internal register target. |
| reg_wr_valid | out | std_logic | Write response valid indication from the internal register target. |
| reg_rd_valid | out | std_logic | Read response valid indication from the internal register target. |
| reg_error | out | std_logic | Register target error flag converted into the external bus error response. |
| irq_o | out | std_logic | Output irq o signal generated by this module. |
Register Interfaces
Static register maps are rendered below for this module.
| Interface | Directions | Signals | Representative ports |
|---|---|---|---|
| M_AXI | in, out | 25 | m_axi_awaddr, m_axi_awlen, m_axi_awsize, m_axi_awburst, m_axi_awvalid, m_axi_awready, m_axi_wdata, m_axi_wstrb, +17 more |
| M_AXIS | in, out | 4 | m_axis_tdata, m_axis_tvalid, m_axis_tready, m_axis_tlast |
| S_AXIS | in, out | 4 | s_axis_tdata, s_axis_tvalid, s_axis_tready, s_axis_tlast |
| Register control/status | in, out | 11 | reg_wr_addr, reg_rd_addr, reg_wr_en, reg_rd_en, reg_data_in, reg_data_out, reg_wr_rdy, reg_rd_rdy, +3 more |
Register Maps
radif_axi4_axis_dma
Register subset used by accelerator dma0 (axi_dma) in radhdl_dsp_axi_smoke.
| Register | Offset | Access | Reset | Description |
|---|---|---|---|---|
| control | 0x00 | rw | Control register used to configure and control this block. | |
| status_clear | 0x04 | rw | write-one-to-clear DMA status bits | |
| mm2s_base_lo | 0x08 | rw | Read/write control or configuration address register for the dma region. | |
| mm2s_base_hi | 0x0C | rw | Read/write control or configuration address register for the dma region. | |
| mm2s_end_lo | 0x10 | rw | Read/write control or configuration address register for the dma region. | |
| mm2s_end_hi | 0x14 | rw | Read/write control or configuration address register for the dma region. | |
| mm2s_length_bytes | 0x18 | rw | Read/write control or configuration transfer length register for the dma region. | |
| s2mm_base_lo | 0x1C | rw | Read/write control or configuration address register for the dma region. | |
| s2mm_base_hi | 0x20 | rw | Read/write control or configuration address register for the dma region. | |
| s2mm_end_lo | 0x24 | rw | Read/write control or configuration address register for the dma region. | |
| s2mm_end_hi | 0x28 | rw | Read/write control or configuration address register for the dma region. | |
| s2mm_length_bytes | 0x2C | rw | Read/write control or configuration transfer length register for the dma region. | |
| mm2s_current_lo | 0x30 | ro | Read-only status or measurement register for mm2s current lo in the dma region. | |
| s2mm_current_lo | 0x34 | ro | Read-only status or measurement register for s2mm current lo in the dma region. |
control
Control register used to configure and control this block.
| Name | Register bit(s) | Description |
|---|---|---|
| S2MM CIRC | Control[9] | Enables S2MM circular address wrapping. |
| S2MM EN | Control[8] | Enables S2MM transfer(s). |
| MM2S CIRC | Control[1] | Enables MM2S circular address wrapping. |
| MM2S EN | Control[0] | Enables MM2S transfer(s). |
status_clear
write-one-to-clear DMA status bits
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | StatusClear[31:0] | Full register value. |
mm2s_base_lo
Read/write control or configuration address register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | Mm2sBaseLo[31:0] | Full register value. |
mm2s_base_hi
Read/write control or configuration address register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | Mm2sBaseHi[31:0] | Full register value. |
mm2s_end_lo
Read/write control or configuration address register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | Mm2sEndLo[31:0] | Full register value. |
mm2s_end_hi
Read/write control or configuration address register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | Mm2sEndHi[31:0] | Full register value. |
mm2s_length_bytes
Read/write control or configuration transfer length register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | Mm2sLengthBytes[31:0] | Full register value. |
s2mm_base_lo
Read/write control or configuration address register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | S2mmBaseLo[31:0] | Full register value. |
s2mm_base_hi
Read/write control or configuration address register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | S2mmBaseHi[31:0] | Full register value. |
s2mm_end_lo
Read/write control or configuration address register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | S2mmEndLo[31:0] | Full register value. |
s2mm_end_hi
Read/write control or configuration address register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | S2mmEndHi[31:0] | Full register value. |
s2mm_length_bytes
Read/write control or configuration transfer length register for the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | S2mmLengthBytes[31:0] | Full register value. |
mm2s_current_lo
Read-only status or measurement register for mm2s current lo in the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | Mm2sCurrentLo[31:0] | Full register value. |
s2mm_current_lo
Read-only status or measurement register for s2mm current lo in the dma region.
| Name | Register bit(s) | Description |
|---|---|---|
| VALUE | S2mmCurrentLo[31:0] | Full register value. |
Testbenches
tb_radif_axi4_axis_dma
Self-checking DMA transaction testbench. This bench programs the RADIF AXI4/AXIS DMA register interface for one MM2S transfer and one S2MM transfer. The MM2S sequence writes base/end/length registers, enables MM2S, accepts one AXI read beat at address 0x00000100, and checks that the read payload appears on the output AXI-Stream port. The S2MM sequence writes base/end/length registers, enables S2MM, presents one input AXI-Stream beat, and checks that the DMA emits one AXI write beat at address 0x00000200 with the expected payload. The waveform should show the register programming phase followed by AR/R and AW/W/B channel activity.
Captured GHDL Waveform
M_AXI interface signals
M_AXI Interface Waveform
M_AXIS interface signals
M_AXIS Interface Waveform
S_AXIS interface signals
S_AXIS Interface Waveform
tb_radif_interfaces_smoke
Interface elaboration and idle-state smoke testbench. This bench instantiates the RADIF SPI, QSPI, I2C, DMA, and SPI-to-AXI blocks together to catch compile/elaboration issues and verify reset-idle behavior for shared interface wrappers. It intentionally does not drive complete bus transactions; it checks that inactive SPI/QSPI pins remain tri-stated after reset. Use the module-specific testbenches for transaction waveforms.
Captured GHDL Waveform
I2C interface signals
I2C Interface Waveform
M_AXI interface signals
M_AXI Interface Waveform
M_AXIS interface signals
M_AXIS Interface Waveform
QSPI interface signals
QSPI Interface Waveform
SPI interface signals
SPI Interface Waveform
S_AXIS interface signals
S_AXIS Interface Waveform
Sources
- interfaces/hdl/radif/src/radif_axi4_axis_dma.vhd
