ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
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 More...
 
virtual std::list< std::string > listSubInjectors ()=0
 list all sub injectors. More...
 
virtual ptr getSubInjector (const std::string &name)=0
 get a sub injector. More...
 
virtual ptr getParentInjector ()=0
 get a the parent injector (root returns 0). More...
 
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. More...
 
virtual bool readField (void *fastfieldaccessptr, uint64_t &val, std::string &errormsg)=0
 read the value of a field More...
 
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 std::string getInjectorPath ()
 returns the path of the current object. More...
 
void addTrigger (const Trigger &t, int32_t fault_id)
 > Triggers to look at in callbacks More...
 

Static Public Member Functions

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

Private Attributes

volatile bool has_pending_triggers
 
std::list< std::pair< Trigger, int32_t > > pending_triggers
 
std::list< std::pair< Trigger, int32_t > > unknown_triggers
 > Triggers which were just added More...
 

Detailed Description

Definition at line 77 of file Injector.h.

Member Typedef Documentation

◆ ptr

Definition at line 83 of file Injector.h.

Constructor & Destructor Documentation

◆ Injector()

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

Definition at line 61 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 88 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 225 of file Injector.cpp.

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

Referenced by addTrigger().

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

◆ addTrigger()

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

> Triggers to look at in callbacks

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

Definition at line 204 of file Injector.cpp.

References acceleratedTrigger(), has_pending_triggers, etiss::log(), pending_triggers, 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 79 of file Injector.cpp.

References etiss::fault::Stressor::firedTrigger(), has_pending_triggers, etiss::log(), pending_triggers, unknown_triggers, and etiss::VERBOSE.

Referenced by instructionAccurateCallback().

Here is the call graph for this function:
Here is the caller 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::fired().

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 67 of file Injector.cpp.

References etiss::INFO, 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 655 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 142 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 123 of file Injector.cpp.

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

Here is the call 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 73 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.

Member Data Documentation

◆ has_pending_triggers

volatile bool etiss::fault::Injector::has_pending_triggers
private

Definition at line 178 of file Injector.h.

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

◆ pending_triggers

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

Definition at line 179 of file Injector.h.

Referenced by addTrigger(), and cycleAccurateCallback().

◆ unknown_triggers

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

> Triggers which were just added

Definition at line 180 of file Injector.h.

Referenced by cycleAccurateCallback().


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