simulavr
1.1.0
|
#include <traceval.h>
Public Member Functions | |
void | SetSingleDeviceApp (void) |
Tell DumpManager, that we have only one device. More... | |
void | addDumper (Dumper *dump, const TraceSet &vals) |
void | start () |
void | stopApplication (void) |
Stop processing on all dumpers and removes it from dumpers list. More... | |
void | cycle () |
~DumpManager () | |
Destroys the DumpManager instance and shut down all dumpers. More... | |
void | save (std::ostream &os) const |
TraceSet | load (std::istream &is) |
TraceSet | load (const std::string &istr) |
const TraceSet & | all () |
Static Public Member Functions | |
static DumpManager * | Instance (void) |
Singleton class access. More... | |
static void | Reset (void) |
Reset DumpManager instance (e.g. delete available instance) More... | |
Private Member Functions | |
DumpManager () | |
Private instance constructor. More... | |
void | appendDeviceName (std::string &s) |
append a unique device name to a string More... | |
void | registerAvrDevice (AvrDevice *dev) |
Add a device to devicelist. More... | |
void | unregisterAvrDevice (AvrDevice *dev) |
Remove a device from devicelist. More... | |
void | detachAvrDevices () |
detach all devices More... | |
TraceValue * | seekValueByName (const std::string &name) |
Seek value by name in all devices. More... | |
Private Attributes | |
bool | singleDeviceApp |
Flag, if we use only one device, e.g. assign no device name. More... | |
TraceSet | active |
Set of active tracing values. More... | |
TraceSet | _all |
Set of all traceable values (placeholder instance for all() method) More... | |
std::vector< Dumper * > | dumps |
All dumpers, which we want to use. More... | |
std::vector< AvrDevice * > | devices |
Device list. More... | |
Static Private Attributes | |
static int | _devidx = 0 |
static DumpManager * | _instance = NULL |
Friends | |
class | TraceValueRegister |
class | AvrDevice |
Manages all active Dumper instances for a given AvrDevice. It also manages all trace values and sets them active as necessary.
Definition at line 344 of file traceval.h.
|
inline |
Destroys the DumpManager instance and shut down all dumpers.
Definition at line 379 of file traceval.h.
|
private |
Private instance constructor.
Definition at line 582 of file traceval.cpp.
Add a dumper to the list. The vector vals contains all the values this dumper should trace.
Definition at line 641 of file traceval.cpp.
References avr_error, and Dumper::setActiveSignals().
const TraceSet & DumpManager::all | ( | ) |
Gives all available tracers as a set.
Definition at line 658 of file traceval.cpp.
References devices.
|
private |
append a unique device name to a string
Definition at line 586 of file traceval.cpp.
References avr_error, and int2str().
Referenced by TraceValueRegister::TraceValueRegister().
void DumpManager::cycle | ( | ) |
Process one AVR clock cycle. Must be done after the AVR did all processing so that changed values etc. can be collected.
Definition at line 686 of file traceval.cpp.
References DumpVCD::cycle(), and DumpVCD::enabled().
Referenced by AvrDevice::Step(), and HWTimerTinyX5::Step().
|
private |
detach all devices
Definition at line 608 of file traceval.cpp.
References AvrDevice::detachDumpManager(), and devices.
|
static |
Singleton class access.
Definition at line 567 of file traceval.cpp.
Referenced by avr_dump_start_tf(), avr_dump_stop_tf(), AvrDevice::AvrDevice(), RWExit::get(), RWAbort::get(), RWExit::set(), RWAbort::set(), HWTimerTinyX5::Step(), and TraceValueRegister::TraceValueRegister().
TraceSet DumpManager::load | ( | std::istream & | is | ) |
Load a list of tracing values from the given input stream. Checks whether the values are part of the set of traceable values.
Definition at line 739 of file traceval.cpp.
References avr_error, int2str(), readline(), and split().
TraceSet DumpManager::load | ( | const std::string & | istr | ) |
Load a list of tracing values from the given input string. Checks whether the values are part of the set of traceable values.
Definition at line 783 of file traceval.cpp.
|
private |
Add a device to devicelist.
Definition at line 594 of file traceval.cpp.
References devices.
Referenced by AvrDevice::AvrDevice().
|
static |
Reset DumpManager instance (e.g. delete available instance)
Definition at line 573 of file traceval.cpp.
void DumpManager::save | ( | std::ostream & | os | ) | const |
Write a list of all tracing value names into the given output stream.
Definition at line 709 of file traceval.cpp.
References TraceValue::barename(), devices, TraceValue::index(), and DumpVCD::tv.
|
private |
void DumpManager::SetSingleDeviceApp | ( | void | ) |
Tell DumpManager, that we have only one device.
In normal simulavr application we have only one device aka processor. But it's possible to make a simulation with 2 or more devices together. For that, we have to assign a unique name for every device to identify a device and to get a unique namespace in trace output.
This method has to be called before the device instance will be created in single device application! Default is multi device application.
Definition at line 635 of file traceval.cpp.
void DumpManager::start | ( | ) |
Start processing on all dumpers. They will be stopped when stopApplication method will be called or the dump manager gets destroyed.
Definition at line 680 of file traceval.cpp.
References DumpVCD::start().
Referenced by avr_dump_start_tf().
void DumpManager::stopApplication | ( | void | ) |
Stop processing on all dumpers and removes it from dumpers list.
Definition at line 701 of file traceval.cpp.
Referenced by avr_dump_stop_tf(), RWExit::get(), RWAbort::get(), RWExit::set(), and RWAbort::set().
|
private |
|
friend |
Definition at line 402 of file traceval.h.
|
friend |
Definition at line 401 of file traceval.h.
|
private |
Set of all traceable values (placeholder instance for all() method)
Definition at line 428 of file traceval.h.
|
staticprivate |
Definition at line 436 of file traceval.h.
Referenced by DumpVCD::~DumpVCD().
|
staticprivate |
Definition at line 437 of file traceval.h.
Referenced by DumpVCD::~DumpVCD().
|
private |
Set of active tracing values.
Definition at line 426 of file traceval.h.
|
private |
Device list.
Definition at line 434 of file traceval.h.
|
private |
All dumpers, which we want to use.
Definition at line 431 of file traceval.h.
|
private |
Flag, if we use only one device, e.g. assign no device name.
Definition at line 423 of file traceval.h.