VCDFile Class Reference

Top level object to represent a single VCD file. More...

#include <VCDFile.hpp>

Collaboration diagram for VCDFile:

Public Member Functions

 VCDFile ()
 Instance a new VCD file container. More...
 
 ~VCDFile ()
 Destructor. More...
 
void add_scope (VCDScope *s)
 Add a new scope object to the VCD file. More...
 
void add_signal (VCDSignal *s)
 Add a new signal to the VCD file. More...
 
void add_timestamp (VCDTime time)
 Add a new timestamp value to the VCD file. More...
 
VCDScopeget_scope (VCDScopeName name)
 Return the scope object in the VCD file with this name. More...
 
void add_signal_value (VCDTimedValue *time_val, VCDSignalHash hash)
 Add a new signal value to the VCD file, tagged by time. More...
 
VCDValueget_signal_value_at (const VCDSignalHash &hash, VCDTime time, bool erase_prior=false)
 Get the value of a particular signal at a specified time. More...
 
VCDSignalValuesget_signal_values (VCDSignalHash hash)
 Get a vector of VCD time values. More...
 
std::vector< VCDTime > * get_timestamps ()
 Return a pointer to the set of timestamp samples present in the VCD file. More...
 
std::vector< VCDScope * > * get_scopes ()
 Get a vector of all scopes present in the file. More...
 
std::vector< VCDSignal * > * get_signals ()
 Return a flattened vector of all signals in the file. More...
 

Data Fields

VCDTimeUnit time_units
 Timescale of the VCD file. More...
 
VCDTimeRes time_resolution
 Multiplier of the VCD file time units. More...
 
std::string date
 Date string of the VCD file. More...
 
std::string version
 Version string of the simulator which generated the VCD. More...
 
std::string comment
 Version string of the simulator which generated the VCD. More...
 
VCDScoperoot_scope
 Root scope node of the VCD signals. More...
 

Protected Attributes

std::vector< VCDSignal * > signals
 Flat vector of all signals in the file. More...
 
std::vector< VCDScope * > scopes
 Flat mao of all scope objects in the file, keyed by name. More...
 
std::vector< VCDTimetimes
 Vector of time values present in the VCD file - sorted, asc. More...
 
std::map< VCDSignalHash, VCDSignalValues * > val_map
 Map of hashes onto vectors of times and signal values. More...
 

Detailed Description

Top level object to represent a single VCD file.

Definition at line 16 of file VCDFile.hpp.

Constructor & Destructor Documentation

◆ VCDFile()

VCDFile::VCDFile ( )

Instance a new VCD file container.

Definition at line 8 of file VCDFile.cpp.

◆ ~VCDFile()

VCDFile::~VCDFile ( )

Destructor.

Definition at line 13 of file VCDFile.cpp.

Member Function Documentation

◆ add_scope()

void VCDFile::add_scope ( VCDScope s)

Add a new scope object to the VCD file.

Parameters
sin - The VCDScope object to add to the VCD file.

Definition at line 49 of file VCDFile.cpp.

◆ add_signal()

void VCDFile::add_signal ( VCDSignal s)

Add a new signal to the VCD file.

Add a new signal object to the VCD file.

Parameters
sin - The VCDSignal object to add to the VCD file.

Definition at line 59 of file VCDFile.cpp.

◆ add_signal_value()

void VCDFile::add_signal_value ( VCDTimedValue time_val,
VCDSignalHash  hash 
)

Add a new signal value to the VCD file, tagged by time.

Parameters
time_valin - A signal value, tagged by the time it occurs.
hashin - The VCD hash value representing the signal.

Definition at line 87 of file VCDFile.cpp.

◆ add_timestamp()

void VCDFile::add_timestamp ( VCDTime  time)

Add a new timestamp value to the VCD file.

Add a time stamp to the sorted array of existing timestamps in the file.

Parameters
timein - The timestamp value to add to the file.

Definition at line 118 of file VCDFile.cpp.

◆ get_scope()

VCDScope * VCDFile::get_scope ( VCDScopeName  name)

Return the scope object in the VCD file with this name.

Parameters
namein - The name of the scope to get and return.

Definition at line 74 of file VCDFile.cpp.

◆ get_scopes()

std::vector< VCDScope * > * VCDFile::get_scopes ( )

Get a vector of all scopes present in the file.

Definition at line 104 of file VCDFile.cpp.

Here is the caller graph for this function:

◆ get_signal_value_at()

VCDValue * VCDFile::get_signal_value_at ( const VCDSignalHash hash,
VCDTime  time,
bool  erase_prior = false 
)

Get the value of a particular signal at a specified time.

Note
The supplied time value does not need to exist in the vector returned by get_timestamps().
Parameters
hashin - The hashcode for the signal to identify it.
timein - The time at which we want the value of the signal.
erase_priorin - Erase signals prior to this time. Avoids O(n^2) searching times when scanning large .vcd files sequentially.
Returns
A pointer to the value at the supplie time, or nullptr if no such record can be found.

Definition at line 126 of file VCDFile.cpp.

◆ get_signal_values()

VCDSignalValues * VCDFile::get_signal_values ( VCDSignalHash  hash)

Get a vector of VCD time values.

Parameters
hashin - The hashcode for the signal to identify it.
Returns
A pointer to the vector of time values, or nullptr if hash not found

Definition at line 169 of file VCDFile.cpp.

◆ get_signals()

std::vector< VCDSignal * > * VCDFile::get_signals ( )

Return a flattened vector of all signals in the file.

Definition at line 111 of file VCDFile.cpp.

Here is the caller graph for this function:

◆ get_timestamps()

std::vector< VCDTime > * VCDFile::get_timestamps ( )

Return a pointer to the set of timestamp samples present in the VCD file.

Definition at line 97 of file VCDFile.cpp.

Here is the caller graph for this function:

Field Documentation

◆ comment

std::string VCDFile::comment

Version string of the simulator which generated the VCD.

Definition at line 39 of file VCDFile.hpp.

◆ date

std::string VCDFile::date

Date string of the VCD file.

Definition at line 33 of file VCDFile.hpp.

◆ root_scope

VCDScope* VCDFile::root_scope

Root scope node of the VCD signals.

Definition at line 42 of file VCDFile.hpp.

◆ scopes

std::vector<VCDScope*> VCDFile::scopes
protected

Flat mao of all scope objects in the file, keyed by name.

Definition at line 139 of file VCDFile.hpp.

◆ signals

std::vector<VCDSignal*> VCDFile::signals
protected

Flat vector of all signals in the file.

Definition at line 136 of file VCDFile.hpp.

◆ time_resolution

VCDTimeRes VCDFile::time_resolution

Multiplier of the VCD file time units.

Definition at line 30 of file VCDFile.hpp.

◆ time_units

VCDTimeUnit VCDFile::time_units

Timescale of the VCD file.

Definition at line 27 of file VCDFile.hpp.

◆ times

std::vector<VCDTime> VCDFile::times
protected

Vector of time values present in the VCD file - sorted, asc.

Definition at line 142 of file VCDFile.hpp.

◆ val_map

std::map<VCDSignalHash, VCDSignalValues*> VCDFile::val_map
protected

Map of hashes onto vectors of times and signal values.

Definition at line 145 of file VCDFile.hpp.

◆ version

std::string VCDFile::version

Version string of the simulator which generated the VCD.

Definition at line 36 of file VCDFile.hpp.


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