28 for(
auto hash_val =
this ->
val_map.begin();
29 hash_val !=
this ->
val_map.end();
32 for(
auto vals = hash_val -> second -> begin();
33 vals != hash_val -> second -> end();
36 delete (*vals) -> value;
40 delete hash_val -> second;
52 this ->
scopes.push_back(s);
75 for (
auto &scope :
scopes) {
76 if (scope->name == name) {
91 this ->
val_map[hash] -> push_back(time_val);
98 return &
this ->
times;
121 this ->
times.push_back(time);
131 auto find =
val_map.find(hash);
132 if(find ==
this ->
val_map.end()) {
138 if(vals -> size() == 0) {
142 VCDSignalValues::iterator erase_until = vals->begin();
146 for(
auto it = vals -> begin();
150 if((*it) -> time <= time) {
160 for (
auto i = vals->begin() ; i != erase_until; i++) {
161 delete (*i) -> value;
163 vals->erase(vals->begin(), erase_until);
std::string VCDSignalHash
Compressed hash representation of a signal.
void add_signal(VCDSignal *s)
Add a new signal to the VCD file.
std::vector< VCDScope * > * get_scopes()
Get a vector of all scopes present in the file.
std::vector< VCDTime > times
Vector of time values present in the VCD file - sorted, asc.
std::map< VCDSignalHash, VCDSignalValues * > val_map
Map of hashes onto vectors of times and signal values.
std::vector< VCDScope * > scopes
Flat mao of all scope objects in the file, keyed by name.
std::vector< VCDSignal * > * get_signals()
Return a flattened vector of all signals in the file.
Represents a single value found in a VCD File.
A signal value tagged with times.
std::deque< VCDTimedValue * > VCDSignalValues
A vector of tagged time/value pairs, sorted by time values.
Represents a single signal reference within a VCD file.
VCDValue * get_signal_value_at(const VCDSignalHash &hash, VCDTime time, bool erase_prior=false)
Get the value of a particular signal at a specified time.
void add_scope(VCDScope *s)
Add a new scope object to the VCD file.
void add_timestamp(VCDTime time)
Add a new timestamp value to the VCD file.
std::vector< VCDSignal * > signals
Flat vector of all signals in the file.
Represents a scope type, scope name pair and all of it's child signals.
VCDFile()
Instance a new VCD file container.
std::vector< VCDTime > * get_timestamps()
Return a pointer to the set of timestamp samples present in the VCD file.
void add_signal_value(VCDTimedValue *time_val, VCDSignalHash hash)
Add a new signal value to the VCD file, tagged by time.
VCDScope * get_scope(VCDScopeName name)
Return the scope object in the VCD file with this name.
VCDSignalValues * get_signal_values(VCDSignalHash hash)
Get a vector of VCD time values.
double VCDTime
Represents a single instant in time in a trace.
std::string VCDScopeName
Friendly name for a scope.