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

Parser for SLAC AXI Batcher v1 super-frames. More...

#include <CoreV1.h>

Public Member Functions

 CoreV1 ()
 Constructs a CoreV1 parser.
 
 ~CoreV1 ()
 Destroys the parser.
 
void initSize (uint32_t size)
 Pre-reserves internal record/tail container capacity.
 
uint32_t count ()
 Returns number of parsed records.
 
uint32_t headerSize ()
 Returns parsed super-header size.
 
rogue::interfaces::stream::FrameIterator beginHeader ()
 Returns iterator to beginning of parsed header.
 
rogue::interfaces::stream::FrameIterator endHeader ()
 Returns iterator to end of parsed header.
 
uint32_t tailSize ()
 Returns parsed tail size per record.
 
rogue::interfaces::stream::FrameIterator beginTail (uint32_t index)
 Returns iterator to beginning of a parsed record tail.
 
rogue::interfaces::stream::FrameIterator endTail (uint32_t index)
 Returns iterator to end of a parsed record tail.
 
std::shared_ptr< rogue::protocols::batcher::Data > & record (uint32_t index)
 Returns parsed data record descriptor by index.
 
uint32_t sequence ()
 Returns parsed batch sequence number.
 
bool processFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Parses a batched frame and populates parser state.
 
void reset ()
 Clears parsed frame state and record lists.
 

Static Public Member Functions

static void setup_python ()
 Registers Python bindings for this class.
 
static std::shared_ptr< rogue::protocols::batcher::CoreV1create ()
 Creates a CoreV1 parser instance.
 

Detailed Description

Parser for SLAC AXI Batcher v1 super-frames.

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

CoreV1 parses one incoming batched stream frame into:

This class is the shared parser used by SplitterV1 and InverterV1.

Record accessors (record(), beginTail(), endTail()) expose records in stream order, even though parsing walks tails from the end of the frame.

Threading model:

Definition at line 58 of file CoreV1.h.

Constructor & Destructor Documentation

◆ CoreV1()

rogue::protocols::batcher::CoreV1::CoreV1 ( )

Constructs a CoreV1 parser.

Creator with version constant.

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

Definition at line 68 of file CoreV1.cpp.

◆ ~CoreV1()

rogue::protocols::batcher::CoreV1::~CoreV1 ( )

Destroys the parser.

Deconstructor.

Definition at line 77 of file CoreV1.cpp.

Member Function Documentation

◆ beginHeader()

rogue::interfaces::stream::FrameIterator rogue::protocols::batcher::CoreV1::beginHeader ( )

Returns iterator to beginning of parsed header.

Get beginning of header iterator.

Returns
Header-begin iterator.

Definition at line 96 of file CoreV1.cpp.

◆ beginTail()

rogue::interfaces::stream::FrameIterator rogue::protocols::batcher::CoreV1::beginTail ( uint32_t  index)

Returns iterator to beginning of a parsed record tail.

Get beginning of tail iterator.

Parameters
indexZero-based record index in stream order.
Returns
Tail-begin iterator for requested record.

Definition at line 111 of file CoreV1.cpp.

◆ count()

uint32_t rogue::protocols::batcher::CoreV1::count ( )

Returns number of parsed records.

Record count.

Returns
Parsed record count.

Definition at line 86 of file CoreV1.cpp.

◆ create()

rogue::protocols::batcher::CoreV1Ptr rogue::protocols::batcher::CoreV1::create ( )
static

Creates a CoreV1 parser instance.

Class creation.

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.

Returns
Shared pointer to the created parser.

Company : SLAC National Accelerator Laboratory

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

The batcher protocol starts with a super header followed by a number of frames each with a tail to define the boundaries of each frame.

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 The reset of the width is padded with zeros

Frame Tail: Tail size is always equal to the interface width or 64-bis whichever is larger. Padded values are 0 (higher bytes).

Word 0: bits 31:0 = size Word 1: bits 7:0 = Destination bits 15:8 = First user bits 23:16 = Last user bits 31:24 = Valid bytes in last field


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 59 of file CoreV1.cpp.

◆ endHeader()

rogue::interfaces::stream::FrameIterator rogue::protocols::batcher::CoreV1::endHeader ( )

Returns iterator to end of parsed header.

Get end of header iterator.

Returns
Header-end iterator.

Definition at line 101 of file CoreV1.cpp.

◆ endTail()

rogue::interfaces::stream::FrameIterator rogue::protocols::batcher::CoreV1::endTail ( uint32_t  index)

Returns iterator to end of a parsed record tail.

Get end of tail iterator.

Parameters
indexZero-based record index in stream order.
Returns
Tail-end iterator for requested record.

Definition at line 123 of file CoreV1.cpp.

◆ headerSize()

uint32_t rogue::protocols::batcher::CoreV1::headerSize ( )

Returns parsed super-header size.

Get header size.

Returns
Header size in bytes.

Definition at line 91 of file CoreV1.cpp.

◆ initSize()

void rogue::protocols::batcher::CoreV1::initSize ( uint32_t  size)

Pre-reserves internal record/tail container capacity.

Init size for internal containers.

Parameters
sizeExpected maximum record count per frame.

Definition at line 80 of file CoreV1.cpp.

◆ processFrame()

bool rogue::protocols::batcher::CoreV1::processFrame ( std::shared_ptr< rogue::interfaces::stream::Frame frame)

Parses a batched frame and populates parser state.

Process a frame.

On success, header/tail metadata and record descriptors are available through the accessor methods. On failure, parser state is reset and false is returned.

Parameters
frameInput batched frame.
Returns
true if frame is valid and parsed; otherwise false.

Definition at line 152 of file CoreV1.cpp.

◆ record()

rogue::protocols::batcher::DataPtr & rogue::protocols::batcher::CoreV1::record ( uint32_t  index)

Returns parsed data record descriptor by index.

Get data.

Parameters
indexZero-based record index in stream order.
Returns
Reference to parsed Data record pointer.

Definition at line 135 of file CoreV1.cpp.

◆ reset()

void rogue::protocols::batcher::CoreV1::reset ( )

Clears parsed frame state and record lists.

Reset data.

Definition at line 299 of file CoreV1.cpp.

◆ sequence()

uint32_t rogue::protocols::batcher::CoreV1::sequence ( )

Returns parsed batch sequence number.

Return sequence.

Returns
Sequence number from super-header.

Definition at line 147 of file CoreV1.cpp.

◆ setup_python()

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

Registers Python bindings for this class.

Setup class in python.

Definition at line 65 of file CoreV1.cpp.

◆ tailSize()

uint32_t rogue::protocols::batcher::CoreV1::tailSize ( )

Returns parsed tail size per record.

Get tail size.

Returns
Tail size in bytes.

Definition at line 106 of file CoreV1.cpp.


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