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

Data Structures

struct  XStrm_RxFifoStreamer
 Defines the receive byte-streamer instance. More...
 
struct  XStrm_TxFifoStreamer
 Defines the transmit byte-streamer instance. More...
 

Macros

#define FIFO_WIDTH_BYTES   4
 FIFO keyhole width in bytes. More...
 
#define XLlFifo_ReadReg(BaseAddress, RegOffset)   (Xil_In32((BaseAddress) + (RegOffset)))
 Reads an XLlFifo register value. More...
 
#define XLlFifo_WriteReg(BaseAddress, RegOffset, Value)   ((Xil_Out32((BaseAddress) + (RegOffset), (Value))))
 Writes an XLlFifo register value. More...
 
#define min(x, y)   (((x) < (y)) ? (x) : (y))
 Returns the smaller of two values. More...
 
#define LARGEST_FIFO_KEYHOLE_SIZE_WORDS   4
 FIFO keyhole size in 32-bit words. More...
 
#define XStrm_TxVacancy(InstancePtr)
 Returns transmit vacancy in 32-bit words. More...
 
#define XStrm_RxOccupancy(InstancePtr)
 Returns receive occupancy in 32-bit words. More...
 
#define XStrm_IsRxInternalEmpty(InstancePtr)   (((InstancePtr)->FrmByteCnt == 0) ? TRUE : FALSE)
 Reports whether the streamer holding buffer is empty. More...
 

Typedefs

typedef struct XStrm_RxFifoStreamer XStrm_RxFifoStreamer
 Defines the receive byte-streamer instance. More...
 
typedef struct XStrm_TxFifoStreamer XStrm_TxFifoStreamer
 Defines the transmit byte-streamer instance. More...
 

Functions

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...
 
int XLlFifo_iRead_Aligned (XLlFifo *InstancePtr, void *BufPtr, unsigned WordCount)
 Reads aligned 32-bit words from the receive FIFO. 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...
 
int XLlFifo_iWrite_Aligned (XLlFifo *InstancePtr, void *BufPtr, unsigned WordCount)
 Writes aligned 32-bit words to the transmit FIFO. More...
 
int XLlFifo_CfgInitialize (XLlFifo *InstancePtr, XLlFifo_Config *Config, UINTPTR EffectiveAddress)
 Initializes the XLlFifo driver from a config. 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...
 
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...
 
void XStrm_RxInitialize (XStrm_RxFifoStreamer *InstancePtr, unsigned FifoWidth, void *FifoInstance, XStrm_XferFnType ReadFn, XStrm_GetLenFnType GetLenFn, XStrm_GetOccupancyFnType GetOccupancyFn)
 Initializes a receive byte-streamer instance. More...
 
void XStrm_TxInitialize (XStrm_TxFifoStreamer *InstancePtr, unsigned FifoWidth, void *FifoInstance, XStrm_XferFnType WriteFn, XStrm_SetLenFnType SetLenFn, XStrm_GetVacancyFnType GetVacancyFn)
 Initializes a transmit byte-streamer instance. More...
 
u32 XStrm_RxGetLen (XStrm_RxFifoStreamer *InstancePtr)
 Returns the next receive frame length in bytes. More...
 
void XStrm_Read (XStrm_RxFifoStreamer *InstancePtr, void *BufPtr, unsigned Bytes)
 Reads bytes from the receive streamer. More...
 
void XStrm_TxSetLen (XStrm_TxFifoStreamer *InstancePtr, u32 Bytes)
 Flushes the streamer and starts a transmit. More...
 
void XStrm_Write (XStrm_TxFifoStreamer *InstancePtr, void *BufPtr, unsigned Bytes)
 Writes bytes to the transmit streamer. More...
 

Registers

#define XLLF_ISR_OFFSET   0x00000000
 Interrupt Status. More...
 
#define XLLF_IER_OFFSET   0x00000004
 Interrupt Enable. More...
 
#define XLLF_TDFR_OFFSET   0x00000008
 Transmit Reset. More...
 
#define XLLF_TDFV_OFFSET   0x0000000c
 Transmit Vacancy. More...
 
#define XLLF_TDFD_OFFSET   0x00000010
 Transmit Data. More...
 
#define XLLF_AXI4_TDFD_OFFSET   0x00000000
 Axi4 Transmit Data. More...
 
#define XLLF_TLF_OFFSET   0x00000014
 Transmit Length. More...
 
#define XLLF_RDFR_OFFSET   0x00000018
 Receive Reset. More...
 
#define XLLF_RDFO_OFFSET   0x0000001c
 Receive Occupancy. More...
 
#define XLLF_RDFD_OFFSET   0x00000020
 Receive Data. More...
 
#define XLLF_AXI4_RDFD_OFFSET   0x00001000
 Axi4 Receive Data. More...
 
#define XLLF_RLF_OFFSET   0x00000024
 Receive Length. More...
 
#define XLLF_LLR_OFFSET   0x00000028
 Local Link Reset. More...
 
#define XLLF_TDR_OFFSET   0x0000002C
 Transmit Destination. More...
 
#define XLLF_RDR_OFFSET   0x00000030
 Receive Destination. More...
 

Interrupt bits

These bits are associated with the XLLF_IER_OFFSET and XLLF_ISR_OFFSET registers.

#define XLLF_INT_RPURE_MASK   0x80000000
 Receive under-read. More...
 
#define XLLF_INT_RPORE_MASK   0x40000000
 Receive over-read. More...
 
#define XLLF_INT_RPUE_MASK   0x20000000
 Receive underrun (empty) More...
 
#define XLLF_INT_TPOE_MASK   0x10000000
 Transmit overrun. More...
 
#define XLLF_INT_TC_MASK   0x08000000
 Transmit complete. More...
 
#define XLLF_INT_RC_MASK   0x04000000
 Receive complete. More...
 
#define XLLF_INT_TSE_MASK   0x02000000
 Transmit length mismatch. More...
 
#define XLLF_INT_TRC_MASK   0x01000000
 Transmit reset complete. More...
 
#define XLLF_INT_RRC_MASK   0x00800000
 Receive reset complete. More...
 
#define XLLF_INT_TFPF_MASK   0x00400000
 Tx FIFO Programmable Full, AXI FIFO MM2S Only. More...
 
#define XLLF_INT_TFPE_MASK   0x00200000
 Tx FIFO Programmable Empty AXI FIFO MM2S Only. More...
 
#define XLLF_INT_RFPF_MASK   0x00100000
 Rx FIFO Programmable Full AXI FIFO MM2S Only. More...
 
#define XLLF_INT_RFPE_MASK   0x00080000
 Rx FIFO Programmable Empty AXI FIFO MM2S Only. More...
 
#define XLLF_INT_ALL_MASK   0xfff80000
 All the ints. More...
 
#define XLLF_INT_ERROR_MASK   0xf2000000
 Error status ints. More...
 
#define XLLF_INT_RXERROR_MASK   0xe0000000
 Receive Error status ints. More...
 
#define XLLF_INT_TXERROR_MASK   0x12000000
 Transmit Error status ints. More...
 

Reset register values

These bits are associated with the XLLF_TDFR_OFFSET and XLLF_RDFR_OFFSET reset registers.

#define XLLF_RDFR_RESET_MASK   0x000000a5
 receive reset value More...
 
#define XLLF_TDFR_RESET_MASK   0x000000a5
 Transmit reset value. More...
 
#define XLLF_LLR_RESET_MASK   0x000000a5
 Local Link reset value. More...
 

Debug register helpers

#define XLlFifo_reg_name(RegOffset)
 Returns a debug name string for an XLlFifo register offset. More...
 
#define XLlFifo_print_reg_o(BaseAddress, RegOffset, Value)
 Prints an XLlFifo register write in debug builds. More...
 
#define XLlFifo_print_reg_i(BaseAddress, RegOffset, Value)
 Prints an XLlFifo register read in debug builds. More...
 

Macro Definition Documentation

#define FIFO_WIDTH_BYTES   4

FIFO keyhole width in bytes.

Referenced by XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

#define LARGEST_FIFO_KEYHOLE_SIZE_WORDS   4

FIFO keyhole size in 32-bit words.

#define min (   x,
  y 
)    (((x) < (y)) ? (x) : (y))

Returns the smaller of two values.

Referenced by XStrm_Read(), and XStrm_Write().

#define XLLF_AXI4_RDFD_OFFSET   0x00001000

Axi4 Receive Data.

Referenced by XLlFifo_RxGetWord().

#define XLLF_AXI4_TDFD_OFFSET   0x00000000

Axi4 Transmit Data.

Referenced by XLlFifo_TxPutWord().

#define XLLF_IER_OFFSET   0x00000004

Interrupt Enable.

#define XLLF_INT_ALL_MASK   0xfff80000

All the ints.

Referenced by XLlFifoInterruptExample().

#define XLLF_INT_ERROR_MASK   0xf2000000

Error status ints.

#define XLLF_INT_RC_MASK   0x04000000

Receive complete.

#define XLLF_INT_RFPE_MASK   0x00080000

Rx FIFO Programmable Empty AXI FIFO MM2S Only.

#define XLLF_INT_RFPF_MASK   0x00100000

Rx FIFO Programmable Full AXI FIFO MM2S Only.

#define XLLF_INT_RPORE_MASK   0x40000000

Receive over-read.

#define XLLF_INT_RPUE_MASK   0x20000000

Receive underrun (empty)

#define XLLF_INT_RPURE_MASK   0x80000000

Receive under-read.

#define XLLF_INT_RRC_MASK   0x00800000

Receive reset complete.

#define XLLF_INT_RXERROR_MASK   0xe0000000

Receive Error status ints.

#define XLLF_INT_TC_MASK   0x08000000

Transmit complete.

#define XLLF_INT_TFPE_MASK   0x00200000

Tx FIFO Programmable Empty AXI FIFO MM2S Only.

#define XLLF_INT_TFPF_MASK   0x00400000

Tx FIFO Programmable Full, AXI FIFO MM2S Only.

#define XLLF_INT_TPOE_MASK   0x10000000

Transmit overrun.

#define XLLF_INT_TRC_MASK   0x01000000

Transmit reset complete.

#define XLLF_INT_TSE_MASK   0x02000000

Transmit length mismatch.

#define XLLF_INT_TXERROR_MASK   0x12000000

Transmit Error status ints.

#define XLLF_ISR_OFFSET   0x00000000

Interrupt Status.

#define XLLF_LLR_OFFSET   0x00000028

Local Link Reset.

Referenced by XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

#define XLLF_LLR_RESET_MASK   0x000000a5

Local Link reset value.

#define XLLF_RDFD_OFFSET   0x00000020

Receive Data.

Referenced by XLlFifo_RxGetWord().

#define XLLF_RDFO_OFFSET   0x0000001c

Receive Occupancy.

Referenced by XLlFifo_iRxOccupancy().

#define XLLF_RDFR_OFFSET   0x00000018

Receive Reset.

#define XLLF_RDFR_RESET_MASK   0x000000a5

receive reset value

Referenced by XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

#define XLLF_RDR_OFFSET   0x00000030

Receive Destination.

#define XLLF_RLF_OFFSET   0x00000024

Receive Length.

Referenced by XLlFifo_iRxGetLen().

#define XLLF_TDFD_OFFSET   0x00000010

Transmit Data.

Referenced by XLlFifo_TxPutWord().

#define XLLF_TDFR_OFFSET   0x00000008

Transmit Reset.

#define XLLF_TDFR_RESET_MASK   0x000000a5

Transmit reset value.

#define XLLF_TDFV_OFFSET   0x0000000c

Transmit Vacancy.

Referenced by XLlFifo_iTxVacancy().

#define XLLF_TDR_OFFSET   0x0000002C

Transmit Destination.

#define XLLF_TLF_OFFSET   0x00000014

Transmit Length.

Referenced by XLlFifo_iTxSetLen().

#define XLlFifo_print_reg_i (   BaseAddress,
  RegOffset,
  Value 
)
Value:
xdbg_printf(XDBG_DEBUG_FIFO_REG, "%s(0x%08x) -> 0x%08x\n", \
XLlFifo_reg_name(RegOffset), \
(RegOffset) + (BaseAddress), (Value))
#define XLlFifo_reg_name(RegOffset)
Returns a debug name string for an XLlFifo register offset.
Definition: xllfifo_hw.h:147

Prints an XLlFifo register read in debug builds.

Parameters
[in]BaseAddressDevice base address.
[in]RegOffsetFIFO register offset.
[in]ValueValue that was read.
#define XLlFifo_print_reg_o (   BaseAddress,
  RegOffset,
  Value 
)
Value:
xdbg_printf(XDBG_DEBUG_FIFO_REG, "0x%08x -> %s(0x%08x)\n", (Value), \
XLlFifo_reg_name(RegOffset), \
(RegOffset) + (BaseAddress))
#define XLlFifo_reg_name(RegOffset)
Returns a debug name string for an XLlFifo register offset.
Definition: xllfifo_hw.h:147

Prints an XLlFifo register write in debug builds.

Parameters
[in]BaseAddressDevice base address.
[in]RegOffsetFIFO register offset.
[in]ValueValue being written.
#define XLlFifo_ReadReg (   BaseAddress,
  RegOffset 
)    (Xil_In32((BaseAddress) + (RegOffset)))

Reads an XLlFifo register value.

XLlFifo_ReadReg returns the value of the register at the offset, RegOffset, from the memory mapped base address, BaseAddress.

Parameters
[in]BaseAddressSpecifies the base address of the device.
[in]RegOffsetSpecifies the offset from BaseAddress.
Returns
XLlFifo_ReadReg returns the value of the specified register.
Note
C-style signature u32 XLlFifo_ReadReg(u32 BaseAddress, u32 RegOffset)

Referenced by XLlFifo_iRxGetLen(), XLlFifo_iRxOccupancy(), XLlFifo_iTxVacancy(), and XLlFifo_RxGetWord().

#define XLlFifo_reg_name (   RegOffset)
Value:
(((RegOffset) == XLLF_ISR_OFFSET) ? "ISR": \
((RegOffset) == XLLF_IER_OFFSET) ? "IER": \
((RegOffset) == XLLF_TDFR_OFFSET) ? "TDFR {tx reset}": \
((RegOffset) == XLLF_TDFV_OFFSET) ? "TDFV {tx vacancy}": \
((RegOffset) == XLLF_TDFD_OFFSET) ? "TDFD {tx data}": \
((RegOffset) == XLLF_TLF_OFFSET) ? "TLF {tx length}": \
((RegOffset) == XLLF_RDFR_OFFSET) ? "RDFR {rx reset}": \
((RegOffset) == XLLF_RDFO_OFFSET) ? "RDFO {rx occupancy}": \
((RegOffset) == XLLF_RDFD_OFFSET) ? "RDFD {rx data}": \
((RegOffset) == XLLF_RLF_OFFSET) ? "RLF {rx length}": \
"unknown")
#define XLLF_RDFR_OFFSET
Receive Reset.
Definition: xllfifo_hw.h:74
#define XLLF_TLF_OFFSET
Transmit Length.
Definition: xllfifo_hw.h:72
#define XLLF_TDFD_OFFSET
Transmit Data.
Definition: xllfifo_hw.h:70
#define XLLF_RLF_OFFSET
Receive Length.
Definition: xllfifo_hw.h:78
#define XLLF_TDFV_OFFSET
Transmit Vacancy.
Definition: xllfifo_hw.h:69
#define XLLF_TDFR_OFFSET
Transmit Reset.
Definition: xllfifo_hw.h:68
#define XLLF_RDFD_OFFSET
Receive Data.
Definition: xllfifo_hw.h:76
#define XLLF_IER_OFFSET
Interrupt Enable.
Definition: xllfifo_hw.h:66
#define XLLF_ISR_OFFSET
Interrupt Status.
Definition: xllfifo_hw.h:65
#define XLLF_RDFO_OFFSET
Receive Occupancy.
Definition: xllfifo_hw.h:75

Returns a debug name string for an XLlFifo register offset.

Parameters
[in]RegOffsetFIFO register offset.
Returns
A short register name string.
#define XLlFifo_WriteReg (   BaseAddress,
  RegOffset,
  Value 
)    ((Xil_Out32((BaseAddress) + (RegOffset), (Value))))

Writes an XLlFifo register value.

XLlFifo_WriteReg writes the value, Value, to the register at the offset, RegOffset, from the memory mapped base address, BaseAddress.

Parameters
[in]BaseAddressSpecifies the base address of the device.
[in]RegOffsetSpecifies the offset from BaseAddress.
[in]ValueValue to write to the register.
Note
C-style signature void XLlFifo_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Value)

Referenced by XLlFifo_CfgInitialize(), XLlFifo_Initialize(), XLlFifo_iTxSetLen(), and XLlFifo_TxPutWord().

#define XStrm_IsRxInternalEmpty (   InstancePtr)    (((InstancePtr)->FrmByteCnt == 0) ? TRUE : FALSE)

Reports whether the streamer holding buffer is empty.

XStrm_IsRxInternalEmpty returns true if the streamer, specified by InstancePtr, is not holding any bytes in it's internal buffers. Note that this routine does not reflect information about the state of the FIFO used by this streamer.

Parameters
[in]InstancePtrReferences the streamer on which to operate.
Returns
XStrm_IsRxInternalEmpty returns TRUE when the streamer is not holding any bytes in it's internal buffers. Otherwise, XStrm_IsRxInternalEmpty returns FALSE.
Note
C-style signature int XStrm_IsRxInternalEmpty(XStrm_RxFifoStreamer *InstancePtr)
#define XStrm_RxOccupancy (   InstancePtr)
Value:
( \
((*(InstancePtr)->GetOccupancyFn)((InstancePtr)->FifoInstance)) + \
( \
((InstancePtr)->FrmByteCnt) ? \
((InstancePtr)->FifoWidth - (InstancePtr)->HeadIndex) : \
0 \
) \
)
XLlFifo FifoInstance
Driver instance for the AXI FIFO.
Definition: xllfifo_interrupt_example.c:154

Returns receive occupancy in 32-bit words.

XStrm_RxOccupancy returns the number of 32-bit words available (occupancy) to be read from the streamer, specified by InstancePtr, and FIFO this steamer is using.

Parameters
[in]InstancePtrReferences the streamer on which to operate.
Returns
XStrm_RxOccupancy returns the occupancy count in number of 32 bit words.
Note
C-style signature u32 XStrm_RxOccupancy(XStrm_RxFifoStreamer *InstancePtr)

The amount of bytes in the holding buffer (rounded up to whole 32-bit words) is added to the occupancy value of FIFO this streamer is using. This is to ensure the caller gets a little more accurate occupancy value.

#define XStrm_TxVacancy (   InstancePtr)
Value:
(((*(InstancePtr)->GetVacancyFn)((InstancePtr)->FifoInstance)) - \
(((InstancePtr)->TailIndex + 3) / 4))
XLlFifo FifoInstance
Driver instance for the AXI FIFO.
Definition: xllfifo_interrupt_example.c:154

Returns transmit vacancy in 32-bit words.

XStrm_TxVacancy returns the number of unused 32-bit words available (vacancy) between the streamer, specified by InstancePtr, and the FIFO this streamer is using.

Parameters
[in]InstancePtrReferences the streamer on which to operate.
Returns
XStrm_TxVacancy returns the vacancy count in number of 32 bit words.
Note
C-style signature u32 XStrm_TxVacancy(XStrm_TxFifoStreamer *InstancePtr)

The amount of bytes in the holding buffer (rounded up to whole 32-bit words) is subtracted from the vacancy value of FIFO this streamer is using. This is to ensure the caller can write the number words given in the return value and not overflow the FIFO.

Typedef Documentation

Defines the receive byte-streamer instance.

This typedef defines a run-time instance of a receive byte-streamer.

Defines the transmit byte-streamer instance.

This typedef defines a run-time instance of a transmit byte-streamer.

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().

int XLlFifo_iRead_Aligned ( XLlFifo *  InstancePtr,
void *  BufPtr,
unsigned  WordCount 
)

Reads aligned 32-bit words from the receive FIFO.

XLlFifo_iRead_Aligned reads WordCount words from the FIFO referenced by InstancePtr to the block of memory referenced by BufPtr.

XLlFifo_iRead_Aligned assumes that BufPtr is already aligned according to the following hardware limitations: ppc - aligned on 32 bit boundaries to avoid performance penalties from unaligned exception handling. microblaze - aligned on 32 bit boundaries as microblaze does not handle unaligned transfers.

Care must be taken to ensure that the number of words read with one or more calls to XLlFifo_Read() does not exceed the number of bytes (rounded up to the nearest whole 32 bit word) available given from the last call to XLlFifo_RxGetLen().

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
[out]BufPtrSpecifies the memory address to place the data read.
[in]WordCountSpecifies the number of 32 bit words to read.
Returns
XLlFifo_iRead_Aligned always returns XST_SUCCESS. Error handling is otherwise handled through hardware exceptions and interrupts.

References XLlFifo_RxGetWord().

Referenced by XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

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().

int XLlFifo_iWrite_Aligned ( XLlFifo *  InstancePtr,
void *  BufPtr,
unsigned  WordCount 
)

Writes aligned 32-bit words to the transmit FIFO.

XLlFifo_iWrite_Aligned writes WordCount words to the FIFO referenced by InstancePtr from the block of memory referenced by BufPtr.

XLlFifo_iWrite_Aligned assumes that BufPtr is already aligned according to the following hardware limitations: ppc - aligned on 32 bit boundaries to avoid performance penalties from unaligned exception handling. microblaze - aligned on 32 bit boundaries as microblaze does not handle unaligned transfers.

Care must be taken to ensure that the number of words written with one or more calls to XLlFifo_iWrite_Aligned() matches the number of bytes (rounded up to the nearest whole 32 bit word) given in the next call to XLlFifo_iTxSetLen().

Parameters
[in]InstancePtrReferences the FIFO on which to operate.
[in]BufPtrSpecifies the memory address of the data to write.
[in]WordCountSpecifies the number of 32-bit words to write.
Returns
XLlFifo_iWrite_Aligned always returns XST_SUCCESS. Error handling is otherwise handled through hardware exceptions and interrupts.

References XLlFifo_TxPutWord().

Referenced by 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().

void XStrm_Read ( XStrm_RxFifoStreamer *  InstancePtr,
void *  BufPtr,
unsigned  Bytes 
)

Reads bytes from the receive streamer.

XStrm_Read reads Bytes bytes from the FIFO specified 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 XStrm_Read() does not exceed the number of bytes available given from the last call to XStrm_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.

References XStrm_RxFifoStreamer::AlignedBuffer, XStrm_RxFifoStreamer::FifoInstance, XStrm_RxFifoStreamer::FifoWidth, XStrm_RxFifoStreamer::FrmByteCnt, XStrm_RxFifoStreamer::HeadIndex, min, and XStrm_RxFifoStreamer::ReadFn.

u32 XStrm_RxGetLen ( XStrm_RxFifoStreamer *  InstancePtr)

Returns the next receive frame length in bytes.

XStrm_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 XStrm_RxGetLen before pulling data out of the receive channel of the FIFO with XStrm_Read.

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

References XStrm_RxFifoStreamer::FifoInstance, XStrm_RxFifoStreamer::FifoWidth, XStrm_RxFifoStreamer::FrmByteCnt, XStrm_RxFifoStreamer::GetLenFn, and XStrm_RxFifoStreamer::HeadIndex.

void XStrm_RxInitialize ( XStrm_RxFifoStreamer *  InstancePtr,
unsigned  FifoWidth,
void *  FifoInstance,
XStrm_XferFnType  ReadFn,
XStrm_GetLenFnType  GetLenFn,
XStrm_GetOccupancyFnType  GetOccupancyFn 
)

Initializes a receive byte-streamer instance.

XStrm_RxInitialize initializes the XStrm_RxFifoStreamer object referenced by InstancePtr.

Parameters
[out]InstancePtrReferences the receive streamer to initialize.
[in]FifoWidthSpecifies the FIFO keyhole size in bytes.
[in]FifoInstanceFIFO driver instance this streamer uses to transfer data into the actual FIFO.
[in]ReadFnReads data from the FIFO. The routine must handle only aligned buffers.
[in]GetLenFnStarts a receive on the actual FIFO.
[in]GetOccupancyFnReturns occupancy of the actual FIFO. The true occupancy comes through this streamer because it holds some of the bytes.

References XStrm_RxFifoStreamer::FifoInstance, FifoInstance, XStrm_RxFifoStreamer::FifoWidth, XStrm_RxFifoStreamer::GetLenFn, XStrm_RxFifoStreamer::GetOccupancyFn, XStrm_RxFifoStreamer::HeadIndex, and XStrm_RxFifoStreamer::ReadFn.

Referenced by XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

void XStrm_TxInitialize ( XStrm_TxFifoStreamer *  InstancePtr,
unsigned  FifoWidth,
void *  FifoInstance,
XStrm_XferFnType  WriteFn,
XStrm_SetLenFnType  SetLenFn,
XStrm_GetVacancyFnType  GetVacancyFn 
)

Initializes a transmit byte-streamer instance.

XStrm_TxInitialize initializes the XStrm_TxFifoStreamer object referenced by InstancePtr.

Parameters
[out]InstancePtrReferences the transmit streamer to initialize.
[in]FifoWidthSpecifies the FIFO keyhole size in bytes.
[in]FifoInstanceFIFO driver instance this streamer uses to transfer data into the actual FIFO.
[in]WriteFnWrites data into the FIFO. The routine must handle only aligned buffers.
[in]SetLenFnStarts a transmit on the actual FIFO.
[in]GetVacancyFnReturns vacancy of the actual FIFO. The true vacancy comes through this streamer because it holds some of the bytes.

References FifoInstance, XStrm_TxFifoStreamer::FifoInstance, XStrm_TxFifoStreamer::FifoWidth, XStrm_TxFifoStreamer::GetVacancyFn, XStrm_TxFifoStreamer::SetLenFn, XStrm_TxFifoStreamer::TailIndex, and XStrm_TxFifoStreamer::WriteFn.

Referenced by XLlFifo_CfgInitialize(), and XLlFifo_Initialize().

void XStrm_TxSetLen ( XStrm_TxFifoStreamer *  InstancePtr,
u32  Bytes 
)

Flushes the streamer and starts a transmit.

XStrm_TxSetLen flushes to the FIFO, specified by InstancePtr, any bytes remaining in internal buffers and begins a hardware transfer of data out of the transmit channel of the FIFO. Bytes specifies the number of bytes in the frame to transmit.

Parameters
[in,out]InstancePtrReferences the FIFO Streamer on which to operate.
[in]BytesSpecifies the frame length in bytes.

References XStrm_TxFifoStreamer::AlignedBuffer, XStrm_TxFifoStreamer::FifoInstance, XStrm_TxFifoStreamer::TailIndex, and XStrm_TxFifoStreamer::WriteFn.

void XStrm_Write ( XStrm_TxFifoStreamer *  InstancePtr,
void *  BufPtr,
unsigned  Bytes 
)

Writes bytes to the transmit streamer.

XStrm_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 XStrm_Write() matches the number of bytes given in the next call to XStrm_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.

References XStrm_TxFifoStreamer::AlignedBuffer, XStrm_TxFifoStreamer::FifoInstance, XStrm_TxFifoStreamer::FifoWidth, min, XStrm_TxFifoStreamer::TailIndex, and XStrm_TxFifoStreamer::WriteFn.