Use Cases
- 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_spi.all;Component Declaration
component radif_spi_axi_master is
generic (
AXI_DATA_WIDTH : integer := 32;
AXI_ADDR_WIDTH : integer := 32;
AXI_MODE : string := "AXI_LITE";
ENABLE_CRC16 : boolean := false;
VENDOR_TAG : string := "XILINX";
PRODUCT_SERIES_TAG : string := "GENERIC"
);
port (
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;
spi_sclk_i : in std_logic;
spi_cs_n_i : in std_logic;
spi_mosi_i : in std_logic;
spi_miso_o : out std_logic;
spi_miso_oen : out std_logic
);
end component;Direct Entity Instantiation
u_radif_spi_axi_master : entity radhdl.radif_spi_axi_master
generic map (
AXI_DATA_WIDTH => 32,
AXI_ADDR_WIDTH => 32,
AXI_MODE => "AXI_LITE",
ENABLE_CRC16 => false,
VENDOR_TAG => "XILINX",
PRODUCT_SERIES_TAG => "GENERIC"
)
port map (
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>,
spi_sclk_i => <spi_sclk_i_signal>,
spi_cs_n_i => <spi_cs_n_i_signal>,
spi_mosi_i => <spi_mosi_i_signal>,
spi_miso_o => <spi_miso_o_signal>,
spi_miso_oen => <spi_miso_oen_signal>
);Generics
| Name | Type | Default | Description |
|---|---|---|---|
| AXI_DATA_WIDTH | integer | 32 | Sets the bit width for AXI DATA 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_MODE | string | "AXI_LITE" | Configures AXI MODE for this instance. |
| ENABLE_CRC16 | boolean | false | Configures ENABLE CRC16 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_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. |
| spi_sclk_i | in | std_logic | Input spi sclk i signal for this module. |
| spi_cs_n_i | in | std_logic | Input spi cs n i signal for this module. |
| spi_mosi_i | in | std_logic | Input spi mosi i signal for this module. |
| spi_miso_o | out | std_logic | Output spi miso o signal generated by this module. |
| spi_miso_oen | out | std_logic | Spi miso oen interface signal. |
Register Interfaces
No fixed register map was found; this section documents the exposed register/control interface ports.
| 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 |
Testbenches
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_spi_axi_master.vhd
