ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
etiss::fault::Injector Class Referenceabstract

#include <Injector.h>

Inheritance diagram for etiss::fault::Injector:
Inheritance graph
[legend]
Collaboration diagram for etiss::fault::Injector:
Collaboration graph
[legend]

Public Types

typedef Injectorptr
 

Public Member Functions

 Injector ()
 
virtual ~Injector ()
 
virtual std::list< std::string > listFields ()=0
 list all fields directly reachable by this injector
 
virtual std::list< std::string > listSubInjectors ()=0
 list all sub injectors.
 
virtual ptr getSubInjector (const std::string &name)=0
 get a sub injector.
 
virtual ptr getParentInjector ()=0
 get a the parent injector (root returns 0).
 
virtual bool needsCallbacks ()
 
virtual bool cycleAccurateCallback (uint64_t time_ps)
 
virtual bool instructionAccurateCallback (uint64_t time_ps)
 
virtual void * fastFieldAccessPtr (const std::string &name, std::string &errormsg)=0
 
virtual void freeFastFieldAccessPtr (void *)
 MUST be called to cleanup a pointer acquired with fastFieldAccessPtr() default implementation is nop.
 
virtual bool readField (void *fastfieldaccessptr, uint64_t &val, std::string &errormsg)=0
 read the value of a field
 
virtual bool applyAction (const etiss::fault::Fault &fault, const etiss::fault::Action &action, std::string &errormsg)=0
 
virtual bool acceleratedTrigger (const etiss::fault::Trigger &, int32_t fault_id)
 
virtual bool update_field_access_rights (const etiss::fault::Action &action, std::string &errormsg)=0
 Update the field of injector with access rights to allow action (used to get type of action).
 
virtual std::string getInjectorPath ()
 returns the path of the current object.
 
void addTrigger (const Trigger &t, int32_t fault_id)
 TODO specialized lists. e.g. time triggers should be sorted and only the earliest time should be checked.
 
void removeTrigger (const Trigger &t, int32_t fault_id)
 

Static Public Member Functions

static ptr get (const std::string &injectorPath)
 

Private Attributes

bool has_pending_triggers { false }
 
bool has_remove_triggers { false }
 
std::list< std::pair< Trigger, int32_t > > pending_triggers
 Triggers which were just added.
 
std::list< std::pair< Trigger, int32_t > > unknown_triggers
 Triggers to look at in callbacks.
 
std::list< std::pair< Trigger, int32_t > > remove_triggers
 Triggers to synchronously remove on next callback (prio over pending)
 

Detailed Description

Definition at line 47 of file Injector.h.

Member Typedef Documentation

◆ ptr

Definition at line 53 of file Injector.h.

Constructor & Destructor Documentation

◆ Injector()

etiss::fault::Injector::Injector ( )

Definition at line 31 of file Injector.cpp.

References has_pending_triggers, etiss::log(), and etiss::VERBOSE.

Here is the call graph for this function:

◆ ~Injector()

virtual etiss::fault::Injector::~Injector ( )
inlinevirtual

Definition at line 58 of file Injector.h.

Member Function Documentation

◆ acceleratedTrigger()

bool etiss::fault::Injector::acceleratedTrigger ( const etiss::fault::Trigger t,
int32_t  fault_id 
)
virtual

Reimplemented in etiss::VirtualStruct.

Definition at line 216 of file Injector.cpp.

References etiss::log(), etiss::fault::Trigger::toString(), and etiss::VERBOSE.

Here is the call graph for this function:

◆ addTrigger()

void etiss::fault::Injector::addTrigger ( const Trigger t,
int32_t  fault_id 
)

TODO specialized lists. e.g. time triggers should be sorted and only the earliest time should be checked.

Definition at line 184 of file Injector.cpp.

References etiss::log(), etiss::fault::Trigger::toString(), and etiss::VERBOSE.

Referenced by etiss::fault::Stressor::addFault().

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

◆ applyAction()

virtual bool etiss::fault::Injector::applyAction ( const etiss::fault::Fault fault,
const etiss::fault::Action action,
std::string &  errormsg 
)
pure virtual
Returns
true if action could be applied
Attention
MUST NOT be called from without the callback functions cycleAccurateCallback() and instructionAccurateCallback(). The assumption of a singlethreaded access/use of these functions MUST hold.

Implemented in etiss::VirtualStruct.

◆ cycleAccurateCallback()

bool etiss::fault::Injector::cycleAccurateCallback ( uint64_t  time_ps)
virtual

Definition at line 49 of file Injector.cpp.

References has_pending_triggers, has_remove_triggers, etiss::log(), pending_triggers, remove_triggers, unknown_triggers, unlikely, and etiss::VERBOSE.

Here is the call graph for this function:

◆ fastFieldAccessPtr()

virtual void * etiss::fault::Injector::fastFieldAccessPtr ( const std::string &  name,
std::string &  errormsg 
)
pure virtual
Attention
MUST NOT be called from without the callback functions cycleAccurateCallback() and instructionAccurateCallback(). The assumption of a singlethreaded access/use of these functions MUST hold.
Returns
0 in case of failure. otherwise an internal pointer shall be retuned that allows to access a field in a quick manner. freefastFieldAccessPtr MUST be called after use.

Implemented in etiss::VirtualStruct.

Referenced by etiss::fault::Trigger::check().

Here is the caller graph for this function:

◆ freeFastFieldAccessPtr()

void etiss::fault::Injector::freeFastFieldAccessPtr ( void *  )
virtual

MUST be called to cleanup a pointer acquired with fastFieldAccessPtr() default implementation is nop.

Attention
MUST NOT be called from outside the callback functions cycleAccurateCallback() and instructionAccurateCallback(). The assumption of a singlethreaded access/use of these functions MUST hold.

Definition at line 37 of file Injector.cpp.

References etiss::log(), and etiss::VERBOSE.

Here is the call graph for this function:

◆ get()

std::shared_ptr< etiss::fault::Injector > etiss::fault::Injector::get ( const std::string &  injectorPath)
static
Parameters
injectorPaththe full path/name to/off an injector. in case of using ETISS/VirtualStruct please have a look at the doc of etiss::VirtualStruct for examples of the path syntax
Attention
this function needs to be implemented in case of not using ETISS/VirtualStruct

Definition at line 705 of file VirtualStruct.cpp.

References etiss::VirtualStruct::root().

Referenced by etiss::fault::InjectorAddress::getInjector().

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

◆ getInjectorPath()

std::string etiss::fault::Injector::getInjectorPath ( )
virtual

returns the path of the current object.

by default the path will consists of the injector names from getSubInjectors() seperated by "::" (see etiss::VirtualStruct). override this function to match other/custom syntax

Definition at line 122 of file Injector.cpp.

References etiss::ERROR, ETISS_SRCLOC, getParentInjector(), getSubInjector(), listSubInjectors(), and etiss::log().

Referenced by etiss::VirtualStruct::applyAction().

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

◆ getParentInjector()

virtual ptr etiss::fault::Injector::getParentInjector ( )
pure virtual

get a the parent injector (root returns 0).

in case of c++11 this function returns a smart pointer (std::shared_ptr<Injector>)

See also
etiss::VirtualStruct for example implemention

Implemented in etiss::VirtualStruct.

Referenced by getInjectorPath().

Here is the caller graph for this function:

◆ getSubInjector()

virtual ptr etiss::fault::Injector::getSubInjector ( const std::string &  name)
pure virtual

get a sub injector.

in case of c++11 this function returns a smart pointer (std::shared_ptr<Injector>)

See also
etiss::VirtualStruct for example implemention

Implemented in etiss::VirtualStruct.

Referenced by getInjectorPath().

Here is the caller graph for this function:

◆ instructionAccurateCallback()

bool etiss::fault::Injector::instructionAccurateCallback ( uint64_t  time_ps)
virtual

todo

Definition at line 103 of file Injector.cpp.

References etiss::log(), and etiss::VERBOSE.

Referenced by etiss::plugin::InstructionAccurateCallback::call_on_entry().

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

◆ listFields()

virtual std::list< std::string > etiss::fault::Injector::listFields ( )
pure virtual

list all fields directly reachable by this injector

See also
etiss::VirtualStruct for example implemention

Implemented in etiss::VirtualStruct.

◆ listSubInjectors()

virtual std::list< std::string > etiss::fault::Injector::listSubInjectors ( )
pure virtual

list all sub injectors.

See also
etiss::VirtualStruct for example implemention

Implemented in etiss::VirtualStruct.

Referenced by getInjectorPath().

Here is the caller graph for this function:

◆ needsCallbacks()

bool etiss::fault::Injector::needsCallbacks ( )
virtual

Definition at line 43 of file Injector.cpp.

References has_pending_triggers, etiss::log(), and etiss::VERBOSE.

Here is the call graph for this function:

◆ readField()

virtual bool etiss::fault::Injector::readField ( void *  fastfieldaccessptr,
uint64_t val,
std::string &  errormsg 
)
pure virtual

read the value of a field

Returns
true if read succeded
Attention
MUST NOT be called from outside the callback functions cycleAccurateCallback() and instructionAccurateCallback(). The assumption of a singlethreaded access/use of these functions MUST hold.

Implemented in etiss::VirtualStruct.

◆ removeTrigger()

void etiss::fault::Injector::removeTrigger ( const Trigger t,
int32_t  fault_id 
)

Definition at line 205 of file Injector.cpp.

References etiss::log(), etiss::fault::Trigger::toString(), and etiss::VERBOSE.

Referenced by etiss::fault::Stressor::removeFault().

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

◆ update_field_access_rights()

virtual bool etiss::fault::Injector::update_field_access_rights ( const etiss::fault::Action action,
std::string &  errormsg 
)
pure virtual

Update the field of injector with access rights to allow action (used to get type of action).

For example, if action is of etiss::fault::Action::BITFLIP, field requires F flag set

Implemented in etiss::VirtualStruct.

Referenced by etiss::fault::Stressor::addFault().

Here is the caller graph for this function:

Member Data Documentation

◆ has_pending_triggers

bool etiss::fault::Injector::has_pending_triggers { false }
private

Definition at line 154 of file Injector.h.

Referenced by cycleAccurateCallback(), Injector(), and needsCallbacks().

◆ has_remove_triggers

bool etiss::fault::Injector::has_remove_triggers { false }
private

Definition at line 155 of file Injector.h.

Referenced by cycleAccurateCallback().

◆ pending_triggers

std::list<std::pair<Trigger, int32_t> > etiss::fault::Injector::pending_triggers
private

Triggers which were just added.

Definition at line 156 of file Injector.h.

Referenced by cycleAccurateCallback().

◆ remove_triggers

std::list<std::pair<Trigger, int32_t> > etiss::fault::Injector::remove_triggers
private

Triggers to synchronously remove on next callback (prio over pending)

Definition at line 159 of file Injector.h.

Referenced by cycleAccurateCallback().

◆ unknown_triggers

std::list<std::pair<Trigger, int32_t> > etiss::fault::Injector::unknown_triggers
private

Triggers to look at in callbacks.

Definition at line 157 of file Injector.h.

Referenced by cycleAccurateCallback().


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