SILICON
Loading...
Searching...
No Matches
DataWriter Class Referencefinal

Stateful writer for waveform value emission. More...

#include <fstWrapper.hpp>

Public Member Functions

 DataWriter (const DataWriter &)=delete
DataWriter & operator= (const DataWriter &)=delete
 DataWriter (DataWriter &&) noexcept=default
DataWriter & operator= (DataWriter &&) noexcept=default
 ~DataWriter ()=default
void emitTimeChange (const uint64_t time)
 Advances simulation time.
void emitValueChange (fstHandle handle, const std::string &val)
void emitVariableLengthValueChange (fstHandle handle, std::string_view val)
void emitValue32 (fstHandle handle, uint32_t bits, uint32_t val)
void emitValue64 (fstHandle handle, uint32_t bits, uint64_t val)
void emitValueVec32 (fstHandle handle, uint32_t bits, const uint32_t *val)
void emitValueVec64 (fstHandle handle, uint32_t bits, const uint64_t *val)
void flush ()

Private Member Functions

 DataWriter (std::unique_ptr< fstWriterContext, WriterDeleter > ctx)

Private Attributes

std::unique_ptr< fstWriterContext, WriterDeleter > context

Friends

class HierarchyBuilder

Detailed Description

Stateful writer for waveform value emission.

This class intentionally cannot exist until hierarchy construction is fully completed.

That sequencing guarantee is enforced at the type level through the HierarchyBuilder -> DataWriter transition.

Definition at line 406 of file fstWrapper.hpp.

Constructor & Destructor Documentation

◆ DataWriter() [1/3]

DataWriter ( const DataWriter & )
delete

◆ DataWriter() [2/3]

DataWriter ( DataWriter && )
defaultnoexcept

◆ ~DataWriter()

~DataWriter ( )
default

◆ DataWriter() [3/3]

DataWriter ( std::unique_ptr< fstWriterContext, WriterDeleter > ctx)
inlineexplicitprivate

Definition at line 493 of file fstWrapper.hpp.

Member Function Documentation

◆ emitTimeChange()

void emitTimeChange ( const uint64_t time)
inline

Advances simulation time.

Parameters
timeTimestamp for all subsequent events until the next time change event.

Definition at line 420 of file fstWrapper.hpp.

◆ emitValue32()

void emitValue32 ( fstHandle handle,
uint32_t bits,
uint32_t val )
inline

These APIs avoid ASCII conversion overhead for numeric vectors.

They are substantially more efficient than string-based emission for large traces.

Definition at line 455 of file fstWrapper.hpp.

◆ emitValue64()

void emitValue64 ( fstHandle handle,
uint32_t bits,
uint64_t val )
inline

Definition at line 461 of file fstWrapper.hpp.

◆ emitValueChange()

void emitValueChange ( fstHandle handle,
const std::string & val )
inline

Definition at line 428 of file fstWrapper.hpp.

◆ emitValueVec32()

void emitValueVec32 ( fstHandle handle,
uint32_t bits,
const uint32_t * val )
inline

Definition at line 467 of file fstWrapper.hpp.

◆ emitValueVec64()

void emitValueVec64 ( fstHandle handle,
uint32_t bits,
const uint64_t * val )
inline

Definition at line 473 of file fstWrapper.hpp.

◆ emitVariableLengthValueChange()

void emitVariableLengthValueChange ( fstHandle handle,
std::string_view val )
inline

Used for dynamically sized payloads.

std::string_view avoids unnecessary copying.

Definition at line 439 of file fstWrapper.hpp.

◆ flush()

void flush ( )
inline

Definition at line 479 of file fstWrapper.hpp.

◆ operator=() [1/2]

DataWriter & operator= ( const DataWriter & )
delete

◆ operator=() [2/2]

DataWriter & operator= ( DataWriter && )
defaultnoexcept

◆ HierarchyBuilder

friend class HierarchyBuilder
friend

Only HierarchyBuilder may construct a writer.

This enforces the intended typestate transition.

Definition at line 491 of file fstWrapper.hpp.

Member Data Documentation

◆ context

std::unique_ptr<fstWriterContext, WriterDeleter> context
private

Definition at line 498 of file fstWrapper.hpp.


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