CoreV1

CoreV1 parses Batcher v1 super-frames and exposes parsed record metadata through Data objects plus header/tail iterators. For conceptual guidance, see Batcher Protocol.

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

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

typedef std::shared_ptr<rogue::protocols::batcher::CoreV1> rogue::protocols::batcher::CoreV1Ptr
[header]

The class description is shown below:

class CoreV1
[header]

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:

  • A super-header region.

  • A list of per-record Data descriptors.

  • A list of tail iterators for each record.

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

  • SplitterV1 uses parsed Data records to emit one frame per batch entry.

  • InverterV1 uses parsed tail/header locations to rewrite framing in place.

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

Threading model:

  • No internal threads are created.

  • The object is intended for single-threaded use per instance.

Public Functions

CoreV1()
[header] [impl]

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.

~CoreV1()
[header] [impl]

Destroys the parser.

Deconstructor.

void initSize(uint32_t size)
[header] [impl]

Pre-reserves internal record/tail container capacity.

Init size for internal containers.

Parameters:

size – Expected maximum record count per frame.

uint32_t count()
[header] [impl]

Returns number of parsed records.

Record count.

Returns:

Parsed record count.

uint32_t headerSize()
[header] [impl]

Returns parsed super-header size.

Get header size.

Returns:

Header size in bytes.

rogue::interfaces::stream::FrameIterator beginHeader()
[header] [impl]

Returns iterator to beginning of parsed header.

Get beginning of header iterator.

Returns:

Header-begin iterator.

rogue::interfaces::stream::FrameIterator endHeader()
[header] [impl]

Returns iterator to end of parsed header.

Get end of header iterator.

Returns:

Header-end iterator.

uint32_t tailSize()
[header] [impl]

Returns parsed tail size per record.

Get tail size.

Returns:

Tail size in bytes.

rogue::interfaces::stream::FrameIterator beginTail(uint32_t index)
[header] [impl]

Returns iterator to beginning of a parsed record tail.

Get beginning of tail iterator.

Parameters:

index – Zero-based record index in stream order.

Returns:

Tail-begin iterator for requested record.

rogue::interfaces::stream::FrameIterator endTail(uint32_t index)
[header] [impl]

Returns iterator to end of a parsed record tail.

Get end of tail iterator.

Parameters:

index – Zero-based record index in stream order.

Returns:

Tail-end iterator for requested record.

std::shared_ptr<rogue::protocols::batcher::Data> &record(uint32_t index)
[header] [impl]

Returns parsed data record descriptor by index.

Get data.

Parameters:

index – Zero-based record index in stream order.

Returns:

Reference to parsed Data record pointer.

uint32_t sequence()
[header] [impl]

Returns parsed batch sequence number.

Return sequence.

Returns:

Sequence number from super-header.

bool processFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame)
[header] [impl]

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:

frame – Input batched frame.

Returns:

true if frame is valid and parsed; otherwise false.

void reset()
[header] [impl]

Clears parsed frame state and record lists.

Reset data.

Public Static Functions

static void setup_python()
[header] [impl]

Registers Python bindings for this class.

Setup class in python.

static std::shared_ptr<rogue::protocols::batcher::CoreV1> create()
[header] [impl]

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.

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.

Returns:

Shared pointer to the created parser.