|
rogue
|
Parser for SLAC AXI Batcher v2 super-frames. More...
#include <CoreV2.h>
Public Member Functions | |
| CoreV2 () | |
Constructs a CoreV2 parser. | |
| ~CoreV2 () | |
| 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::CoreV2 > | create () |
Creates a CoreV2 parser instance. | |
Parser for SLAC AXI Batcher v2 super-frames.
Protocol reference: https://confluence.slac.stanford.edu/x/L2VlK
CoreV2 parses one incoming batched stream frame into:
Data descriptors.This class is the shared parser used by SplitterV2 and InverterV2.
SplitterV2 uses parsed Data records to emit one frame per batch entry.InverterV2 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:
| rogue::protocols::batcher::CoreV2::CoreV2 | ( | ) |
Constructs a CoreV2 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 65 of file CoreV2.cpp.
| rogue::protocols::batcher::CoreV2::~CoreV2 | ( | ) |
| rogue::interfaces::stream::FrameIterator rogue::protocols::batcher::CoreV2::beginHeader | ( | ) |
Returns iterator to beginning of parsed header.
Get beginning of header iterator.
Definition at line 93 of file CoreV2.cpp.
| rogue::interfaces::stream::FrameIterator rogue::protocols::batcher::CoreV2::beginTail | ( | uint32_t | index | ) |
Returns iterator to beginning of a parsed record tail.
Get beginning of tail iterator.
| index | Zero-based record index in stream order. |
Definition at line 108 of file CoreV2.cpp.
| uint32_t rogue::protocols::batcher::CoreV2::count | ( | ) |
Returns number of parsed records.
Record count.
Definition at line 83 of file CoreV2.cpp.
|
static |
Creates a CoreV2 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.
Description : AXI Batcher V2 (https://confluence.slac.stanford.edu/x/L2VlK)
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: 2 bytes
Byte 0: Bits 3:0 = Version = 2 Bits 7:4 = Reserved Byte 1: Bits 15:8 = Sequence # for debug
Frame Tail: 7 bytes
Word 0: 4 bytes bits 31:0 = size Word 1: 3 bytes bits 7:0 = Destination bits 15:8 = First user bits 23:16 = Last user
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
Definition at line 56 of file CoreV2.cpp.
| rogue::interfaces::stream::FrameIterator rogue::protocols::batcher::CoreV2::endHeader | ( | ) |
Returns iterator to end of parsed header.
Get end of header iterator.
Definition at line 98 of file CoreV2.cpp.
| rogue::interfaces::stream::FrameIterator rogue::protocols::batcher::CoreV2::endTail | ( | uint32_t | index | ) |
Returns iterator to end of a parsed record tail.
Get end of tail iterator.
| index | Zero-based record index in stream order. |
Definition at line 120 of file CoreV2.cpp.
| uint32_t rogue::protocols::batcher::CoreV2::headerSize | ( | ) |
Returns parsed super-header size.
Get header size.
Definition at line 88 of file CoreV2.cpp.
| void rogue::protocols::batcher::CoreV2::initSize | ( | uint32_t | size | ) |
Pre-reserves internal record/tail container capacity.
Init size for internal containers.
| size | Expected maximum record count per frame. |
Definition at line 77 of file CoreV2.cpp.
| bool rogue::protocols::batcher::CoreV2::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.
| frame | Input batched frame. |
true if frame is valid and parsed; otherwise false. Definition at line 149 of file CoreV2.cpp.
| rogue::protocols::batcher::DataPtr & rogue::protocols::batcher::CoreV2::record | ( | uint32_t | index | ) |
Returns parsed data record descriptor by index.
Get data.
| index | Zero-based record index in stream order. |
Data record pointer. Definition at line 132 of file CoreV2.cpp.
| void rogue::protocols::batcher::CoreV2::reset | ( | ) |
| uint32_t rogue::protocols::batcher::CoreV2::sequence | ( | ) |
Returns parsed batch sequence number.
Return sequence.
Definition at line 144 of file CoreV2.cpp.
|
static |
Registers Python bindings for this class.
Setup class in python.
Definition at line 62 of file CoreV2.cpp.
| uint32_t rogue::protocols::batcher::CoreV2::tailSize | ( | ) |
Returns parsed tail size per record.
Get tail size.
Definition at line 103 of file CoreV2.cpp.