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 is derived 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 is available on the channel. The information destination uses the ready signal to show when it can accept the data.
Timing Diagrams
In the timing diagram above, the information source generates a valid signal to indicate when data is available. The destination generates a ready signal to indicate that it can accept data, and transfer occurs only when both the valid and ready signals are High.
Because the AXI Stream FIFO is derived from XPM_FIFO_SYNC and XPM_FIFO_ASYNC, much of the behavior is common between them. The ready signal is generated based on availability of space in the FIFO and is held high to allow writes to the FIFO. The ready signal is pulled Low only when there is no space in the FIFO left to perform additional writes. The valid signal is generated based on availability of data in the FIFO and is held High to allow reads to be performed from the FIFO. The valid signal is pulled Low only when there is no data available to be read from the FIFO. The information signals are mapped to the din and dout bus of Native interface FIFOs. The width of the AXI FIFO is determined by concatenating all of the information signals of the AXI interface. The information signals include all AXI signals except for the valid and ready handshake signals.
The AXI Stream FIFO operates only in First-Word Fall-Through mode. The First-Word Fall-Through (FWFT) feature provides the ability to look ahead to the next word available from the FIFO without issuing a read operation. When data is available in the FIFO, the first word falls through the FIFO 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-Steam interface. | ||||
| prog_empty_axis | Output | 1 | m_aclk | LEVEL_HIGH | DoNotCare |
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 | Output | 1 | s_aclk | LEVEL_HIGH | DoNotCare |
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 | Output | RD_DATA_COUNT_WIDTH | m_aclk | NA | 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 | NA | 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 | NA | EDGE_RISING | Active | Master Interface Clock: All signals on master interface are sampled on the rising edge of this clock. |
| s_aclk | Input | 1 | NA | EDGE_RISING | Active | Slave Interface Clock: All signals on slave interface are sampled on the rising edge of this clock. |
| s_aresetn | Input | 1 | NA | 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, Allow 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 should 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 will not be reported. 1- Enable simulation message reporting. Messages related to potential misuse will be 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, 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 should 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 2025.2
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