#include <traceval.h>
Public Member Functions | |
DumpVCD (std::ostream *os, const std::string &tscale="ns", const bool rstrobes=false, const bool wstrobes=false) | |
Create tracer with time scale tscale and output os. | |
DumpVCD (const std::string &name, const std::string &tscale="ns", const bool rstrobes=false, const bool wstrobes=false) | |
Create tracer with time scale tscale for output file name. | |
void | setActiveSignals (const TraceSet &act) |
void | start () |
Writes header stuff and the initial state. | |
void | stop () |
Writes a last time marker. | |
void | cycle () |
Writes next clock cycle and resets all RS and WS states. | |
void | markRead (const TraceValue *t) |
void | markWrite (const TraceValue *t) |
void | markChange (const TraceValue *t) |
bool | enabled (const TraceValue *t) const |
Returns true iff tracing a particular value is enabled. | |
~DumpVCD () | |
Private Member Functions | |
void | valout (const TraceValue *v) |
void | flushbuffer (void) |
writes content of osbuffer to os and empty osbuffer afterwards | |
Private Attributes | |
TraceSet | tv |
std::map< const TraceValue *, size_t > | id2num |
const std::string | tscale |
const bool | rs |
const bool | ws |
bool | changesWritten |
std::vector< int > | marked |
std::ostream * | os |
std::stringstream | osbuffer |
Produces value change dump files.
Definition at line 270 of file traceval.h.
DumpVCD::DumpVCD | ( | std::ostream * | os, | |
const std::string & | tscale = "ns" , |
|||
const bool | rstrobes = false , |
|||
const bool | wstrobes = false | |||
) |
Create tracer with time scale tscale and output os.
Definition at line 381 of file traceval.cpp.
DumpVCD::DumpVCD | ( | const std::string & | name, | |
const std::string & | tscale = "ns" , |
|||
const bool | rstrobes = false , |
|||
const bool | wstrobes = false | |||
) |
Create tracer with time scale tscale for output file name.
Definition at line 391 of file traceval.cpp.
DumpVCD::~DumpVCD | ( | ) |
Definition at line 521 of file traceval.cpp.
References os.
void DumpVCD::cycle | ( | ) | [virtual] |
Writes next clock cycle and resets all RS and WS states.
Reimplemented from Dumper.
Definition at line 466 of file traceval.cpp.
References changesWritten, flushbuffer(), SystemClock::GetCurrentTime(), SystemClock::Instance(), marked, and osbuffer.
bool DumpVCD::enabled | ( | const TraceValue * | t | ) | const [virtual] |
Returns true iff tracing a particular value is enabled.
FIXME: For a lot of values to trace, checking enabled() each time by doing find on a map() could be slow. Here is potential for more optimization!
Implements Dumper.
Definition at line 517 of file traceval.cpp.
References id2num.
void DumpVCD::flushbuffer | ( | void | ) | [private] |
writes content of osbuffer to os and empty osbuffer afterwards
Definition at line 373 of file traceval.cpp.
References changesWritten, os, and osbuffer.
Referenced by cycle(), start(), and stop().
void DumpVCD::markChange | ( | const TraceValue * | t | ) | [virtual] |
This will produce a change in the value CHANGE dump file :-)
Reimplemented from Dumper.
Definition at line 511 of file traceval.cpp.
References changesWritten, id2num, osbuffer, rs, valout(), and ws.
void DumpVCD::markRead | ( | const TraceValue * | t | ) | [virtual] |
Iff rstrobes is true, this will mark reads on a special R-strobe signal line.
Reimplemented from Dumper.
Definition at line 493 of file traceval.cpp.
References changesWritten, id2num, marked, osbuffer, rs, and ws.
void DumpVCD::markWrite | ( | const TraceValue * | t | ) | [virtual] |
Iff wstrobes is true, this will mark writes on a special W-strobe signal line .
Reimplemented from Dumper.
Definition at line 503 of file traceval.cpp.
References changesWritten, id2num, marked, osbuffer, rs, and ws.
void DumpVCD::setActiveSignals | ( | const TraceSet & | act | ) | [virtual] |
void DumpVCD::start | ( | ) | [virtual] |
Writes header stuff and the initial state.
Reimplemented from Dumper.
Definition at line 412 of file traceval.cpp.
References changesWritten, flushbuffer(), os, osbuffer, rs, tscale, tv, valout(), and ws.
void DumpVCD::stop | ( | ) | [virtual] |
Writes a last time marker.
Reimplemented from Dumper.
Definition at line 482 of file traceval.cpp.
References flushbuffer(), SystemClock::GetCurrentTime(), SystemClock::Instance(), and os.
void DumpVCD::valout | ( | const TraceValue * | v | ) | [private] |
Definition at line 361 of file traceval.cpp.
References TraceValue::bits(), osbuffer, TraceValue::value(), and TraceValue::written().
Referenced by markChange(), and start().
bool DumpVCD::changesWritten [private] |
Definition at line 311 of file traceval.h.
Referenced by cycle(), flushbuffer(), markChange(), markRead(), markWrite(), and start().
std::map<const TraceValue*, size_t> DumpVCD::id2num [private] |
Definition at line 308 of file traceval.h.
Referenced by enabled(), markChange(), markRead(), markWrite(), and setActiveSignals().
std::vector<int> DumpVCD::marked [private] |
Definition at line 314 of file traceval.h.
Referenced by cycle(), markRead(), and markWrite().
std::ostream* DumpVCD::os [private] |
Definition at line 315 of file traceval.h.
Referenced by flushbuffer(), start(), stop(), and ~DumpVCD().
std::stringstream DumpVCD::osbuffer [private] |
Definition at line 318 of file traceval.h.
Referenced by cycle(), flushbuffer(), markChange(), markRead(), markWrite(), start(), and valout().
const bool DumpVCD::rs [private] |
Definition at line 310 of file traceval.h.
Referenced by markChange(), markRead(), markWrite(), and start().
const std::string DumpVCD::tscale [private] |
Definition at line 309 of file traceval.h.
Referenced by start().
TraceSet DumpVCD::tv [private] |
Definition at line 307 of file traceval.h.
Referenced by setActiveSignals(), and start().
const bool DumpVCD::ws [private] |
Definition at line 310 of file traceval.h.
Referenced by markChange(), markRead(), markWrite(), and start().