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

#include <Stressor.h>

Collaboration diagram for etiss::fault::Stressor:
Collaboration graph
[legend]

Public Types

enum  Event { TERMINATE = (1 << 0) , ETISS_FLUSH_TRANSLATION_CACHE = (1 << 1) , ETISS_RELOAD_TRANSLATION_BLOCK = (1 << 2) }
 

Static Public Member Functions

static etiss::int32 get_event (void)
 
static void set_event (etiss::int32 code)
 
static void reset_event (void)
 
static bool loadXML (const std::string &file, const int coreID=0)
 extracts faults out of the given xml file.
 
static bool addFaultDefinition (const Fault &f)
 adds a fault to a static map that can be accessed by static std::map<int32_t,Fault> & faults().
 
static bool addFault (const Fault &f, bool injected_fault=false)
 activates a fault's triggers in their injectors
 
static bool removeFault (const Fault &f, bool injected_fault=false)
 removes a fault's active triggers from their injectors, thus, deactivating the fault.
 
static bool firedTrigger (const Trigger &firedTrigger, int32_t fault_id, Injector *injector, uint64_t time_ps)
 Checks if the given trigger is valid and calls applyAction.
 
static void clear ()
 clears the fault map.
 
static std::map< int32_t, Fault > & faults ()
 static map with all referencable faults.
 

Static Private Attributes

static etiss::int32 event_code_
 

Detailed Description

Definition at line 35 of file Stressor.h.

Member Enumeration Documentation

◆ Event

Enumerator
TERMINATE 
ETISS_FLUSH_TRANSLATION_CACHE 
ETISS_RELOAD_TRANSLATION_BLOCK 

Definition at line 38 of file Stressor.h.

Member Function Documentation

◆ addFault()

bool etiss::fault::Stressor::addFault ( const Fault f,
bool  injected_fault = false 
)
static

activates a fault's triggers in their injectors

Parameters
fthe fault to activate
Returns
false if refernced fault is not the static fault list faults().

TODO signal error and roll back

Definition at line 198 of file Stressor.cpp.

References etiss::fault::Fault::actions, etiss::fault::Injector::addTrigger(), etiss::ERROR, faults(), etiss::fault::Fault::id_, etiss::INFO, etiss::log(), etiss::fault::Fault::toString(), etiss::fault::Fault::triggers, etiss::fault::Injector::update_field_access_rights(), and etiss::WARNING.

Referenced by firedTrigger(), and loadXML().

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

◆ addFaultDefinition()

bool etiss::fault::Stressor::addFaultDefinition ( const Fault f)
static

adds a fault to a static map that can be accessed by static std::map<int32_t,Fault> & faults().

Parameters
fthe fault for adding to the map.
Returns
false if fault already exists in map faults().

Definition at line 167 of file Stressor.cpp.

References etiss::ERROR, faults(), etiss::fault::Fault::id_, etiss::INFO, etiss::log(), and etiss::fault::Fault::toString().

Referenced by loadXML().

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

◆ clear()

void etiss::fault::Stressor::clear ( )
static

clears the fault map.

Definition at line 471 of file Stressor.cpp.

References faults().

Referenced by etiss::shutdown().

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

◆ faults()

std::map< int32_t, Fault > & etiss::fault::Stressor::faults ( )
static

static map with all referencable faults.

Definition at line 48 of file Stressor.cpp.

Referenced by addFault(), addFaultDefinition(), clear(), firedTrigger(), removeFault(), and etiss::fault::FaultRef::resolve_reference().

Here is the caller graph for this function:

◆ firedTrigger()

bool etiss::fault::Stressor::firedTrigger ( const Trigger firedTrigger,
int32_t  fault_id,
Injector injector,
uint64_t  time_ps 
)
static

Checks if the given trigger is valid and calls applyAction.

Is called by a VirtualStruct e.g. OR1KVCPU::vcoreState. The VirtualStruct inherits the Injector so it can call Injector::cycleAccurateCallback, which calls this function

Parameters
firedTriggerthe Trigger which was called.
fault_idthe id of the fault to which the trigger corresponds.
injectorinjector which called this function.
time_pscpu time.
Returns
true if the fired trigger expired.

Definition at line 353 of file Stressor.cpp.

References addFault(), etiss::ERROR, faults(), etiss::log(), removeFault(), set_event(), and etiss::VERBOSE.

Here is the call graph for this function:

◆ get_event()

static etiss::int32 etiss::fault::Stressor::get_event ( void  )
inlinestatic

Definition at line 54 of file Stressor.h.

References event_code_.

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

Here is the caller graph for this function:

◆ loadXML()

bool etiss::fault::Stressor::loadXML ( const std::string &  file,
const int  coreID = 0 
)
static

extracts faults out of the given xml file.

Parameters
filethe xmlfile with fault triggers.
Returns
true if XML file could be loaded.

Definition at line 60 of file Stressor.cpp.

References addFault(), addFaultDefinition(), etiss::fault::coreIDActuallXML, etiss::ERROR, etiss::INFO, etiss::log(), and etiss::fault::parseXML().

Referenced by etiss::initialize_virtualstruct().

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

◆ removeFault()

bool etiss::fault::Stressor::removeFault ( const Fault f,
bool  injected_fault = false 
)
static

removes a fault's active triggers from their injectors, thus, deactivating the fault.

Parameters
fthe fault for adding to the map.
Returns
false if referenced fault is not the static fault list faults().

TODO signal error and roll back

Definition at line 282 of file Stressor.cpp.

References etiss::ERROR, faults(), etiss::fault::Fault::id_, etiss::INFO, etiss::log(), etiss::fault::Injector::removeTrigger(), etiss::fault::Fault::toString(), etiss::fault::Fault::triggers, and etiss::WARNING.

Referenced by firedTrigger().

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

◆ reset_event()

static void etiss::fault::Stressor::reset_event ( void  )
inlinestatic

Definition at line 65 of file Stressor.h.

References event_code_.

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

Here is the caller graph for this function:

◆ set_event()

static void etiss::fault::Stressor::set_event ( etiss::int32  code)
inlinestatic

Definition at line 55 of file Stressor.h.

References event_code_.

Referenced by firedTrigger().

Here is the caller graph for this function:

Member Data Documentation

◆ event_code_

etiss::int32 etiss::fault::Stressor::event_code_
staticprivate

Definition at line 51 of file Stressor.h.

Referenced by get_event(), reset_event(), and set_event().


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