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
noCopyistrue, the original frame object is queued (no payload copy, no trim).If
noCopyisfalse, a new frame is allocated and payload bytes are copied.In copy mode,
trimSizecan cap copied payload length.
Queue backpressure/drop behavior is controlled by
maxDepth:maxDepth > 0: once queue depth reachesmaxDepth, new incoming frames are dropped.maxDepth == 0: no busy/drop threshold is applied by this FIFO (queue can continue growing).
Trim behavior:
trimSize > 0andnoCopy == false: copied payload is limited tomin(payload, trimSize).trimSize == 0: copied payload is not trimmed.noCopy == true:trimSizeis 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.
0disables threshold-based drops.trimSize – Payload trim limit in copy mode.
0disables trimming.noCopy – Set to
trueto queue original frames; whentrue,trimSizeis ignored.
-
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.
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_ptrownership 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.
0disables threshold-based drops.trimSize – Payload trim limit in copy mode.
0disables trimming.noCopy – Set to
trueto queue original frames; whentrue,trimSizeis ignored.
- Returns:
Shared pointer to the created FIFO.