CIRCT
19.0.0git
|
#include <Trace.h>
Public Member Functions | |
Trace (std::unique_ptr< State > const &state, llvm::raw_ostream &out, TraceMode mode) | |
void | addChange (unsigned) |
Add a value change to the trace changes buffer. More... | |
void | flush (bool force=false) |
Flush the changes buffer to the output stream. More... | |
Private Member Functions | |
void | pushChange (unsigned inst, unsigned sigIndex, int elem) |
Push one change to the changes vector. More... | |
void | pushAllChanges (unsigned inst, unsigned sigIndex) |
Push one change for each element of a signal if it is of a structured type, or the full signal otherwise. More... | |
void | addChangeMerged (unsigned) |
Add a merged change to the change buffer. More... | |
void | sortChanges () |
Sorts the changes buffer lexicographically wrt. the hierarchical paths. More... | |
void | flushFull () |
Flush the changes buffer to the output stream with full format. More... | |
void | flushMerged () |
Private Attributes | |
llvm::raw_ostream & | out |
std::unique_ptr< State > const & | state |
TraceMode | mode |
Time | currentTime |
std::vector< bool > | isTraced |
std::vector< std::pair< std::string, std::string > > | changes |
std::map< std::pair< unsigned, int >, std::string > | mergedChanges |
std::map< std::pair< std::string, int >, std::string > | lastValue |
Definition at line 20 of file Trace.cpp.
References circt::llhd::sim::Full, isTraced, circt::llhd::sim::Merged, mode, circt::llhd::sim::NamedOnly, and state.
void Trace::addChange | ( | unsigned | sigIndex | ) |
Add a value change to the trace changes buffer.
Definition at line 75 of file Trace.cpp.
References addChangeMerged(), currentTime, circt::llhd::sim::Full, isTraced, circt::llhd::sim::Merged, circt::llhd::sim::MergedReduce, mode, circt::llhd::sim::NamedOnly, pushAllChanges(), circt::llhd::sim::Reduced, and state.
Referenced by circt::llhd::sim::Engine::simulate().
|
private |
Add a merged change to the change buffer.
Definition at line 94 of file Trace.cpp.
References mergedChanges, and state.
Referenced by addChange().
void Trace::flush | ( | bool | force = false | ) |
Flush the changes buffer to the output stream.
The flush can be forced for merged changes, flushing even if the next real-time step has not been reached.
Definition at line 121 of file Trace.cpp.
References currentTime, flushFull(), flushMerged(), circt::llhd::sim::Full, circt::llhd::sim::Time::getTime(), circt::llhd::sim::Merged, circt::llhd::sim::MergedReduce, mode, circt::llhd::sim::NamedOnly, circt::llhd::sim::Reduced, and state.
Referenced by circt::llhd::sim::Engine::simulate().
|
private |
Flush the changes buffer to the output stream with full format.
Definition at line 130 of file Trace.cpp.
References changes, currentTime, out, sortChanges(), and circt::llhd::sim::Time::toString().
Referenced by flush().
|
private |
Definition at line 142 of file Trace.cpp.
References changes, currentTime, circt::llhd::sim::Time::getTime(), circt::llhd::sim::Merged, mergedChanges, mode, out, pushChange(), sortChanges(), and state.
Referenced by flush().
|
private |
Push one change for each element of a signal if it is of a structured type, or the full signal otherwise.
Definition at line 62 of file Trace.cpp.
References pushChange(), and state.
Referenced by addChange().
|
private |
Push one change to the changes vector.
Definition at line 36 of file Trace.cpp.
References changes, lastValue, and state.
Referenced by flushMerged(), and pushAllChanges().
|
private |
Sorts the changes buffer lexicographically wrt. the hierarchical paths.
Definition at line 113 of file Trace.cpp.
References changes.
Referenced by flushFull(), and flushMerged().
|
private |
Definition at line 40 of file Trace.h.
Referenced by flushFull(), flushMerged(), pushChange(), and sortChanges().
|
private |
Definition at line 36 of file Trace.h.
Referenced by addChange(), flush(), flushFull(), and flushMerged().
|
private |
Definition at line 38 of file Trace.h.
Referenced by addChange(), and Trace().
|
private |
Definition at line 44 of file Trace.h.
Referenced by pushChange().
|
private |
Definition at line 42 of file Trace.h.
Referenced by addChangeMerged(), and flushMerged().
|
private |
Definition at line 35 of file Trace.h.
Referenced by addChange(), flush(), flushMerged(), and Trace().
|
private |
Definition at line 33 of file Trace.h.
Referenced by flushFull(), and flushMerged().
|
private |
Definition at line 34 of file Trace.h.
Referenced by addChange(), addChangeMerged(), flush(), flushMerged(), pushAllChanges(), pushChange(), and Trace().