![]() |
llfifo
Vitis Drivers API Documentation
|
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... | |
| #define XLlFifo_IntClear | ( | InstancePtr, | |
| Mask | |||
| ) |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
| [in] | Mask | Contains 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. |
Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().
| #define XLlFifo_IntDisable | ( | InstancePtr, | |
| Mask | |||
| ) |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
| [in] | Mask | Contains 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. |
| #define XLlFifo_IntEnable | ( | InstancePtr, | |
| Mask | |||
| ) |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
| [in] | Mask | Contains 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. |
Referenced by XLlFifoInterruptExample().
| #define XLlFifo_IntPending | ( | InstancePtr | ) |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
XLLF_INT_*_MASK preprocessor symbols.| #define XLlFifo_IsRxDone | ( | InstancePtr | ) |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
Referenced by RxReceive().
| #define XLlFifo_IsRxEmpty | ( | InstancePtr | ) |
Reports whether the receive channel is empty.
XLlFifo_IsRxEmpty returns true if the receive channel of the FIFO, specified by InstancePtr, is empty.
| [in] | InstancePtr | References the FIFO on which to operate. |
| #define XLlFifo_IsTxDone | ( | InstancePtr | ) |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
| #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().
| [in,out] | InstancePtr | References the FIFO on which to operate. |
| [out] | BufPtr | Specifies the memory address to place the data read. |
| [in] | Bytes | Specifies the number of bytes to read. |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
| #define XLlFifo_Reset | ( | InstancePtr | ) |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
| #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.
| [in,out] | InstancePtr | References the FIFO on which to operate. |
| #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.
| [in] | InstancePtr | References the FIFO on which to operate. |
| #define XLlFifo_RxReset | ( | InstancePtr | ) |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
XLLF_INT_*_MASK preprocessor symbols.Referenced by XLlFifoInterruptExample(), and XLlFifoPollingExample().
| #define XLlFifo_TxReset | ( | InstancePtr | ) |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
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.
| [in,out] | InstancePtr | References the FIFO on which to operate. |
| [in] | Bytes | Specifies the frame length in 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.
| [in] | InstancePtr | References the FIFO on which to operate. |
| #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().
| [in,out] | InstancePtr | References the FIFO on which to operate. |
| [in] | BufPtr | Specifies the memory address of data to write. |
| [in] | Bytes | Specifies the number of bytes to write. |
C-style signature void XLlFifo_Write(XLlFifo *InstancePtr, void *BufPtr, unsigned Bytes)
| #define XLlFifo_WriteTdr | ( | InstancePtr, | |
| Tdest | |||
| ) |
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
| [in] | InstancePtr | References the FIFO on which to operate. |
| [in] | Tdest | Transmit Destination address to be written to TDR. |
| typedef struct XLlFifo_Config XLlFifo_Config |
Defines the XLlFifo hardware configuration.
| 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.
| [in] | BaseAddress | Contains the base address of the device. |
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.
| [out] | InstancePtr | Pointer to the AXI Streaming FIFO instance to be worked on. |
| [in] | Config | Hardware configuration for the core. |
| [in] | EffectiveAddress | Device 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. |
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.
| [out] | InstancePtr | References the memory instance to be associated with the FIFO device upon initialization. |
| [in] | BaseAddress | Processor 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.
| [in] | InstancePtr | References the FIFO on which to operate. |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
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().
| [in] | InstancePtr | References the FIFO on which to operate. |
| [in] | Bytes | Specifies 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.
| [in] | InstancePtr | References the FIFO on which to operate. |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
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.
| [in] | InstancePtr | References the FIFO on which to operate. |
| [in] | Word | Data 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().