rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
rogue::protocols::batcher::CombinerV1 Class Reference

Combines individual frames into a batcher v1 super-frame. More...

#include <CombinerV1.h>

Inheritance diagram for rogue::protocols::batcher::CombinerV1:
rogue::interfaces::stream::Master rogue::interfaces::stream::Slave rogue::EnableSharedFromThis< rogue::interfaces::stream::Master > rogue::interfaces::stream::Pool rogue::EnableSharedFromThis< rogue::interfaces::stream::Slave > rogue::EnableSharedFromThisBase rogue::EnableSharedFromThis< rogue::interfaces::stream::Pool > rogue::EnableSharedFromThisBase rogue::EnableSharedFromThisBase

Public Member Functions

 CombinerV1 (uint8_t width)
 Constructs a CombinerV1 instance.
 
 ~CombinerV1 ()
 Destroys the combiner.
 
void acceptFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Accepts a frame and immediately queues it for batching.
 
void sendBatch ()
 Builds and sends a batcher v1 super-frame from all queued frames.
 
uint32_t getCount ()
 Returns the number of frames currently queued.
 
- Public Member Functions inherited from rogue::interfaces::stream::Master
 Master ()
 Constructs a stream master.
 
virtual ~Master ()
 Destroys the stream master.
 
uint32_t slaveCount ()
 Returns the number of attached slaves.
 
void addSlave (std::shared_ptr< rogue::interfaces::stream::Slave > slave)
 Attaches a downstream slave.
 
std::shared_ptr< rogue::interfaces::stream::FramereqFrame (uint32_t size, bool zeroCopyEn)
 Requests allocation of a new frame from the primary slave.
 
void sendFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Sends a frame to all attached slaves.
 
bool ensureSingleBuffer (std::shared_ptr< rogue::interfaces::stream::Frame > &frame, bool reqEn)
 Ensures a frame is represented by a single buffer.
 
virtual void stop ()
 Stops frame generation and shuts down associated threads.
 
void equalsPy (boost::python::object p)
 Supports == operator usage from Python.
 
boost::python::object rshiftPy (boost::python::object p)
 Supports >> operator usage from Python.
 
void operator== (std::shared_ptr< rogue::interfaces::stream::Slave > &other)
 Supports == operator usage in C++.
 
std::shared_ptr< rogue::interfaces::stream::Slave > & operator>> (std::shared_ptr< rogue::interfaces::stream::Slave > &other)
 Connects this master to a slave via stream chaining operator.
 
- Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Master >
std::shared_ptr< rogue::interfaces::stream::Mastershared_from_this ()
 Returns a shared_ptr<T> for this instance.
 
- Public Member Functions inherited from rogue::EnableSharedFromThisBase
virtual ~EnableSharedFromThisBase ()
 Virtual destructor for polymorphic base usage.
 
- Public Member Functions inherited from rogue::interfaces::stream::Slave
 Slave ()
 Constructs a stream slave.
 
virtual ~Slave ()
 Destroys the stream slave.
 
virtual void stop ()
 Shuts down threads associated with this object.
 
void setDebug (uint32_t debug, std::string name)
 Sets debug message verbosity and logger name.
 
uint64_t getFrameCount ()
 Returns frame counter.
 
uint64_t getByteCount ()
 Returns byte counter.
 
bool ensureSingleBuffer (std::shared_ptr< rogue::interfaces::stream::Frame > &frame, bool reqEn)
 Ensures frame is backed by a single buffer.
 
std::shared_ptr< rogue::interfaces::stream::FramereqLocalFrame (uint32_t size, bool zeroCopyEn)
 Services a local frame allocation request through this object's pool interface.
 
boost::python::object lshiftPy (boost::python::object p)
 Supports << operator usage from Python.
 
std::shared_ptr< rogue::interfaces::stream::Master > & operator<< (std::shared_ptr< rogue::interfaces::stream::Master > &other)
 Connects this slave to a master via stream chaining operator.
 
- Public Member Functions inherited from rogue::interfaces::stream::Pool
 Pool ()
 Constructs a pool with default allocation behavior enabled.
 
virtual ~Pool ()
 Destroys the pool and releases any cached buffer storage.
 
uint32_t getAllocBytes ()
 Returns total currently allocated bytes.
 
uint32_t getAllocCount ()
 Returns total currently allocated buffer count.
 
virtual std::shared_ptr< rogue::interfaces::stream::FrameacceptReq (uint32_t size, bool zeroCopyEn)
 Services a frame allocation request from a master.
 
virtual void retBuffer (uint8_t *data, uint32_t meta, uint32_t size)
 Returns buffer data to the allocator.
 
void setFixedSize (uint32_t size)
 Sets fixed-size mode.
 
uint32_t getFixedSize ()
 Returns fixed-size allocation setting.
 
void setPoolSize (uint32_t size)
 Sets buffer pool size.
 
uint32_t getPoolSize ()
 Returns configured maximum number of cached pool entries.
 
- Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Pool >
std::shared_ptr< rogue::interfaces::stream::Poolshared_from_this ()
 Returns a shared_ptr<T> for this instance.
 
- Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Slave >
std::shared_ptr< rogue::interfaces::stream::Slaveshared_from_this ()
 Returns a shared_ptr<T> for this instance.
 

Static Public Member Functions

static void setup_python ()
 Registers Python bindings for this class.
 
static std::shared_ptr< rogue::protocols::batcher::CombinerV1create (uint8_t width)
 Creates a CombinerV1 instance.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::Master
static std::shared_ptr< rogue::interfaces::stream::Mastercreate ()
 Creates a stream master.
 
static void setup_python ()
 Registers this type with Python bindings.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::Slave
static std::shared_ptr< rogue::interfaces::stream::Slavecreate ()
 Creates a new stream slave.
 
static void setup_python ()
 Registers this type with Python bindings.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::Pool
static void setup_python ()
 Registers this type with Python bindings.
 

Additional Inherited Members

- Protected Member Functions inherited from rogue::interfaces::stream::Pool
std::shared_ptr< rogue::interfaces::stream::BufferallocBuffer (uint32_t size, uint32_t *total)
 Allocate a buffer passed size.
 
std::shared_ptr< rogue::interfaces::stream::BuffercreateBuffer (void *data, uint32_t meta, uint32_t size, uint32_t alloc)
 Creates a Buffer with a pre-allocated data block.
 
void decCounter (uint32_t alloc)
 Decrements allocation counter.
 

Detailed Description

Combines individual frames into a batcher v1 super-frame.

Protocol reference: https://confluence.slac.stanford.edu/x/th1SDg

CombinerV1 is the software inverse of SplitterV1. It collects individual Rogue stream frames and packs them into a single batcher v1 super-frame with the appropriate super-header and per-record tails.

The width parameter controls the AXI stream width encoding:

Threading model:

Definition at line 58 of file CombinerV1.h.

Constructor & Destructor Documentation

◆ CombinerV1()

rogue::protocols::batcher::CombinerV1::CombinerV1 ( uint8_t  width)
explicit

Constructs a CombinerV1 instance.

Creator.

Parameters
widthAXI stream width encoding (0-5).

Definition at line 87 of file CombinerV1.cpp.

◆ ~CombinerV1()

rogue::protocols::batcher::CombinerV1::~CombinerV1 ( )

Destroys the combiner.

Deconstructor.

Definition at line 104 of file CombinerV1.cpp.

Member Function Documentation

◆ acceptFrame()

void rogue::protocols::batcher::CombinerV1::acceptFrame ( std::shared_ptr< rogue::interfaces::stream::Frame frame)
virtual

Accepts a frame and immediately queues it for batching.

Accept a frame from master.

Parameters
frameInput frame to be included in the next batch.

Reimplemented from rogue::interfaces::stream::Slave.

Definition at line 107 of file CombinerV1.cpp.

◆ create()

rogue::protocols::batcher::CombinerV1Ptr rogue::protocols::batcher::CombinerV1::create ( uint8_t  width)
static

Creates a CombinerV1 instance.

Class creation.

Parameters
widthAXI stream width encoding (0-5).
Returns
Shared pointer to the created combiner.

Company : SLAC National Accelerator Laboratory

Description : AXI Batcher V1 Combiner (SW Batcher) (https://confluence.slac.stanford.edu/x/th1SDg)

Builds a batcher v1 super-frame from individual frames. This is the software inverse of the SplitterV1 unbatcher.

Super-frame layout (same as FW batcher):

[Super Header][Record0 Data][Record0 Tail][Record1 Data][Record1 Tail]...

Super Header: Byte 0: Bits 3:0 = Version = 1 Bits 7:4 = Width = 2 * 2 ^ val Bytes Byte 1: Bits 15:8 = Sequence # for debug Rest of width padded with zeros

Frame Tail: Tail size is max(width, 8 bytes). Padded with zeros. Word 0: bits 31:0 = size (payload bytes) Word 1: bits 7:0 = Destination bits 15:8 = First user bits 23:16 = Last user bits 31:24 = Width (bits 3:0 = width encoding, bits 7:4 = 0)


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.

Definition at line 70 of file CombinerV1.cpp.

◆ getCount()

uint32_t rogue::protocols::batcher::CombinerV1::getCount ( )

Returns the number of frames currently queued.

Return queue count.

Returns
Queue depth.

Definition at line 116 of file CombinerV1.cpp.

◆ sendBatch()

void rogue::protocols::batcher::CombinerV1::sendBatch ( )

Builds and sends a batcher v1 super-frame from all queued frames.

Build and send the batched super-frame.

If no frames are queued, this is a no-op. After sending, the queue is cleared and the sequence counter is incremented.

Definition at line 122 of file CombinerV1.cpp.

◆ setup_python()

void rogue::protocols::batcher::CombinerV1::setup_python ( )
static

Registers Python bindings for this class.

Setup class in python.

Definition at line 76 of file CombinerV1.cpp.


The documentation for this class was generated from the following files: