llfifo
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Overview

Data Structures

struct  XLlFifo
 Defines the XLlFifo driver instance. More...
 
struct  XLlFifo_Config
 Defines the XLlFifo hardware configuration. More...
 

Macros

#define XLlFifo_Reset(InstancePtr)
 Resets both FIFO channels and the local-link interface. More...
 
#define XLlFifo_Status(InstancePtr)   XLlFifo_ReadReg((InstancePtr)->BaseAddress, XLLF_ISR_OFFSET)
 Returns the FIFO interrupt status mask. More...
 
#define XLlFifo_IntEnable(InstancePtr, Mask)
 Enables selected FIFO interrupts. More...
 
#define XLlFifo_IntDisable(InstancePtr, Mask)
 Disables selected FIFO interrupts. More...
 
#define XLlFifo_IntPending(InstancePtr)
 Returns the pending FIFO interrupt mask. More...
 
#define XLlFifo_IntClear(InstancePtr, Mask)
 Clears selected pending FIFO interrupts. More...
 
#define XLlFifo_RxReset(InstancePtr)
 Resets the FIFO receive channel. More...
 
#define XLlFifo_IsRxEmpty(InstancePtr)
 Reports whether the receive channel is empty. More...
 
#define XLlFifo_RxOccupancy(InstancePtr)   XStrm_RxOccupancy(&((InstancePtr)->RxStreamer))
 Returns receive occupancy in 32-bit words. More...
 
#define XLlFifo_RxGetLen(InstancePtr)   XStrm_RxGetLen(&((InstancePtr)->RxStreamer))
 Returns the next receive frame length in bytes. More...
 
#define XLlFifo_Read(InstancePtr, BufPtr, Bytes)   XStrm_Read(&((InstancePtr)->RxStreamer), (BufPtr), (Bytes))
 Reads bytes from the FIFO receive channel. More...
 
#define XLlFifo_TxReset(InstancePtr)
 Resets the FIFO transmit channel. More...
 
#define XLlFifo_IsTxDone(InstancePtr)
 Reports whether transmit is complete. More...
 
#define XLlFifo_IsRxDone(InstancePtr)
 Reports whether receive is complete. More...
 
#define XLlFifo_TxVacancy(InstancePtr)   XStrm_TxVacancy(&((InstancePtr)->TxStreamer))
 Returns transmit vacancy in 32-bit words. More...
 
#define XLlFifo_TxSetLen(InstancePtr, Bytes)   XStrm_TxSetLen(&((InstancePtr)->TxStreamer), (Bytes))
 Starts a transmit of the given byte length. More...
 
#define XLlFifo_Write(InstancePtr, BufPtr, Bytes)   XStrm_Write(&((InstancePtr)->TxStreamer), (BufPtr), (Bytes))
 Writes bytes to the FIFO transmit channel. More...
 
#define XLlFifo_WriteTdr(InstancePtr, Tdest)
 Writes the transmit destination address. More...
 
#define XLlFifo_ReadRdr(InstancePtr)   XLlFifo_ReadReg((InstancePtr)->BaseAddress, XLLF_RDR_OFFSET)
 Reads the receive destination address. More...
 

Typedefs

typedef struct XLlFifo XLlFifo
 Defines the XLlFifo driver instance. More...
 
typedef struct XLlFifo_Config XLlFifo_Config
 Defines the XLlFifo hardware configuration. More...
 

Functions

int XLlFifo_CfgInitialize (XLlFifo *InstancePtr, XLlFifo_Config *Config, UINTPTR EffectiveAddress)
 Initializes the XLlFifo driver from a config. More...
 
void XLlFifo_Initialize (XLlFifo *InstancePtr, UINTPTR BaseAddress)
 Initializes the XLlFifo driver from a base address. More...
 
XLlFifo_Config * XLlFfio_LookupConfig (UINTPTR BaseAddress)
 Looks up the XLlFifo configuration. More...
 
u32 XLlFifo_iRxOccupancy (XLlFifo *InstancePtr)
 Returns receive occupancy in 32-bit words. More...
 
u32 XLlFifo_iRxGetLen (XLlFifo *InstancePtr)
 Returns the next receive frame length in bytes. More...
 
u32 XLlFifo_iTxVacancy (XLlFifo *InstancePtr)
 Returns transmit vacancy in 32-bit words. More...
 
void XLlFifo_iTxSetLen (XLlFifo *InstancePtr, u32 Bytes)
 Starts a transmit of the given byte length. More...
 
u32 XLlFifo_RxGetWord (XLlFifo *InstancePtr)
 Reads one 32-bit word from the receive FIFO. More...
 
void XLlFifo_TxPutWord (XLlFifo *InstancePtr, u32 Word)
 Writes one 32-bit word to the transmit FIFO. More...
 

Macro Definition Documentation

#define XLlFifo_IntClear (   InstancePtr,
  Mask 
)
Value:
XLlFifo_WriteReg((InstancePtr)->BaseAddress, XLLF_ISR_OFFSET, \
((Mask) & XLLF_INT_ALL_MASK))
#define XLLF_ISR_OFFSET
Interrupt Status.
Definition: xllfifo_hw.h:65
#define XLLF_INT_ALL_MASK
All the ints.
Definition: xllfifo_hw.h:117
#define XLlFifo_WriteReg(BaseAddress, RegOffset, Value)
Writes an XLlFifo register value.
Definition: xllfifo_hw.h:241

Clears selected pending FIFO interrupts.

XLlFifo_IntClear clears pending interrupts specified in Mask for the FIFO specified by InstancePtr. The corresponding pending interrupt for each bit set to 1 in Mask is cleared. In other words, XLlFifo_IntClear uses the "set a bit to clear it" scheme.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
[in]MaskContains a bit mask of the pending interrupts to clear. The mask can be formed using a set of bitwise or'd values from the XLLF_INT_*_MASK preprocessor symbols.
Note
C-style signature void XLlFifo_IntClear(XLlFifo *InstancePtr, u32 Mask)

Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().

#define XLlFifo_IntDisable (   InstancePtr,
  Mask 
)
Value:
{ \
u32 Reg = XLlFifo_ReadReg((InstancePtr)->BaseAddress, \
Reg &= ~((Mask) & XLLF_INT_ALL_MASK); \
XLlFifo_WriteReg((InstancePtr)->BaseAddress, XLLF_IER_OFFSET, \
Reg); \
}
#define XLlFifo_ReadReg(BaseAddress, RegOffset)
Reads an XLlFifo register value.
Definition: xllfifo_hw.h:212
#define XLLF_IER_OFFSET
Interrupt Enable.
Definition: xllfifo_hw.h:66
#define XLLF_INT_ALL_MASK
All the ints.
Definition: xllfifo_hw.h:117
#define XLlFifo_WriteReg(BaseAddress, RegOffset, Value)
Writes an XLlFifo register value.
Definition: xllfifo_hw.h:241

Disables selected FIFO interrupts.

XLlFifo_IntDisable disables the interrupts specified in Mask for the FIFO specified by InstancePtr. The corresponding interrupt for each bit set to 1 in Mask is disabled. In other words, XLlFifo_IntDisable uses the "set a bit to clear it" scheme.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
[in]MaskContains a bit mask of the interrupts to disable. The mask can be formed using a set of bitwise or'd values from the XLLF_INT_*_MASK preprocessor symbols.
Note
C-style signature void XLlFifo_IntDisable(XLlFifo *InstancePtr, u32 Mask)
#define XLlFifo_IntEnable (   InstancePtr,
  Mask 
)
Value:
{ \
u32 Reg = XLlFifo_ReadReg((InstancePtr)->BaseAddress, \
Reg |= ((Mask) & XLLF_INT_ALL_MASK); \
XLlFifo_WriteReg((InstancePtr)->BaseAddress, XLLF_IER_OFFSET, \
Reg); \
}
#define XLlFifo_ReadReg(BaseAddress, RegOffset)
Reads an XLlFifo register value.
Definition: xllfifo_hw.h:212
#define XLLF_IER_OFFSET
Interrupt Enable.
Definition: xllfifo_hw.h:66
#define XLLF_INT_ALL_MASK
All the ints.
Definition: xllfifo_hw.h:117
#define XLlFifo_WriteReg(BaseAddress, RegOffset, Value)
Writes an XLlFifo register value.
Definition: xllfifo_hw.h:241

Enables selected FIFO interrupts.

XLlFifo_IntEnable enables the interrupts specified in Mask for the FIFO specified by InstancePtr. The corresponding interrupt for each bit set to 1 in Mask is enabled.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
[in]MaskContains a bit mask of the interrupts to enable. The mask can be formed using a set of bitwise or'd values from the XLLF_INT_*_MASK preprocessor symbols.
Note
C-style signature void XLlFifo_IntEnable(XLlFifo *InstancePtr, u32 Mask)

Referenced by XLlFifoInterruptExample().

#define XLlFifo_IntPending (   InstancePtr)
Value:
(XLlFifo_ReadReg((InstancePtr)->BaseAddress, XLLF_IER_OFFSET) & \
XLlFifo_ReadReg((InstancePtr)->BaseAddress, XLLF_ISR_OFFSET))
#define XLlFifo_ReadReg(BaseAddress, RegOffset)
Reads an XLlFifo register value.
Definition: xllfifo_hw.h:212
#define XLLF_IER_OFFSET
Interrupt Enable.
Definition: xllfifo_hw.h:66
#define XLLF_ISR_OFFSET
Interrupt Status.
Definition: xllfifo_hw.h:65

Returns the pending FIFO interrupt mask.

XLlFifo_IntPending returns a bit mask of the pending interrupts for the FIFO specified by InstancePtr. Each bit set to 1 in the return value represents a pending interrupt.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_IntPending returns a bit mask of the interrupts that are pending. The mask is a set of bitwise or'd values from the XLLF_INT_*_MASK preprocessor symbols.
Note
C-style signature u32 XLlFifo_IntPending(XLlFifo *InstancePtr)
#define XLlFifo_IsRxDone (   InstancePtr)
Value:
((XLlFifo_ReadReg((InstancePtr)->BaseAddress, XLLF_ISR_OFFSET) & \
? TRUE : FALSE)
#define XLLF_INT_RC_MASK
Receive complete.
Definition: xllfifo_hw.h:101
#define XLlFifo_ReadReg(BaseAddress, RegOffset)
Reads an XLlFifo register value.
Definition: xllfifo_hw.h:212
#define XLLF_ISR_OFFSET
Interrupt Status.
Definition: xllfifo_hw.h:65

Reports whether receive is complete.

XLlFifo_IsRxDone returns true if the reception in the receive channel of the FIFO, specified by InstancePtr, is complete. XLlFifo_IsRxDone works only if the RC bit in the ISR register is cleared before receiving a frame.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_IsRxDone returns TRUE when the receive channel of the FIFO is complete. Otherwise, XLlFifo_IsRxDone returns FALSE.
Note
C-style signature int XLlFifo_IsRxDone(XLlFifo *InstancePtr)

Referenced by RxReceive().

#define XLlFifo_IsRxEmpty (   InstancePtr)
Value:
((XLlFifo_ReadReg((InstancePtr)->BaseAddress, XLLF_RDFO_OFFSET) == 0) \
? TRUE : FALSE)
#define XLlFifo_ReadReg(BaseAddress, RegOffset)
Reads an XLlFifo register value.
Definition: xllfifo_hw.h:212
#define XLLF_RDFO_OFFSET
Receive Occupancy.
Definition: xllfifo_hw.h:75

Reports whether the receive channel is empty.

XLlFifo_IsRxEmpty returns true if the receive channel of the FIFO, specified by InstancePtr, is empty.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_IsRxEmpty returns TRUE when the receive channel of the FIFO is empty. Otherwise, XLlFifo_IsRxEmpty returns FALSE.
Note
C-style signature int XLlFifo_IsRxEmpty(XLlFifo *InstancePtr)
#define XLlFifo_IsTxDone (   InstancePtr)
Value:
((XLlFifo_ReadReg((InstancePtr)->BaseAddress, XLLF_ISR_OFFSET) & \
? TRUE : FALSE)
#define XLlFifo_ReadReg(BaseAddress, RegOffset)
Reads an XLlFifo register value.
Definition: xllfifo_hw.h:212
#define XLLF_ISR_OFFSET
Interrupt Status.
Definition: xllfifo_hw.h:65
#define XLLF_INT_TC_MASK
Transmit complete.
Definition: xllfifo_hw.h:100

Reports whether transmit is complete.

XLlFifo_IsTxDone returns true if the transmission in the transmit channel of the FIFO, specified by InstancePtr, is complete. XLlFifo_IsTxDone works only if the TC bit in the IS register is cleared before sending a frame.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_IsTxDone returns TRUE when the transmit channel of the FIFO is complete. Otherwise, XLlFifo_IsTxDone returns FALSE.
Note
C-style signature int XLlFifo_IsTxDone(XLlFifo *InstancePtr)
#define XLlFifo_Read (   InstancePtr,
  BufPtr,
  Bytes 
)    XStrm_Read(&((InstancePtr)->RxStreamer), (BufPtr), (Bytes))

Reads bytes from the FIFO receive channel.

XLlFifo_Read reads Bytes bytes from the receive channel of the FIFO referenced by InstancePtr to the block of memory, referenced by BufPtr.

Care must be taken to ensure that the number of bytes read with one or more calls to XLlFifo_Read() does not exceed the number of bytes available given from the last call to XLlFifo_RxGetLen().

Parameters
[in,out]InstancePtrReferences the FIFO on which to operate.
[out]BufPtrSpecifies the memory address to place the data read.
[in]BytesSpecifies the number of bytes to read.
Note
Error handling is handled through hardware exceptions and interrupts.

C-style signature void XLlFifo_Read(XLlFifo *InstancePtr, void *BufPtr, unsigned Bytes)

#define XLlFifo_ReadRdr (   InstancePtr)    XLlFifo_ReadReg((InstancePtr)->BaseAddress, XLLF_RDR_OFFSET)

Reads the receive destination address.

XLlFifo_ReadTdr returns the contents of the Receive Destination Register(RDR).

The RDR contains destination address corresponding to the valid packet that is received. The RDR should only be read when a receive packet is available for processing (the receive occupancy is not zero). Once the RDR is read, the receive packet data should be read from the receive data FIFO before the RDR is read again. The RDR values are stored in the receive data FIFO by the AXI4-Stream FIFO core with the data of each packet. The RDR value for the subsequent packet to be processed is moved to the RDR when the previous RDR value has been read.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
The Receive Destination address read from the RDR.
Note
C-style signature u32 XLlFifo_ReadRdr(XLlFifo *InstancePtr)
#define XLlFifo_Reset (   InstancePtr)
Value:
XLlFifo_WriteReg((InstancePtr)->BaseAddress, XLLF_LLR_OFFSET, \
#define XLLF_LLR_RESET_MASK
Local Link reset value.
Definition: xllfifo_hw.h:130
#define XLLF_LLR_OFFSET
Local Link Reset.
Definition: xllfifo_hw.h:79
#define XLlFifo_WriteReg(BaseAddress, RegOffset, Value)
Writes an XLlFifo register value.
Definition: xllfifo_hw.h:241

Resets both FIFO channels and the local-link interface.

XLlFifo_Reset resets both the Tx and Rx channels and the local-link interface of the FIFO specified by InstancePtr. XLlFifo_TxReset also sends a reset pulse to the downstream device (for example, TEMAC). XLlFifo_Reset drops any bytes in the FIFO not yet retrieved or transmitted.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Note
C-style signature void XLlFifo_Reset(XLlFifo *InstancePtr)
#define XLlFifo_RxGetLen (   InstancePtr)    XStrm_RxGetLen(&((InstancePtr)->RxStreamer))

Returns the next receive frame length in bytes.

XLlFifo_RxGetLen notifies the hardware that the program is ready to receive the next frame from the receive channel of the FIFO, specified by InstancePtr.

Note that the program must first call XLlFifo_RxGetLen before pulling data out of the receive channel of the FIFO with XLlFifo_Read.

Parameters
[in,out]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_RxGetLen returns the number of bytes available in the next frame.
Note
C-style signature u32 XLlFifo_RxGetLen(XLlFifo *InstancePtr)
#define XLlFifo_RxOccupancy (   InstancePtr)    XStrm_RxOccupancy(&((InstancePtr)->RxStreamer))

Returns receive occupancy in 32-bit words.

XLlFifo_RxOccupancy returns the number of 32-bit words available (occupancy) to be read from the receive channel of the FIFO specified by InstancePtr.

The xps_ll_fifo core uses the same fifo to store data values and frame length values. Upon initialization, the XLlFifo_RxOccupancy gives the value of 1, which means one length value (a reserved fifo location) and no data values.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_RxOccupancy returns the occupancy count for the specified packet FIFO.
Note
C-style signature u32 XLlFifo_RxOccupancy(XLlFifo *InstancePtr)
#define XLlFifo_RxReset (   InstancePtr)
Value:
XLlFifo_WriteReg((InstancePtr)->BaseAddress, XLLF_RDFR_OFFSET, \
#define XLLF_RDFR_OFFSET
Receive Reset.
Definition: xllfifo_hw.h:74
#define XLLF_RDFR_RESET_MASK
receive reset value
Definition: xllfifo_hw.h:128
#define XLlFifo_WriteReg(BaseAddress, RegOffset, Value)
Writes an XLlFifo register value.
Definition: xllfifo_hw.h:241

Resets the FIFO receive channel.

XLlFifo_RxReset resets the receive channel of the FIFO specified by InstancePtr. XLlFifo_RxReset drops any bytes in the FIFO not yet retrieved.

The calling software may want to test for the completion of the reset by reading the interrupt status (IS) register and testing for the Rx Reset complete (RRC) bit.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Note
C-style signature void XLlFifo_RxReset(XLlFifo *InstancePtr)

Referenced by XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

#define XLlFifo_Status (   InstancePtr)    XLlFifo_ReadReg((InstancePtr)->BaseAddress, XLLF_ISR_OFFSET)

Returns the FIFO interrupt status mask.

XLlFifo_Status returns a bit mask of the interrupt status register (ISR) for the FIFO specified by InstancePtr. XLlFifo_Status can be used to query the status of the FIFO without having to have interrupts enabled.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_IntStatus returns a bit mask of the status conditions. The mask is a set of bitwise or'd values from the XLLF_INT_*_MASK preprocessor symbols.
Note
C-style signature u32 XLlFifo_IntStatus(XLlFifo *InstancePtr)

Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().

#define XLlFifo_TxReset (   InstancePtr)
Value:
XLlFifo_WriteReg((InstancePtr)->BaseAddress, XLLF_TDFR_OFFSET, \
#define XLLF_TDFR_OFFSET
Transmit Reset.
Definition: xllfifo_hw.h:68
#define XLLF_TDFR_RESET_MASK
Transmit reset value.
Definition: xllfifo_hw.h:129
#define XLlFifo_WriteReg(BaseAddress, RegOffset, Value)
Writes an XLlFifo register value.
Definition: xllfifo_hw.h:241

Resets the FIFO transmit channel.

XLlFifo_TxReset resets the transmit channel of the FIFO specified by InstancePtr. XLlFifo_TxReset drops any bytes in the FIFO not yet transmitted.

The calling software may want to test for the completion of the reset by reading the interrupt status (IS) register and testing for the Tx Reset complete (TRC) bit.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Note
C-style signature void XLlFifo_TxReset(XLlFifo *InstancePtr)

Referenced by XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

#define XLlFifo_TxSetLen (   InstancePtr,
  Bytes 
)    XStrm_TxSetLen(&((InstancePtr)->TxStreamer), (Bytes))

Starts a transmit of the given byte length.

XLlFifo_TxSetLen begins a hardware transfer of Bytes bytes out of the transmit channel of the FIFO specified by InstancePtr.

Parameters
[in,out]InstancePtrReferences the FIFO on which to operate.
[in]BytesSpecifies the frame length in bytes.
Note
C-style signature void XLlFifo_TxSetLen(XLlFifo *InstancePtr, u32 Bytes)
#define XLlFifo_TxVacancy (   InstancePtr)    XStrm_TxVacancy(&((InstancePtr)->TxStreamer))

Returns transmit vacancy in 32-bit words.

XLlFifo_TxVacancy returns the number of unused 32 bit words available (vacancy) in the send channel of the FIFO specified by InstancePtr.

The xps_ll_fifo core uses the same fifo to store data values and frame length values. Upon initialization, the XLlFifo_TxVacancy gives the value of FIFO_WIDTH - 1, which means one length value used (a reserved fifo location) and no data values yet present.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_TxVacancy returns the vacancy count in 32-bit words for the specified FIFO.
Note
C-style signature u32 XLlFifo_TxVacancy(XLlFifo *InstancePtr)
#define XLlFifo_Write (   InstancePtr,
  BufPtr,
  Bytes 
)    XStrm_Write(&((InstancePtr)->TxStreamer), (BufPtr), (Bytes))

Writes bytes to the FIFO transmit channel.

XLlFifo_Write writes Bytes bytes of the block of memory, referenced by BufPtr, to the transmit channel of the FIFO referenced by InstancePtr.

Care must be taken to ensure that the number of bytes written with one or more calls to XLlFifo_Write() matches the number of bytes given in the next call to XLlFifo_TxSetLen().

Parameters
[in,out]InstancePtrReferences the FIFO on which to operate.
[in]BufPtrSpecifies the memory address of data to write.
[in]BytesSpecifies the number of bytes to write.
Note
Error handling is handled through hardware exceptions and interrupts.

C-style signature void XLlFifo_Write(XLlFifo *InstancePtr, void *BufPtr, unsigned Bytes)

#define XLlFifo_WriteTdr (   InstancePtr,
  Tdest 
)
Value:
XLlFifo_WriteReg((InstancePtr)->BaseAddress, XLLF_TDR_OFFSET, \
Tdest & 0xF)
#define XLLF_TDR_OFFSET
Transmit Destination.
Definition: xllfifo_hw.h:80
#define XLlFifo_WriteReg(BaseAddress, RegOffset, Value)
Writes an XLlFifo register value.
Definition: xllfifo_hw.h:241

Writes the transmit destination address.

XLlFifo_WriteTdr writes to the Transmit Destination Register (TDR)

The TDR stores the destination address corresponding to the packet to be transmitted. When presenting a transmit packet to the AXI4-Stream FIFO core the following sequence should be followed

  • Write the destination address into TDR first,
  • Write the packet data to the Transmit Data FIFO next
  • Write the length of the packet into the Transmit Length Register.
Parameters
[in]InstancePtrReferences the FIFO on which to operate.
[in]TdestTransmit Destination address to be written to TDR.
Note
C-style signature void XLlFifo_WriteTdr(XLlFifo *InstancePtr, u32 Tdest)

Typedef Documentation

typedef struct XLlFifo XLlFifo

Defines the XLlFifo driver instance.

This typedef defines a run-time instance of an XLlFifo device.

Defines the XLlFifo hardware configuration.

Function Documentation

XLlFifo_Config* XLlFfio_LookupConfig ( UINTPTR  BaseAddress)

Looks up the XLlFifo configuration.

Looks up the device configuration based on the unique device ID/BaseAddress. The XLlFifo_ConfigTable[] contains the configuration info for each device in the system.

Parameters
[in]BaseAddressContains the base address of the device.
Returns
A pointer to the configuration found or NULL if the specified device ID/BaseAddress was not found. See xllfifo.h for the definition of XLlFifo_Config.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XLlFifo_Config::Name.

Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().

int XLlFifo_CfgInitialize ( XLlFifo *  InstancePtr,
XLlFifo_Config *  Config,
UINTPTR  EffectiveAddress 
)

Initializes the XLlFifo driver from a config.

XLlFifo_CfgInitialize initializes an XPS_ll_Fifo device along with the InstancePtr that references it.

Parameters
[out]InstancePtrPointer to the AXI Streaming FIFO instance to be worked on.
[in]ConfigHardware configuration for the core.
[in]EffectiveAddressDevice base address in the virtual memory address space. The caller must keep the mapping from EffectiveAddr to the physical base address unchanged after this call. If address translation is not used, pass Config->BaseAddress as the physical address.
Returns
  • XST_SUCCESS if initialization succeeds.
  • XST_INVALID_PARAM if Config is NULL.

References XLlFifo::Axi4BaseAddress, XLlFifo_Config::Axi4BaseAddress, XLlFifo::BaseAddress, XLlFifo::Datainterface, XLlFifo_Config::Datainterface, FIFO_WIDTH_BYTES, XLlFifo::IntId, XLlFifo_Config::IntId, XLlFifo::IntrParent, XLlFifo_Config::IntrParent, XLlFifo::IsReady, XLlFifo::RxStreamer, XLlFifo::TxStreamer, XLLF_LLR_OFFSET, XLLF_RDFR_RESET_MASK, XLlFifo_iRead_Aligned(), XLlFifo_iRxGetLen(), XLlFifo_iRxOccupancy(), XLlFifo_iTxSetLen(), XLlFifo_iTxVacancy(), XLlFifo_iWrite_Aligned(), XLlFifo_RxReset, XLlFifo_TxReset, XLlFifo_WriteReg, XStrm_RxInitialize(), and XStrm_TxInitialize().

Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().

void XLlFifo_Initialize ( XLlFifo *  InstancePtr,
UINTPTR  BaseAddress 
)

Initializes the XLlFifo driver from a base address.

XLlFifo_Initialize initializes an XPS_ll_Fifo device along with the InstancePtr that references it.

Parameters
[out]InstancePtrReferences the memory instance to be associated with the FIFO device upon initialization.
[in]BaseAddressProcessor address used to access the base address of the Fifo device.

References XLlFifo::Axi4BaseAddress, XLlFifo::BaseAddress, FIFO_WIDTH_BYTES, XLlFifo::IsReady, XLlFifo::RxStreamer, XLlFifo::TxStreamer, XLLF_LLR_OFFSET, XLLF_RDFR_RESET_MASK, XLlFifo_iRead_Aligned(), XLlFifo_iRxGetLen(), XLlFifo_iRxOccupancy(), XLlFifo_iTxSetLen(), XLlFifo_iTxVacancy(), XLlFifo_iWrite_Aligned(), XLlFifo_RxReset, XLlFifo_TxReset, XLlFifo_WriteReg, XStrm_RxInitialize(), and XStrm_TxInitialize().

u32 XLlFifo_iRxGetLen ( XLlFifo *  InstancePtr)

Returns the next receive frame length in bytes.

XLlFifo_iRxGetLen notifies the hardware that the program is ready to receive the next frame from the receive channel of the FIFO specified by InstancePtr.

Note that the program must first call XLlFifo_iRxGetLen before pulling data out of the receive channel of the FIFO with XLlFifo_Read.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_iRxGetLen returns the number of bytes available in the next frame.

References XLlFifo::BaseAddress, XLLF_RLF_OFFSET, and XLlFifo_ReadReg.

Referenced by RxReceive(), XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

u32 XLlFifo_iRxOccupancy ( XLlFifo *  InstancePtr)

Returns receive occupancy in 32-bit words.

XLlFifo_iRxOccupancy returns the number of 32-bit words available (occupancy) to be read from the receive channel of the FIFO, specified by InstancePtr.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_iRxOccupancy returns the occupancy count in 32-bit words for the specified FIFO.

References XLlFifo::BaseAddress, XLLF_RDFO_OFFSET, and XLlFifo_ReadReg.

Referenced by RxReceive(), XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

void XLlFifo_iTxSetLen ( XLlFifo *  InstancePtr,
u32  Bytes 
)

Starts a transmit of the given byte length.

XLlFifo_iTxSetLen begins a hardware transfer of data out of the transmit channel of the FIFO specified by InstancePtr. Bytes specifies the number of bytes in the frame to transmit.

Note that Bytes (rounded up to the nearest whole 32-bit word) must match the number of words just written using one or more calls to XLlFifo_iWrite_Aligned().

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
[in]BytesSpecifies the number of bytes to transmit.

References XLlFifo::BaseAddress, XLLF_TLF_OFFSET, and XLlFifo_WriteReg.

Referenced by TxSend(), XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

u32 XLlFifo_iTxVacancy ( XLlFifo *  InstancePtr)

Returns transmit vacancy in 32-bit words.

XLlFifo_iTxVacancy returns the number of unused 32 bit words available (vacancy) in the send channel of the FIFO, specified by InstancePtr.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_iTxVacancy returns the vacancy count in 32-bit words for the specified FIFO.

References XLlFifo::BaseAddress, XLLF_TDFV_OFFSET, and XLlFifo_ReadReg.

Referenced by TxSend(), XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

u32 XLlFifo_RxGetWord ( XLlFifo *  InstancePtr)

Reads one 32-bit word from the receive FIFO.

XLlFifo_RxGetWord reads one 32 bit word from the FIFO specified by InstancePtr.

XLlFifo_RxGetLen or XLlFifo_iRxGetLen must be called before calling XLlFifo_RxGetWord. Otherwise, the hardware raises an Over Read Exception.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
Returns
XLlFifo_RxGetWord returns the 32 bit word read from the FIFO.

References XLlFifo::Datainterface, XLLF_AXI4_RDFD_OFFSET, XLLF_RDFD_OFFSET, and XLlFifo_ReadReg.

Referenced by RxReceive(), and XLlFifo_iRead_Aligned().

void XLlFifo_TxPutWord ( XLlFifo *  InstancePtr,
u32  Word 
)

Writes one 32-bit word to the transmit FIFO.

XLlFifo_TxPutWord writes the 32 bit word, Word to the FIFO specified by InstancePtr.

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
[in]WordData word to be written to FIFO.

References XLlFifo::Datainterface, XLLF_AXI4_TDFD_OFFSET, XLLF_TDFD_OFFSET, and XLlFifo_WriteReg.

Referenced by TxSend(), and XLlFifo_iWrite_Aligned().