ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Classes | Public Member Functions | Private Attributes | List of all members
etiss::plugin::errorInjection::BlockAccurateHandler Class Reference

Register error injection class. More...

#include <Plugin.h>

Inheritance diagram for etiss::plugin::errorInjection::BlockAccurateHandler:
Inheritance graph
[legend]
Collaboration diagram for etiss::plugin::errorInjection::BlockAccurateHandler:
Collaboration graph
[legend]

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 ()
 
InterruptListenerPlugingetInterruptListenerPlugin ()
 
CoroutinePlugingetCoroutinePlugin ()
 
SystemWrapperPlugingetSystemWrapperPlugin ()
 
RegisterDevicePlugingetRegisterDevicePlugin ()
 
TranslationPlugingetTranslationPlugin ()
 
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_CPUcpu
 
ETISS_Systemsystem
 
CPUArcharch
 
std::list< Errorerrors_
 
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_CPUplugin_cpu_
 holds a pointer to the cpu structure. will be set before init call and after cleanup call More...
 
ETISS_Systemplugin_system_
 holds a pointer to the system structure. More...
 
CPUArchplugin_arch_
 holds a pointer to the CPUArch instance. will be set before init call and after cleanup call More...
 
CPUCoreplugin_core_
 holds a pointer to the associated CPUCore instance. More...
 

Detailed Description

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

Definition at line 78 of file Plugin.h.

Constructor & Destructor Documentation

◆ BlockAccurateHandler()

BlockAccurateHandler::BlockAccurateHandler ( )

Definition at line 65 of file Plugin.cpp.

References last_time_ps, and next_time_ps.

◆ ~BlockAccurateHandler()

BlockAccurateHandler::~BlockAccurateHandler ( )

Definition at line 70 of file Plugin.cpp.

Member Function Documentation

◆ _getPluginName()

std::string BlockAccurateHandler::_getPluginName ( ) const
virtual

Implements etiss::Plugin.

Definition at line 238 of file Plugin.cpp.

◆ add()

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

Parameters
time_pstime of activation in picoseconds
erroridsome usedefined id
registera 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.

Here is the call graph for this function:

◆ cleanup()

void BlockAccurateHandler::cleanup ( )
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.

References arch, cpu, and system.

◆ execute()

etiss::int32 BlockAccurateHandler::execute ( )
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_.

Here is the call graph for this function:

◆ init()

void BlockAccurateHandler::init ( ETISS_CPU cpu,
ETISS_System system,
etiss::CPUArch arch 
)
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.

References arch, cpu, and system.

◆ parseFile()

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

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ arch

CPUArch* etiss::plugin::errorInjection::BlockAccurateHandler::arch
private

Definition at line 142 of file Plugin.h.

Referenced by cleanup(), and init().

◆ cpu

ETISS_CPU* etiss::plugin::errorInjection::BlockAccurateHandler::cpu
private

Definition at line 140 of file Plugin.h.

Referenced by cleanup(), execute(), and init().

◆ errors_

std::list<Error> etiss::plugin::errorInjection::BlockAccurateHandler::errors_
private

Definition at line 143 of file Plugin.h.

Referenced by add(), execute(), and parseFile().

◆ last_time_ps

etiss::uint64 etiss::plugin::errorInjection::BlockAccurateHandler::last_time_ps
private

Definition at line 144 of file Plugin.h.

Referenced by BlockAccurateHandler(), and execute().

◆ next_time_ps

etiss::uint64 etiss::plugin::errorInjection::BlockAccurateHandler::next_time_ps
private

Definition at line 145 of file Plugin.h.

Referenced by add(), BlockAccurateHandler(), execute(), and parseFile().

◆ system

ETISS_System* etiss::plugin::errorInjection::BlockAccurateHandler::system
private

Definition at line 141 of file Plugin.h.

Referenced by cleanup(), and init().


The documentation for this class was generated from the following files: