AxiStreamDma

Examples of using the AxiStreamDma class are included in Using The AxiStreamDma Class.

AxiStreamDma objects in C++ are referenced by the following shared pointer typedef:

typedef std::shared_ptr<rogue::hardware::axi::AxiStreamDma> rogue::hardware::axi::AxiStreamDmaPtr

Alias for using shared pointer as AxiStreamDmaPtr.

The class description is shown below:

class AxiStreamDma : public rogue::interfaces::stream::Master, public rogue::interfaces::stream::Slave

AXI Stream DMA Class.

This class provides a bridge between the Rogue stream interface and one of the AES Stream Drivers device drivers. This bridge allows Rogue Frames to be sent and received to PCIE Express boards (using the data_dev driver) or Zynq ZXI4 FPGA fabrics (using the rce_stream driver). This interface will allocate Frame and Buffer objects using memory mapped DMA buffers or from a local memory pool when zero copy mode is disabled or a Frame with is requested with the zero copy flag set to false.

Public Functions

virtual void stop()

Stop the interface.

void setTimeout(uint32_t timeout)

Set timeout for frame transmits in microseconds.

This setting defines how long to wait for the lower level driver to be ready to send data. The current implementation will generate a warning message after each timeout but will continue to wait for the driver.

Exposed to python as SetTimeout()

Parameters:

timeout – Timeout value in microseconds

void setDriverDebug(uint32_t level)

Set driver debug level.

This function forwards the passed level value as a debug level to the lower level driver. Current drivers have a single level of 1, but any positive value will enable debug. Debug messages can be reviewed using the Linux command ‘dmesg’

Exposed to python as setDriverDebug()

Parameters:

level – Debug level, >= 1 enabled debug

void dmaAck()

Strobe ack line (hardware specific)

This method forwards an ack command to the lower level driver. This is used in some cases to generate a hardware strobe on the dma interface.

Exposed to python as dmaAck()

uint32_t getBuffSize()

Get the size of buffers (RX/TX)

uint32_t getRxBuffCount()

Get the number of RX buffers.

uint32_t getRxBuffinUserCount()

Get RX buffer in User count.

uint32_t getRxBuffinHwCount()

Get RX buffer in HW count.

uint32_t getRxBuffinPreHwQCount()

Get RX buffer in Pre-HW Queue count.

uint32_t getRxBuffinSwQCount()

Get RX buffer in SW Queue count.

uint32_t getRxBuffMissCount()

Get RX buffer missing count.

uint32_t getTxBuffCount()

Get the number of TX buffers.

uint32_t getTxBuffinUserCount()

Get TX buffer in User count.

uint32_t getTxBuffinHwCount()

Get TX buffer in HW count.

uint32_t getTxBuffinPreHwQCount()

Get TX buffer in Pre-HW Queue count.

uint32_t getTxBuffinSwQCount()

Get TX buffer in SW Queue count.

uint32_t getTxBuffMissCount()

Get TX buffer missing count.

Public Static Functions

static std::shared_ptr<rogue::hardware::axi::AxiStreamDma> create(std::string path, uint32_t dest, bool ssiEnable)

Class factory which returns a AxiStreamDmaPtr to a newly created AxiStreamDma object.

Exposed to Python as rogue.hardware.axi.AxiStreamDma()

The destination field is a sideband signal provided in the AxiStream protocol which allows a single interface to handle multiple frames with different purposes. The use of this field is driver specific, but the lower 8-bits are typically passed in the tDest field of the hardware frame and bits 8 and up are used to index the dma channel in the lower level hardware.

The SSI Enable flag determines if the hardware frame follows the SLAC Streaming interface standard. This standard defines a SOF flag in the first user field at bit 1 and and EOFE flag in the last user field bit 0.

Parameters:
  • path – Path to device. i.e /dev/datadev_0

  • dest – Destination index for dma transactions

  • ssiEnable – Enable SSI user fields

Returns:

AxiStreamDma pointer (AxiStreamDmaPtr)

static void zeroCopyDisable(std::string path)

Disable zero copy.

By default the AxiStreamDma class attempts to take advantage of the zero copy mode of the lower level driver if supported. In zero copy mode the Frame Buffer objects are mapped directly to the DMA buffers allocated by the kernel. This allows for direct user space access to the memory which the lower level DMA engines uses. When zero copy mode is disabled a memory buffer will be allocated using the Pool class and the DMA data will be coped to or from this buffer. This call must be made before the first AxiStreamDma device is created.

Exposed to python as zeroCopyDisable()

Parameters:

path – Path to device. i.e /dev/datadev_0