llfifo
Xilinx SDK Drivers API Documentation
xllfifo_polling_example.c File Reference

Overview

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 polling 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 Receive the data and compare with the data transmitted.

Note: The TDEST Must be enabled in the H/W design inorder to get 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.

Functions

int XLlFifoPollingExample (XLlFifo *InstancePtr, u16 DeviceId)
 This function demonstrates the usage AXI FIFO It does the following: More...
 
int TxSend (XLlFifo *InstancePtr, u32 *SourceAddr)
 TxSend routine, It will send the requested amount of data at the specified addr. More...
 
int RxReceive (XLlFifo *InstancePtr, u32 *DestinationAddr)
 RxReceive routine.It will receive the data from the FIFO. More...
 
int main ()
 Main function. More...
 

Function Documentation

◆ main()

int main ( )

Main function.

This function is the main entry of the Axi FIFO Polling test.

Parameters
None
Returns
  • XST_SUCCESS if tests pass
    • XST_FAILURE if fails.
Note
None

References XLlFifoPollingExample().

◆ RxReceive()

int RxReceive ( XLlFifo InstancePtr,
u32 *  DestinationAddr 
)

RxReceive routine.It will receive the data from the FIFO.

Parameters
InstancePtris a pointer to the instance of the XLlFifo instance.
DestinationAddris the address where to copy the received data.
Returns
-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure
Note
None

References XLlFifo_iRxGetLen().

◆ TxSend()

int TxSend ( XLlFifo InstancePtr,
u32 *  SourceAddr 
)

TxSend routine, It will send the requested amount of data at the specified addr.

Parameters
InstancePtris a pointer to the instance of the XLlFifo component.
SourceAddris the address where the FIFO stars writing
Returns
-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure
Note
None

◆ XLlFifoPollingExample()

int XLlFifoPollingExample ( XLlFifo InstancePtr,
u16  DeviceId 
)

This function demonstrates the usage AXI FIFO It does the following:

  • Set up the output terminal if UART16550 is in the hardware build
  • Initialize the Axi FIFO Device.
  • Transmit the data
  • Receive the data from fifo
  • Compare the data
  • Return the result
Parameters
InstancePtris a pointer to the instance of the XLlFifo component.
DeviceIdis Device ID of the Axi Fifo Deive instance, typically XPAR_<AXI_FIFO_instance>_DEVICE_ID value from xparameters.h.
Returns
-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure

Referenced by main().