CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::arc::runtime::impl::TraceBuffer Struct Reference

A heap allocated buffer containing raw trace data and time step markers. More...

#include <TraceEncoder.h>

Collaboration diagram for circt::arc::runtime::impl::TraceBuffer:

Public Member Functions

 TraceBuffer ()=delete
 TraceBuffer (uint32_t capacity)
 TraceBuffer (const TraceBuffer &other)=delete
TraceBuffer operator= (const TraceBuffer &other)=delete
 TraceBuffer (TraceBuffer &&other) noexcept=default
TraceBuffer & operator= (TraceBuffer &&other) noexcept=default
uint64_t * getData () const
 Get the pointer to the buffer's storage.
void clear ()
 Reset the buffer.
void assertSentinel () const
 Assert that the buffer's sentinel value has not been overwritten.

Public Attributes

uint32_t capacity
 Available storage in number of elements.
uint32_t size = 0
 Number of valid elements, set on dispatch.
int64_t firstStep = -1
 Time step of the buffer's first entry.
uint64_t firstSimTime = 0
 Simulation time in femtoseconds at the buffer's first entry.
std::vector< TraceBufferMarker > stepMarkers
 Time step markers.

Private Attributes

std::unique_ptr< uint64_t[]> storage

Static Private Attributes

static constexpr uint64_t sentinelValue = UINT64_C(0xABCD1234EFBA8765)

Detailed Description

A heap allocated buffer containing raw trace data and time step markers.

Definition at line 48 of file TraceEncoder.h.

Constructor & Destructor Documentation

◆ TraceBuffer() [1/4]

circt::arc::runtime::impl::TraceBuffer::TraceBuffer ( )
delete

◆ TraceBuffer() [2/4]

circt::arc::runtime::impl::TraceBuffer::TraceBuffer ( uint32_t capacity)
inlineexplicit

Definition at line 52 of file TraceEncoder.h.

References capacity, sentinelValue, and storage.

◆ TraceBuffer() [3/4]

circt::arc::runtime::impl::TraceBuffer::TraceBuffer ( const TraceBuffer & other)
delete

References TraceBuffer().

◆ TraceBuffer() [4/4]

circt::arc::runtime::impl::TraceBuffer::TraceBuffer ( TraceBuffer && other)
defaultnoexcept

References TraceBuffer().

Member Function Documentation

◆ assertSentinel()

void circt::arc::runtime::impl::TraceBuffer::assertSentinel ( ) const
inline

Assert that the buffer's sentinel value has not been overwritten.

Definition at line 88 of file TraceEncoder.h.

References capacity, circt::arc::runtime::impl::fatalError(), sentinelValue, and storage.

◆ clear()

void circt::arc::runtime::impl::TraceBuffer::clear ( )
inline

Reset the buffer.

Definition at line 80 of file TraceEncoder.h.

References firstSimTime, firstStep, size, and stepMarkers.

◆ getData()

uint64_t * circt::arc::runtime::impl::TraceBuffer::getData ( ) const
inline

Get the pointer to the buffer's storage.

Definition at line 77 of file TraceEncoder.h.

References storage.

Referenced by circt::arc::runtime::impl::FSTTraceEncoder::encode(), and circt::arc::runtime::impl::VCDTraceEncoder::encode().

◆ operator=() [1/2]

TraceBuffer circt::arc::runtime::impl::TraceBuffer::operator= ( const TraceBuffer & other)
delete

References TraceBuffer().

◆ operator=() [2/2]

TraceBuffer & circt::arc::runtime::impl::TraceBuffer::operator= ( TraceBuffer && other)
defaultnoexcept

References TraceBuffer().

Member Data Documentation

◆ capacity

uint32_t circt::arc::runtime::impl::TraceBuffer::capacity

Available storage in number of elements.

Note: Actual capacity is +1 for sentinel

Definition at line 66 of file TraceEncoder.h.

Referenced by assertSentinel(), and TraceBuffer().

◆ firstSimTime

uint64_t circt::arc::runtime::impl::TraceBuffer::firstSimTime = 0

Simulation time in femtoseconds at the buffer's first entry.

Definition at line 72 of file TraceEncoder.h.

Referenced by clear(), circt::arc::runtime::impl::FSTTraceEncoder::encode(), and circt::arc::runtime::impl::VCDTraceEncoder::encode().

◆ firstStep

int64_t circt::arc::runtime::impl::TraceBuffer::firstStep = -1

Time step of the buffer's first entry.

Definition at line 70 of file TraceEncoder.h.

Referenced by clear(), circt::arc::runtime::impl::FSTTraceEncoder::encode(), and circt::arc::runtime::impl::VCDTraceEncoder::encode().

◆ sentinelValue

uint64_t circt::arc::runtime::impl::TraceBuffer::sentinelValue = UINT64_C(0xABCD1234EFBA8765)
staticconstexprprivate

Definition at line 94 of file TraceEncoder.h.

Referenced by assertSentinel(), and TraceBuffer().

◆ size

uint32_t circt::arc::runtime::impl::TraceBuffer::size = 0

◆ stepMarkers

std::vector<TraceBufferMarker> circt::arc::runtime::impl::TraceBuffer::stepMarkers

◆ storage

std::unique_ptr<uint64_t[]> circt::arc::runtime::impl::TraceBuffer::storage
private

Definition at line 95 of file TraceEncoder.h.

Referenced by assertSentinel(), getData(), and TraceBuffer().


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