Parameterized Macro: AXI Memory Mapped (AXI Stream) FIFO
- MACRO_GROUP: XPM
- MACRO_SUBGROUP: XPM_FIFO
Introduction
This macro is used to instantiate AXI Stream FIFO.
AXI Stream FIFO derives from the XPM_FIFO_SYNC and XPM_FIFO_ASYNC. The AXI Stream protocol uses a two-way valid and ready handshake mechanism. The information source uses the valid signal to show when valid data or control information becomes available on the channel. The information destination uses the ready signal to show when it can accept the data.
Timing Diagrams
In the preceding timing diagram, the information source generates a valid signal to indicate when data becomes available. The destination generates a ready signal to indicate when it can accept data, and transfer occurs only when both the valid and ready signals are High.
Because AXI Stream FIFO derives from XPM_FIFO_SYNC and XPM_FIFO_ASYNC, it shares much of their behavior. The FIFO generates the ready signal based on available space in the FIFO and holds it High to allow writes. The FIFO pulls the ready signal Low only when no FIFO space remains for additional writes. The FIFO generates the valid signal based on FIFO data availability and holds it High to allow reads. The FIFO pulls the valid signal Low only when no data remains to read from the FIFO. The information signals map to the din and dout buses of Native interface FIFOs. The AXI FIFO width comes from concatenating all AXI interface information signals. The information signals include all AXI signals except the valid and ready handshake signals.
AXI Stream FIFO operates only in First-Word Fall-Through (FWFT) mode. FWFT provides look-ahead to the next available FIFO word without issuing a read operation. When data becomes available in the FIFO, the first word falls through and appears automatically on the output data bus.
Module Ports
The vivado_interfaces.svh file includes the following module ports for AXI4, AXI4-Stream, and AXI4-Lite interfaces.
| Interface Type | Ports |
|---|---|
| vivado_axis_v1_0 | TID, TDEST, TDATA, TSTRB, TKEEP, TLAST, TUSER, TVALID, TREADY |
| vivado_aximm_v1_0 | AWID, AWADDR, AWLEN, AWSIZE, AWBURST, AWLOCK, AWCACHE, AWPROT, AWREGION, AWQOS, AWUSER, AWVALID, WID, WDATA, WSTRB, WLAST, WUSER, WVALID, BREADY, ARID, ARADDR, ARLEN, ARSIZE, ARBURST, ARLOCK, ARCACHE, ARPROT, ARREGION, ARQOS, ARUSER, ARVALID, RREADY, AWREADY, WREADY, BID, BRESP, BUSER, BVALID, ARREADY, RID, RDATA, RRESP, RLAST, RUSER, RVALID |
| vivado_axi4_lite_v1_0 | AWADDR, AWPROT, AWVALID, WDATA, WSTRB, WVALID, BREADY, ARADDR, ARPROT, ARVALID, RREADY, AWREADY, WREADY, BRESP, BVALID, ARREADY, RDATA, RRESP, RVALID |
Port Descriptions
| Port | Direction | Width | Domain | Sense | Handling if Unused | Function |
|---|---|---|---|---|---|---|
| almost_empty_axis | Output | 1 | m_aclk | LEVEL_HIGH | DoNotCare | Almost Empty: When asserted, this signal indicates that only one more read can be performed before the FIFO goes to empty. |
| almost_full_axis | Output | 1 | s_aclk | LEVEL_HIGH | DoNotCare | Almost Full: When asserted, this signal indicates that only one more write can be performed before the FIFO is full. |
| dbiterr_axis | Output | 1 | m_aclk | LEVEL_HIGH | DoNotCare | Double Bit Error: Indicates that the ECC decoder detected a double-bit error and data in the FIFO core is corrupted. |
| S_AXIS | Inteface | Slave AXI-Stream interface. | ||||
| M_AXIS | Interface | Master AXI-Stream interface. | ||||
| prog_empty_axis | Output | 1 | m_aclk | LEVEL_HIGH | DoNotCare |
Programmable Empty: This signal asserts when the number of words in the FIFO is less than or equal to the programmable empty threshold value. It deasserts when the number of words in the FIFO exceeds the programmable empty threshold value. |
| prog_full_axis | Output | 1 | s_aclk | LEVEL_HIGH | DoNotCare |
Programmable Full: This signal asserts when the number of words in the FIFO is greater than or equal to the programmable full threshold value. It deasserts when the number of words in the FIFO is less than the programmable full threshold value. |
| rd_data_count_axis | Output | RD_DATA_COUNT_WIDTH | m_aclk | N/A | DoNotCare | Read Data Count: This bus indicates the number of words available for reading in the FIFO. |
| sbiterr_axis | Output | 1 | m_aclk | LEVEL_HIGH | DoNotCare | Single Bit Error: Indicates that the ECC decoder detected and fixed a single-bit error. |
| wr_data_count_axis | Output | WR_DATA_COUNT_WIDTH | s_aclk | N/A | DoNotCare | Write Data Count: This bus indicates the number of words written into the FIFO. |
| injectdbiterr_axis | Input | 1 | s_aclk | LEVEL_HIGH | 0 | Double Bit Error Injection: Injects a double bit error if the ECC feature is used. |
| injectsbiterr_axis | Input | 1 | s_aclk | LEVEL_HIGH | 0 | Single Bit Error Injection: Injects a single bit error if the ECC feature is used. |
| m_aclk | Input | 1 | N/A | EDGE_RISING | Active | Master Interface Clock: All signals on master interface are sampled on the rising edge of this clock. |
| s_aclk | Input | 1 | N/A | EDGE_RISING | Active | Slave Interface Clock: All signals on slave interface are sampled on the rising edge of this clock. |
| s_aresetn | Input | 1 | N/A | LEVEL_LOW | Active | Active low asynchronous reset. |
Design Entry Method
| Instantiation | Yes |
| Inference | No |
| IP and IP Integrator Catalog | No |
Available Attributes
| Attribute | Type | Allowed Values | Default | Description |
|---|---|---|---|---|
| CASCADE_HEIGHT | DECIMAL | 0 to 64 | 0 |
0: No Cascade Height; enable Vivado Synthesis to choose. 1 or more: Vivado Synthesis sets the specified value as Cascade Height. |
| CDC_SYNC_STAGES | DECIMAL | 2 to 8 | 2 |
Specifies the number of synchronization stages on the CDC path. Applicable only if CLOCKING_MODE = "independent_clock" |
| CLOCKING_MODE | STRING | "common_clock", "independent_clock" | "common_clock" | Designate whether AXI Stream FIFO is clocked with a common clock
or with independent clocks:
|
| ECC_MODE | STRING | "no_ecc", "en_ecc" | "no_ecc" |
|
| EN_SIM_ASSERT_ERR | STRING | String | "warning" |
|
| FIFO_DEPTH | DECIMAL | 16 to 4194304 | 2048 | Defines the AXI Stream FIFO Write Depth; must be power of two. NOTE: The maximum FIFO size (width x depth) is limited to 150-Megabits. |
| FIFO_MEMORY_TYPE | STRING | "auto", "block", "distributed", "ultra" | "auto" | Designate the FIFO memory primitive (resource type) to use:
|
| PACKET_FIFO | STRING | "false", "true" | "false" |
|
| PROG_EMPTY_THRESH | DECIMAL | 5 to 4194301 | 10 |
Specifies the minimum number of read words in the FIFO at or below which prog_empty is asserted.
|
| PROG_FULL_THRESH | DECIMAL | 5 to 4194301 | 10 |
Specifies the maximum number of write words in the FIFO at or above which prog_full is asserted.
|
| RD_DATA_COUNT_WIDTH | DECIMAL | 1 to 23 | 1 | Specifies the width of rd_data_count_axis. To reflect the correct value, the width must be log2(FIFO_DEPTH)+1. |
| RELATED_CLOCKS | DECIMAL | 0 to 1 | 0 |
Specifies if the s_aclk and m_aclk are related having the same source but different clock ratios. Applicable only if CLOCKING_MODE = "independent_clock". |
| SIM_ASSERT_CHK | DECIMAL | 0 to 1 | 0 |
0: Disable simulation message reporting. Messages related to potential misuse are not be reported. 1: Enable simulation message reporting. Messages related to potential misuse are reported. |
| TDATA_WIDTH | DECIMAL | 8 to 2048 | 32 | Defines the width of the TDATA port, s_axis_tdata and m_axis_tdata. NOTE: The maximum FIFO size (width x depth) is limited to 150-Megabits. |
| TDEST_WIDTH | DECIMAL | 1 to 32 | 1 | Defines the width of the TDEST port, s_axis_tdest and m_axis_tdest. |
| TID_WIDTH | DECIMAL | 1 to 32 | 1 | Defines the width of the ID port, s_axis_tid and m_axis_tid. |
| TUSER_WIDTH | DECIMAL | 1 to 4086 | 1 | Defines the width of the TUSER port, s_axis_tuser and m_axis_tuser. |
| USE_ADV_FEATURES | STRING | String | "1000" |
Enables almost_empty_axis, rd_data_count_axis, prog_empty_axis, almost_full_axis, wr_data_count_axis, and prog_full_axis sideband signals.
|
| WR_DATA_COUNT_WIDTH | DECIMAL | 1 to 23 | 1 | Specifies the width of wr_data_count_axis. To reflect the correct value, the width must be log2(FIFO_DEPTH)+1. |
System Verilog Instantiation Template
// xpm_fifo_axis_sv : In order to incorporate this function into the design,
// System Verilog : the following instance declaration needs to be placed
// instance : in the body of the design code. The instance name
// declaration : (xpm_fifo_axis_sv_inst) and/or the port declarations within the
// code : parenthesis may be changed to properly reference and
// : connect this function to the design. All inputs
// : and outputs must be connected.
// -------------- Begin Cut here for INTERFACE Include ------- // INCLUDE_TAG
`include "vivado_interfaces.svh"
// -- INCLUDE_TAG_END ------ End INTERFACE Include ------------
// -------------- Begin Cut here for INTERFACE Template ------- // INTF_TAG
// Default parameter used by the module are for S_AXI
vivado_axis_v1_0 #(
.TDATA_NUM_BYTES(1),
.TDEST_WIDTH(4),
.TID_WIDTH(6)
) S_AXIS();
// -- INTF_TAG_END -------------- End INTERFACE Template ------------------
// <-----Cut code below this line---->
// xpm_fifo_axis_sv: AXI Stream FIFO
// Xilinx Parameterized Macro, version 2026.1
xpm_fifo_axis_sv #(
.TDATA_WIDTH(TDATA_NUM_BYTES*8), // DECIMAL
.TDEST_WIDTH(TDEST_WIDTH), // DECIMAL
.TID_WIDTH(TID_WIDTH), // DECIMAL
.TUSER_WIDTH(1), // DECIMAL
.CASCADE_HEIGHT(0), // DECIMAL
.CDC_SYNC_STAGES(2), // DECIMAL
.CLOCKING_MODE("common_clock"), // String
.ECC_MODE("no_ecc"), // String
.EN_SIM_ASSERT_ERR("warning"), // String
.FIFO_DEPTH(2048), // DECIMAL
.FIFO_MEMORY_TYPE("auto"), // String
.PACKET_FIFO("false"), // String
.PROG_EMPTY_THRESH(10), // DECIMAL
.PROG_FULL_THRESH(10), // DECIMAL
.RD_DATA_COUNT_WIDTH(1), // DECIMAL
.RELATED_CLOCKS(0), // DECIMAL
.SIM_ASSERT_CHK(0), // DECIMAL; 0=disable simulation messages, 1=enable simulation messages
.USE_ADV_FEATURES("1000"), // String
.WR_DATA_COUNT_WIDTH(1) // DECIMAL
)
xpm_fifo_axis_sv_inst (
.almost_empty_axis(almost_empty_axis), // 1-bit output: Almost Empty : When asserted, this signal indicates that only one more read can be
// performed before the FIFO goes to empty.
.almost_full_axis(almost_full_axis), // 1-bit output: Almost Full: When asserted, this signal indicates that only one more write can be
// performed before the FIFO is full.
.dbiterr_axis(dbiterr_axis), // 1-bit output: Double Bit Error- Indicates that the ECC decoder detected a double-bit error and data
// in the FIFO core is corrupted.
.S_AXIS (S_AXIS.slave),
.M_AXIS (M_AXIS.master),
.prog_empty_axis(prog_empty_axis), // 1-bit output: Programmable Empty- This signal is asserted when the number of words in the FIFO is
// less than or equal to the programmable empty threshold value. It is de-asserted when the number of
// words in the FIFO exceeds the programmable empty threshold value.
.prog_full_axis(prog_full_axis), // 1-bit output: Programmable Full: This signal is asserted when the number of words in the FIFO is
// greater than or equal to the programmable full threshold value. It is de-asserted when the number
// of words in the FIFO is less than the programmable full threshold value.
.rd_data_count_axis(rd_data_count_axis), // RD_DATA_COUNT_WIDTH-bit output: Read Data Count- This bus indicates the number of words available
// for reading in the FIFO.
.sbiterr_axis(sbiterr_axis), // 1-bit output: Single Bit Error- Indicates that the ECC decoder detected and fixed a single-bit
// error.
.wr_data_count_axis(wr_data_count_axis), // WR_DATA_COUNT_WIDTH-bit output: Write Data Count: This bus indicates the number of words written
// into the FIFO.
.injectdbiterr_axis(injectdbiterr_axis), // 1-bit input: Double Bit Error Injection- Injects a double bit error if the ECC feature is used.
.injectsbiterr_axis(injectsbiterr_axis), // 1-bit input: Single Bit Error Injection- Injects a single bit error if the ECC feature is used.
.m_aclk(m_aclk), // 1-bit input: Master Interface Clock: All signals on master interface are sampled on the rising edge
// of this clock.
.s_aclk(s_aclk), // 1-bit input: Slave Interface Clock: All signals on slave interface are sampled on the rising edge
// of this clock.
.s_aresetn(s_aresetn) // 1-bit input: Active low asynchronous reset.
);
// End of xpm_fifo_axis_sv_inst instantiation