Class SegmentGenerator
Defined in File SegmentGenerator.h
Inheritance Relationships
Base Type
public ska::pst::common::SegmentProducer
(Class SegmentProducer)
Class Documentation
-
class SegmentGenerator : public ska::pst::common::SegmentProducer
Generates simulated signals as a series of Segments.
Public Functions
-
SegmentGenerator() = default
Construct a new SegmentGenerator object.
-
~SegmentGenerator()
Destroy the SegmentGenerator object.
-
virtual void configure(const AsciiHeader &data_config, const AsciiHeader &weights_config)
Configure the simulator with the AsciiHeader for the data and weights+scales blocks.
- Parameters
data_config – AsciiHeader containing the configuration of the data blocks
weights_config – AsciiHeader containing the configuration of the weights blocks
-
inline virtual const AsciiHeader &get_data_header() const
Get the AsciiHeader that describes the data blocks.
- Returns
const AsciiHeader& header of the data blocks
-
inline virtual const AsciiHeader &get_weights_header() const
Get the AsciiHeader that describes the weights blocks.
- Returns
const AsciiHeader& header of the weights blocks
-
void resize(uint64_t nheap)
Resize the internal storage for data and weights+scales.
- Parameters
nheap – the number of heaps to be generated on each call to next_segment
-
virtual Segment next_segment()
Get the next segment of simulated data and weights+scales.
-
bool test_segment(const Segment &segment)
Verify the data and weights+scales of the segment.
- Parameters
segment – the segment of simulated data and weights+scales to be verified
- Returns
true if data and weights+scales match expectations
-
void reset()
Reset all sequences (data, weights, and scales) The next call to next_segment or test_segment will behave as on the first call to these functions.
Protected Functions
-
void update_config(AsciiHeader &config)
Ensures that various useful header parameters are set.
Protected Attributes
-
AsciiHeader data_config
the AsciiHeader that describes the data blocks
-
AsciiHeader weights_config
the AsciiHeader that describes the weights blocks
-
std::shared_ptr<PacketGenerator> generator = {nullptr}
PacketGenerator sets the data and weights+scales of each packet in each heap.
-
Segment segment
storage for the simulated Segment returned by next_segmemtn
-
HeapLayout layout
The layout of data, weights and scales in each heap.
-
uint64_t nheap = {0}
The number of heaps generated on each call to next_block.
-
SegmentGenerator() = default