ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
etiss::fault::Trigger Class Reference

#include <Trigger.h>

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

Public Types

enum  Type {
  META_COUNTER , VARIABLEVALUE , TIME , TIMERELATIVE ,
  NOP
}
 

Public Member Functions

 Trigger ()
 Type: NOP (no operation) More...
 
 Trigger (const Trigger &sub, uint64_t count)
 This Trigger counts with count how often a sub trigger e.g. VRIABLEVALUE trigger fires. When this sub trigger fires the count 'th time, the META_COUNTER trigger fires itself. More...
 
 Trigger (const InjectorAddress &target_injector, const std::string &field, uint64_t value)
 This Trigger fires when variable field has the value value. More...
 
 Trigger (const InjectorAddress &target_injector, uint64_t time_ps, bool relative=false)
 This Trigger fires when a specific runtime has passed. More...
 
 Trigger (const Trigger &cpy)
 
Triggeroperator= (const Trigger &cpy)
 
 ~Trigger ()
 
uint64_t getTriggerCount () const
 
TriggergetSubTrigger ()
 
const TriggergetSubTrigger () const
 
uint64_t getTriggerTime () const
 
const InjectorAddressgetInjectorAddress () const
 
const Injector_ptrgetInjector () const
 
bool isNOP () const
 
const std::string & getTriggerField () const
 
const uint64_tgetTriggerFieldValue () const
 
Type getType () const
 
bool fired (uint64_t time_ps, etiss::fault::Injector *target_injector)
 this function checks if the Trigger has just fired. More...
 
void resolveTime (uint64_t time)
 this function calculates in case of a TIMERELATIVE Trigger a constant TIME trigger More...
 
bool isResolved () const
 returns if the translation from TIMERELATIVE to TIME trigger has taken place More...
 
std::string toString () const
 operator<< can be used. More...
 
- Public Member Functions inherited from etiss::ToString
 ToString ()
 
virtual ~ToString ()
 

Private Member Functions

void ensure (Type type) const
 

Private Attributes

Type type_
 
std::string field_
 
Triggersub_
 
InjectorAddress inj_
 
void * fieldptr_
 
uint64_t param1_
 
uint64_t param2_
 

Detailed Description

Definition at line 84 of file Trigger.h.

Member Enumeration Documentation

◆ Type

Enumerator
META_COUNTER 
VARIABLEVALUE 
TIME 
TIMERELATIVE 

needs to be resolved.

this can only be used in connection with an injection action

NOP 

Definition at line 87 of file Trigger.h.

Constructor & Destructor Documentation

◆ Trigger() [1/5]

etiss::fault::Trigger::Trigger ( )

Type: NOP (no operation)

Definition at line 70 of file Trigger.cpp.

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

Referenced by operator=().

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

◆ Trigger() [2/5]

etiss::fault::Trigger::Trigger ( const Trigger sub,
uint64_t  count 
)

This Trigger counts with count how often a sub trigger e.g. VRIABLEVALUE trigger fires. When this sub trigger fires the count 'th time, the META_COUNTER trigger fires itself.

Note
Type: META_COUNTER

Definition at line 74 of file Trigger.cpp.

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

Here is the call graph for this function:

◆ Trigger() [3/5]

etiss::fault::Trigger::Trigger ( const InjectorAddress target_injector,
const std::string &  field,
uint64_t  value 
)

This Trigger fires when variable field has the value value.

Note
Type: VARIABLEVALUE

Definition at line 79 of file Trigger.cpp.

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

Here is the call graph for this function:

◆ Trigger() [4/5]

etiss::fault::Trigger::Trigger ( const InjectorAddress target_injector,
uint64_t  time_ps,
bool  relative = false 
)

This Trigger fires when a specific runtime has passed.

Note
Type: TIMERELATIVE or TIME

Definition at line 84 of file Trigger.cpp.

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

Here is the call graph for this function:

◆ Trigger() [5/5]

etiss::fault::Trigger::Trigger ( const Trigger cpy)

Definition at line 91 of file Trigger.cpp.

◆ ~Trigger()

etiss::fault::Trigger::~Trigger ( )

Definition at line 144 of file Trigger.cpp.

References fieldptr_, etiss::fault::InjectorAddress::getInjector(), inj_, etiss::fault::InjectorAddress::isResolved(), META_COUNTER, sub_, type_, and VARIABLEVALUE.

Here is the call graph for this function:

Member Function Documentation

◆ ensure()

void etiss::fault::Trigger::ensure ( Type  type) const
private

Definition at line 60 of file Trigger.cpp.

References etiss::FATALERROR, etiss::log(), get_metrics::type, and type_.

Referenced by getSubTrigger(), getTriggerCount(), getTriggerField(), getTriggerFieldValue(), and getTriggerTime().

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

◆ fired()

bool etiss::fault::Trigger::fired ( uint64_t  time_ps,
etiss::fault::Injector target_injector 
)

this function checks if the Trigger has just fired.

TODO decide how to handle the case of multiple trigger checks at the same simulation time

Definition at line 157 of file Trigger.cpp.

References etiss::ERROR, etiss::fault::Injector::fastFieldAccessPtr(), field_, fieldptr_, fired(), etiss::fault::InjectorAddress::getInjector(), etiss::fault::InjectorAddress::getInjectorPath(), inj_, etiss::log(), META_COUNTER, NOP, param1_, param2_, resolveTime(), sub_, TIME, TIMERELATIVE, type_, uint64_t, VARIABLEVALUE, etiss::VERBOSE, and etiss::WARNING.

Referenced by fired().

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

◆ getInjector()

const Injector_ptr & etiss::fault::Trigger::getInjector ( ) const

Definition at line 305 of file Trigger.cpp.

References etiss::fault::InjectorAddress::getInjector(), getInjector(), inj_, META_COUNTER, sub_, and type_.

Referenced by getInjector().

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

◆ getInjectorAddress()

const InjectorAddress & etiss::fault::Trigger::getInjectorAddress ( ) const

Definition at line 301 of file Trigger.cpp.

References inj_.

◆ getSubTrigger() [1/2]

Trigger & etiss::fault::Trigger::getSubTrigger ( )

Definition at line 275 of file Trigger.cpp.

References ensure(), META_COUNTER, and sub_.

Referenced by getTriggerField(), getTriggerFieldValue(), getTriggerTime(), isResolved(), and resolveTime().

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

◆ getSubTrigger() [2/2]

const Trigger & etiss::fault::Trigger::getSubTrigger ( ) const

Definition at line 280 of file Trigger.cpp.

References ensure(), META_COUNTER, and sub_.

Here is the call graph for this function:

◆ getTriggerCount()

uint64_t etiss::fault::Trigger::getTriggerCount ( ) const

Definition at line 270 of file Trigger.cpp.

References ensure(), META_COUNTER, and param1_.

Here is the call graph for this function:

◆ getTriggerField()

const std::string & etiss::fault::Trigger::getTriggerField ( ) const

Definition at line 327 of file Trigger.cpp.

References ensure(), field_, getSubTrigger(), getTriggerField(), META_COUNTER, type_, and VARIABLEVALUE.

Referenced by getTriggerField().

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

◆ getTriggerFieldValue()

const uint64_t & etiss::fault::Trigger::getTriggerFieldValue ( ) const

Definition at line 337 of file Trigger.cpp.

References ensure(), getSubTrigger(), getTriggerFieldValue(), META_COUNTER, param1_, type_, and VARIABLEVALUE.

Referenced by getTriggerFieldValue().

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

◆ getTriggerTime()

uint64_t etiss::fault::Trigger::getTriggerTime ( ) const

Definition at line 285 of file Trigger.cpp.

References ensure(), getSubTrigger(), getTriggerTime(), META_COUNTER, param1_, TIME, TIMERELATIVE, and type_.

Referenced by getTriggerTime().

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

◆ getType()

Trigger::Type etiss::fault::Trigger::getType ( ) const

Definition at line 347 of file Trigger.cpp.

References type_.

◆ isNOP()

bool etiss::fault::Trigger::isNOP ( ) const

Definition at line 316 of file Trigger.cpp.

References isNOP(), META_COUNTER, NOP, sub_, and type_.

Referenced by isNOP().

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

◆ isResolved()

bool etiss::fault::Trigger::isResolved ( ) const

returns if the translation from TIMERELATIVE to TIME trigger has taken place

Definition at line 261 of file Trigger.cpp.

References getSubTrigger(), isResolved(), META_COUNTER, TIMERELATIVE, and type_.

Referenced by isResolved().

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

◆ operator=()

Trigger & etiss::fault::Trigger::operator= ( const Trigger cpy)

◆ resolveTime()

void etiss::fault::Trigger::resolveTime ( uint64_t  time)

this function calculates in case of a TIMERELATIVE Trigger a constant TIME trigger

Definition at line 247 of file Trigger.cpp.

References getSubTrigger(), etiss::log(), META_COUNTER, param1_, resolveTime(), TIME, TIMERELATIVE, type_, and etiss::VERBOSE.

Referenced by fired(), and resolveTime().

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

◆ toString()

std::string etiss::fault::Trigger::toString ( ) const

operator<< can be used.

Definition at line 352 of file Trigger.cpp.

References field_, META_COUNTER, NOP, param1_, param2_, TIME, TIMERELATIVE, type_, and VARIABLEVALUE.

Referenced by etiss::fault::Injector::acceleratedTrigger(), and etiss::fault::Injector::addTrigger().

Here is the caller graph for this function:

Member Data Documentation

◆ field_

std::string etiss::fault::Trigger::field_
private

Definition at line 164 of file Trigger.h.

Referenced by fired(), getTriggerField(), operator=(), and toString().

◆ fieldptr_

void* etiss::fault::Trigger::fieldptr_
private

Definition at line 167 of file Trigger.h.

Referenced by fired(), operator=(), and ~Trigger().

◆ inj_

InjectorAddress etiss::fault::Trigger::inj_
private

Definition at line 166 of file Trigger.h.

Referenced by fired(), getInjector(), getInjectorAddress(), operator=(), and ~Trigger().

◆ param1_

uint64_t etiss::fault::Trigger::param1_
private

◆ param2_

uint64_t etiss::fault::Trigger::param2_
private

Definition at line 169 of file Trigger.h.

Referenced by fired(), operator=(), and toString().

◆ sub_

Trigger* etiss::fault::Trigger::sub_
private

Definition at line 165 of file Trigger.h.

Referenced by fired(), getInjector(), getSubTrigger(), isNOP(), operator=(), and ~Trigger().

◆ type_

Type etiss::fault::Trigger::type_
private

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