![]() |
llfifo
Vitis Drivers API Documentation
|
Demonstrates XLlFifo interrupt transmit and receive.
This file demonstrates how to use the Streaming fifo driver on the xilinx AXI Streaming FIFO IP.The AXI4-Stream FIFO core allows memory mapped access to a AXI-Stream interface. The core can be used to interface to AXI Streaming IPs similar to the LogiCORE IP AXI Ethernet core, without having to use full DMA solution.
This is the interrupt example for the FIFO it assumes that at the h/w level FIFO is connected in loopback.In these we write known amount of data to the FIFO and wait for interrupts and after completely receiving the data compares it with the data transmitted.
Note: Enable TDEST in the hardware design in order to get the correct RDR value.
MODIFICATION HISTORY:
Ver Who Date Changes
----- ---- -------- -------------------------------------------------------
3.00a adk 08/10/2013 initial release CR:727787
5.1 ms 01/23/17 Modified xil_printf statement in main function to
ensure that "Successfully ran" and "Failed" strings
are available in all examples. This is a fix for
CR-965028.
ms 04/05/17 Added tabspace for return statements in functions for
proper documentation and Modified Comment lines
to consider it as a documentation block while
generating doxygen.
5.3 rsp 11/08/18 Modified TxSend to fill SourceBuffer with non-zero
data otherwise the test can return a false positive
because DestinationBuffer is initialized with zeros.
In fact, fixing this exposed a bug in FifoRecvHandler
and caused the test to start failing. According to the
product guide (pg080) for the AXI4-Stream FIFO, the
RDFO should be read before reading RLR. Reading RLR
first will result in the RDFO being reset to zero and
no data being received.
5.6 sd 07/7/23 Add system devicetree support.
6.1 vlt 12/18/25 Update Doxygen comments to include SDT flow details.
6.2 vn 08/26/26 Fix Doxygen warnings.
6.2 tb 09/15/26 Align Doxygen comments with AMD standards.
#include "xparameters.h"#include "xil_exception.h"#include "xstreamer.h"#include "xil_cache.h"#include "xllfifo.h"#include "xstatus.h"#include "xinterrupt_wrap.h"Macros | |
| #define | WORD_SIZE 4 |
| Word size in bytes. More... | |
| #define | MAX_PACKET_LEN 4 |
| Packet length in words. More... | |
| #define | NO_OF_PACKETS 64 |
| Number of packets to transfer. More... | |
| #define | MAX_DATA_BUFFER_SIZE NO_OF_PACKETS*MAX_PACKET_LEN |
| Buffer size in words. More... | |
Functions | |
| int | XLlFifoInterruptExample (XLlFifo *InstancePtr, UINTPTR BaseAddress) |
| Demonstrates interrupt-mode XLlFifo traffic. More... | |
| int | TxSend (XLlFifo *InstancePtr, u32 *SourceAddr) |
| Sends packets through the XLlFifo transmit channel. More... | |
| int | main () |
| Runs the XLlFifo interrupt example. More... | |
Variables | |
| volatile int | Done |
| Non-zero when a transfer completes. More... | |
| volatile int | Error |
| Non-zero when an error interrupt occurs. More... | |
| XLlFifo | FifoInstance |
| Driver instance for the AXI FIFO. More... | |
| u32 | SourceBuffer [MAX_DATA_BUFFER_SIZE *WORD_SIZE] |
| Transmit data buffer. More... | |
| u32 | DestinationBuffer [MAX_DATA_BUFFER_SIZE *WORD_SIZE] |
| Receive data buffer. More... | |
| #define MAX_DATA_BUFFER_SIZE NO_OF_PACKETS*MAX_PACKET_LEN |
Buffer size in words.
Referenced by TxSend(), and XLlFifoInterruptExample().
| #define MAX_PACKET_LEN 4 |
Packet length in words.
Referenced by TxSend().
| #define NO_OF_PACKETS 64 |
Number of packets to transfer.
Referenced by TxSend().
| #define WORD_SIZE 4 |
Word size in bytes.
Referenced by TxSend().
| int main | ( | ) |
Runs the XLlFifo interrupt example.
This function is the main entry of the AXI FIFO interrupt test.
References XLlFifoInterruptExample().
| int TxSend | ( | XLlFifo * | InstancePtr, |
| u32 * | SourceAddr | ||
| ) |
Sends packets through the XLlFifo transmit channel.
Sends the requested amount of data at the specified address.
| [in] | InstancePtr | Pointer to the XLlFifo instance. |
| [in] | SourceAddr | Address of the source data to transmit. |
References MAX_DATA_BUFFER_SIZE, MAX_PACKET_LEN, NO_OF_PACKETS, WORD_SIZE, XLlFifo_iTxSetLen(), XLlFifo_iTxVacancy(), and XLlFifo_TxPutWord().
Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().
| int XLlFifoInterruptExample | ( | XLlFifo * | InstancePtr, |
| UINTPTR | BaseAddress | ||
| ) |
Demonstrates interrupt-mode XLlFifo traffic.
This function demonstrates the usage of AXI FIFO It does the following:
| [out] | InstancePtr | Pointer to the instance of the XLlFifo instance. |
| [in] | BaseAddress | Contains the base address of the device. |
References XLlFifo_Config::BaseAddress, DestinationBuffer, Done, Error, XLlFifo::IntId, XLlFifo::IntrParent, MAX_DATA_BUFFER_SIZE, SourceBuffer, TxSend(), XLLF_INT_ALL_MASK, XLlFfio_LookupConfig(), XLlFifo_CfgInitialize(), XLlFifo_IntClear, XLlFifo_IntEnable, and XLlFifo_Status.
Referenced by main().
| u32 DestinationBuffer[MAX_DATA_BUFFER_SIZE *WORD_SIZE] |
Receive data buffer.
Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().
| volatile int Done |
Non-zero when a transfer completes.
Referenced by XLlFifoInterruptExample().
| volatile int Error |
Non-zero when an error interrupt occurs.
Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().
| XLlFifo FifoInstance |
Driver instance for the AXI FIFO.
Referenced by XStrm_RxInitialize(), and XStrm_TxInitialize().
| u32 SourceBuffer[MAX_DATA_BUFFER_SIZE *WORD_SIZE] |
Transmit data buffer.
Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().