Fifo

For conceptual usage, see:

Python binding

This C++ class is also exported into Python as rogue.interfaces.stream.Fifo.

Python API page: - Fifo

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

typedef std::shared_ptr<rogue::interfaces::stream::Fifo> rogue::interfaces::stream::FifoPtr
[header]

Shared pointer alias for Fifo.

The class description is shown below:

class Fifo : public rogue::interfaces::stream::Master, public rogue::interfaces::stream::Slave
[header]

Stream frame FIFO.

Buffers incoming frames and forwards them to downstream slaves from a worker thread. For each accepted frame:

  • If noCopy is true, the original frame object is queued (no payload copy, no trim).

  • If noCopy is false, a new frame is allocated and payload bytes are copied.

  • In copy mode, trimSize can cap copied payload length.

Queue backpressure/drop behavior is controlled by maxDepth:

  • maxDepth > 0: once queue depth reaches maxDepth, new incoming frames are dropped.

  • maxDepth == 0: no busy/drop threshold is applied by this FIFO (queue can continue growing).

Trim behavior:

  • trimSize > 0 and noCopy == false: copied payload is limited to min(payload, trimSize).

  • trimSize == 0: copied payload is not trimmed.

  • noCopy == true: trimSize is ignored.

Public Functions

Fifo(uint32_t maxDepth, uint32_t trimSize, bool noCopy)
[header] [impl]

Constructs a FIFO stream buffer.

Creator with version constant.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

Parameters:
  • maxDepth – Queue busy/drop threshold in frames. 0 disables threshold-based drops.

  • trimSize – Payload trim limit in copy mode. 0 disables trimming.

  • noCopy – Set to true to queue original frames; when true, trimSize is ignored.

~Fifo()
[header] [impl]

Destroys the FIFO and stops internal worker thread.

Deconstructor.

std::size_t size()
[header] [impl]

Returns current FIFO queue depth.

Return the number of elements in the Fifo.

std::size_t dropCnt() const
[header] [impl]

Returns the total dropped-frame counter.

Return the number of dropped frames.

void clearCnt()
[header] [impl]

Clears FIFO counters (including dropped-frame count).

Clear counters.

virtual void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame)
[header] [impl]

Receives a frame from upstream and enqueues or drops it.

Accept a frame from master.

Parameters:

frame – Incoming frame.

Public Static Functions

static std::shared_ptr<rogue::interfaces::stream::Fifo> create(uint32_t maxDepth, uint32_t trimSize, bool noCopy)
[header] [impl]

Creates a FIFO stream buffer.

Class creation.

Parameter semantics are identical to the constructor; see Fifo() for queue-depth and trim behavior details.

Exposed as rogue.interfaces.stream.Fifo() in Python.

This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.

Company : SLAC National Accelerator Laboratory

Description : AXI Stream FIFO

This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE.txt file.

Parameters:
  • maxDepth – Queue busy/drop threshold in frames. 0 disables threshold-based drops.

  • trimSize – Payload trim limit in copy mode. 0 disables trimming.

  • noCopy – Set to true to queue original frames; when true, trimSize is ignored.

Returns:

Shared pointer to the created FIFO.

static void setup_python()
[header] [impl]

Registers this type with Python bindings.

Setup class in python.