ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
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

typedef Trigger_Type type_t
 

Public Member Functions

 Trigger ()
 Type: NOP (no operation)
 
 Trigger (const InjectorAddress &target_injector)
 Type: typed but empty constructor (used for ASAP)
 
 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.
 
 Trigger (const InjectorAddress &target_injector, const std::string &field, uint64_t value)
 This Trigger fires when variable field has the value value.
 
 Trigger (const InjectorAddress &target_injector, uint64_t time_ps, bool relative=false)
 This Trigger fires when a specific runtime has passed.
 
 Trigger (const Trigger &cpy)
 
Triggeroperator= (const Trigger &cpy)
 
 ~Trigger ()
 
uint64_t getTriggerCount () const
 
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
 
const type_tgetType () const
 
bool check (uint64_t time_ps, etiss::fault::Injector *target_injector)
 this function checks if the Trigger has just fired.
 
void resolveTime (uint64_t time)
 this function calculates in case of a TIMERELATIVE Trigger a constant TIME trigger
 
bool isResolved () const
 returns if the translation from TIMERELATIVE to TIME trigger has taken place
 
std::string toString () const
 operator<< can be used.
 
- Public Member Functions inherited from etiss::ToString
 ToString ()
 
virtual ~ToString ()
 

Private Member Functions

void ensure (type_t type) const
 

Private Attributes

type_t type_
 
std::string field_
 
std::unique_ptr< Triggersub_
 
std::unique_ptr< InjectorAddressinj_
 
void * fieldptr_
 
uint64_t param1_ { 0 }
 
uint64_t param2_ { 0 }
 

Detailed Description

Definition at line 49 of file Trigger.h.

Member Typedef Documentation

◆ type_t

typedef Trigger_Type etiss::fault::Trigger::type_t

Definition at line 52 of file Trigger.h.

Constructor & Destructor Documentation

◆ Trigger() [1/6]

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

Type: NOP (no operation)

Definition at line 40 of file Trigger.cpp.

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

Here is the call graph for this function:

◆ Trigger() [2/6]

etiss::fault::Trigger::Trigger ( const InjectorAddress target_injector)

Type: typed but empty constructor (used for ASAP)

Definition at line 45 of file Trigger.cpp.

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

Here is the call graph for this function:

◆ Trigger() [3/6]

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 52 of file Trigger.cpp.

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

Here is the call graph for this function:

◆ Trigger() [4/6]

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 57 of file Trigger.cpp.

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

Here is the call graph for this function:

◆ Trigger() [5/6]

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 66 of file Trigger.cpp.

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

Here is the call graph for this function:

◆ Trigger() [6/6]

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

Definition at line 76 of file Trigger.cpp.

◆ ~Trigger()

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

Definition at line 132 of file Trigger.cpp.

References fieldptr_, inj_, and type_.

Member Function Documentation

◆ check()

bool etiss::fault::Trigger::check ( 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 143 of file Trigger.cpp.

References etiss::ERROR, etiss::fault::Injector::fastFieldAccessPtr(), field_, fieldptr_, inj_, etiss::log(), param1_, param2_, resolveTime(), sub_, type_, uint64_t, etiss::VERBOSE, and etiss::WARNING.

Here is the call graph for this function:

◆ ensure()

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

Definition at line 30 of file Trigger.cpp.

References etiss::FATALERROR, etiss::log(), 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:

◆ getInjector()

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

Definition at line 299 of file Trigger.cpp.

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

Referenced by operator=().

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 294 of file Trigger.cpp.

References inj_.

Referenced by operator=().

Here is the caller graph for this function:

◆ getSubTrigger()

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

Definition at line 271 of file Trigger.cpp.

References ensure(), and sub_.

Referenced by operator=().

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

◆ getTriggerCount()

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

Definition at line 265 of file Trigger.cpp.

References ensure(), and param1_.

Here is the call graph for this function:

◆ getTriggerField()

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

Definition at line 323 of file Trigger.cpp.

References ensure(), field_, sub_, and type_.

Here is the call graph for this function:

◆ getTriggerFieldValue()

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

Definition at line 334 of file Trigger.cpp.

References ensure(), param1_, sub_, and type_.

Here is the call graph for this function:

◆ getTriggerTime()

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

Definition at line 277 of file Trigger.cpp.

References ensure(), param1_, sub_, and type_.

Here is the call graph for this function:

◆ getType()

const Trigger::type_t & etiss::fault::Trigger::getType ( ) const

Definition at line 345 of file Trigger.cpp.

References type_.

◆ isNOP()

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

Definition at line 311 of file Trigger.cpp.

References sub_, and type_.

◆ isResolved()

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

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

Definition at line 256 of file Trigger.cpp.

References sub_, and type_.

◆ operator=()

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

Definition at line 81 of file Trigger.cpp.

References field_, fieldptr_, getInjector(), getInjectorAddress(), getSubTrigger(), inj_, param1_, param2_, sub_, and type_.

Here is the call graph for this function:

◆ 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 242 of file Trigger.cpp.

References etiss::log(), param1_, sub_, type_, and etiss::VERBOSE.

Referenced by check().

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 350 of file Trigger.cpp.

References field_, param1_, param2_, and type_.

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

Here is the caller graph for this function:

Member Data Documentation

◆ field_

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

Definition at line 123 of file Trigger.h.

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

◆ fieldptr_

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

Definition at line 126 of file Trigger.h.

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

◆ inj_

std::unique_ptr<InjectorAddress> etiss::fault::Trigger::inj_
private

Definition at line 125 of file Trigger.h.

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

◆ param1_

uint64_t etiss::fault::Trigger::param1_ { 0 }
private

◆ param2_

uint64_t etiss::fault::Trigger::param2_ { 0 }
private

Definition at line 128 of file Trigger.h.

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

◆ sub_

std::unique_ptr<Trigger> etiss::fault::Trigger::sub_
private

◆ type_

type_t etiss::fault::Trigger::type_
private

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