ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
|
Register error injection class. More...
#include <Plugin.h>
Classes | |
class | Error |
Public Member Functions | |
BlockAccurateHandler () | |
~BlockAccurateHandler () | |
void | add (etiss::uint64 time_ps, unsigned errorid, std::string register_, etiss::uintMax xor_, etiss::uintMax and_=(etiss::uintMax)(etiss::intMax) -1, etiss::uintMax or_=0) |
schedule an error More... | |
virtual etiss::int32 | execute () |
call to apply errors More... | |
void | parseFile (std::string filename, std::string reg) |
reads a file and adds the errors. More... | |
virtual std::string | _getPluginName () const |
virtual void | init (ETISS_CPU *cpu, ETISS_System *system, CPUArch *arch) |
this function is called before the plugin is used in the cpu execution loop (etiss::CPUCore::execute). More... | |
virtual void | cleanup () |
this function is called after cpu execution loop (etiss::CPUCore::execute) finished. More... | |
Public Member Functions inherited from etiss::CoroutinePlugin | |
CoroutinePlugin () | |
virtual | ~CoroutinePlugin () |
virtual void | executionEnd (int32_t code) |
called when the simulation ends but before any deinitialization is done More... | |
virtual bool | isActive () |
indicates if the plugin will do something in execution loop. More... | |
Public Member Functions inherited from etiss::Plugin | |
virtual | ~Plugin () |
unsigned | getType () |
InterruptListenerPlugin * | getInterruptListenerPlugin () |
CoroutinePlugin * | getCoroutinePlugin () |
SystemWrapperPlugin * | getSystemWrapperPlugin () |
RegisterDevicePlugin * | getRegisterDevicePlugin () |
TranslationPlugin * | getTranslationPlugin () |
std::string | getPluginName () const |
const std::string & | getLastAssignedCoreName () |
std::string | toString () const |
Public Member Functions inherited from etiss::ToString | |
ToString () | |
virtual | ~ToString () |
Private Attributes | |
ETISS_CPU * | cpu |
ETISS_System * | system |
CPUArch * | arch |
std::list< Error > | errors_ |
etiss::uint64 | last_time_ps |
etiss::uint64 | next_time_ps |
Additional Inherited Members | |
Static Public Attributes inherited from etiss::Plugin | |
static const unsigned | INTERRUPTLISTENER = 1 << 0 |
access to translated code More... | |
static const unsigned | COROUTINE = 1 << 1 |
callback after execution of each translated block More... | |
static const unsigned | SYSTEMWRAPPER = 1 << 2 |
can wrap/change ETISS_System structure at execution start More... | |
static const unsigned | REGISTERDEVICE |
gets noticed of changes to special registers (e.g. mmu register etc. [depends on architecture]) More... | |
static const unsigned | TRANSLATION |
access to translated code during translation phase or when instruction tree is built More... | |
Protected Member Functions inherited from etiss::Plugin | |
Plugin (unsigned type=0) | |
void | setCorrespondingCPUCoreName (std::string name) |
virtual void | addedToCPUCore (etiss::CPUCore *core) |
called as soon a plugin has been added to its CPUCore. More... | |
virtual void | removedFromCPUCore (etiss::CPUCore *core) |
called as soon a plugin has been removed from its CPUCore. More... | |
Protected Attributes inherited from etiss::Plugin | |
ETISS_CPU * | plugin_cpu_ |
holds a pointer to the cpu structure. will be set before init call and after cleanup call More... | |
ETISS_System * | plugin_system_ |
holds a pointer to the system structure. More... | |
CPUArch * | plugin_arch_ |
holds a pointer to the CPUArch instance. will be set before init call and after cleanup call More... | |
CPUCore * | plugin_core_ |
holds a pointer to the associated CPUCore instance. More... | |
Register error injection class.
errors may be injected after blocks.
if needed BlockAccurateHandler::execute may be called from within the cpu thread at any time to apply errors
BlockAccurateHandler::BlockAccurateHandler | ( | ) |
Definition at line 65 of file Plugin.cpp.
References last_time_ps, and next_time_ps.
BlockAccurateHandler::~BlockAccurateHandler | ( | ) |
Definition at line 70 of file Plugin.cpp.
|
virtual |
Implements etiss::Plugin.
Definition at line 238 of file Plugin.cpp.
void BlockAccurateHandler::add | ( | etiss::uint64 | time_ps, |
unsigned | errorid, | ||
std::string | register_, | ||
etiss::uintMax | xor_, | ||
etiss::uintMax | and_ = (etiss::uintMax)(etiss::intMax)-1 , |
||
etiss::uintMax | or_ = 0 |
||
) |
schedule an error
time_ps | time of activation in picoseconds |
errorid | some usedefined id |
register | a register name that is defined by the used etiss::CPUArch |
Definition at line 77 of file Plugin.cpp.
References errors_, etiss_BlockAccurateHandler_cmp(), and next_time_ps.
|
virtual |
this function is called after cpu execution loop (etiss::CPUCore::execute) finished.
Only the SystemWrapperPlugin::unwrap function is called AFTER Plugin::cleanup
Reimplemented from etiss::Plugin.
Definition at line 249 of file Plugin.cpp.
|
virtual |
call to apply errors
Implements etiss::CoroutinePlugin.
Definition at line 92 of file Plugin.cpp.
References cpu, ETISS_CPU::cpuTime_ps, etiss::ERROR, errors_, etiss::CPUCore::getStruct(), etiss::INFO, last_time_ps, etiss::log(), next_time_ps, etiss::mm::NOERROR, and etiss::Plugin::plugin_core_.
|
virtual |
this function is called before the plugin is used in the cpu execution loop (etiss::CPUCore::execute).
Only exception is the SystemWrapperPlugin whose SystemWrapperPlugin::wrap function is called BEFORE Plugin::init
Reimplemented from etiss::Plugin.
Definition at line 243 of file Plugin.cpp.
void BlockAccurateHandler::parseFile | ( | std::string | filename, |
std::string | reg | ||
) |
reads a file and adds the errors.
Syntax: TIME_IN_NANOSECONDS;AFFECTED_BIT[;ERROR_ID] NOTE: the ";ERROR_ID" part is optional. No spaces may exist inbetween the values Example: 1000;3 2000;0;1234 above example schedules an error at time: 1000 ns: bit number 3 will be flipped e.g. @999ns: 0x00000000 @1001ns: 0x00000008 2000 ns: bit number 0 will be flipped e.g. @1999ns: 0x00000008 @2100ns: 0x00000009 NOTE: due to the infrequent execution of this plugin (usually only after a block) there may be a large delay between scheduled time and application of the error
Definition at line 158 of file Plugin.cpp.
References c, errors_, etiss_BlockAccurateHandler_cmp(), next_time_ps, and printf().
Referenced by ETISSINCLUDED_createPlugin().
|
private |
|
private |
|
private |
Definition at line 143 of file Plugin.h.
Referenced by add(), execute(), and parseFile().
|
private |
Definition at line 144 of file Plugin.h.
Referenced by BlockAccurateHandler(), and execute().
|
private |
Definition at line 145 of file Plugin.h.
Referenced by add(), BlockAccurateHandler(), execute(), and parseFile().
|
private |