DumpVCD Class Reference

#include <traceval.h>

Inheritance diagram for DumpVCD:
Inheritance graph
[legend]
Collaboration diagram for DumpVCD:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Produces value change dump files.

Definition at line 270 of file traceval.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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]

Called with the set of all active signals, after they've been specified.

Reimplemented from Dumper.

Definition at line 401 of file traceval.cpp.

References avr_error, id2num, and tv.

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Sun Feb 12 16:50:52 2012 for Simulavr by  doxygen 1.6.3