ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
Stressor.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2//
3// This file is part of ETISS. It is licensed under the BSD 3-Clause License; you may not use this file except in
4// compliance with the License. You should have received a copy of the license along with this project. If not, see the
5// LICENSE file.
15#ifndef ETISS_STRESSOR_H_
16#define ETISS_STRESSOR_H_
17
18#ifndef NO_ETISS
19#include "etiss/jit/ReturnCode.h"
20#endif
21
22#include <iostream>
23
24namespace etiss
25{
26
27namespace fault
28{
29
30class Fault;
31class Trigger;
32class Action;
33class Injector;
34
36{
37 public:
38 enum Event
39 {
40 TERMINATE = (1 << 0)
41#ifndef NO_ETISS
42 ,
45#else
46#endif
47 };
48
49#ifndef NO_ETISS
50 private:
51 static etiss::int32 event_code_;
52
53 public:
54 static etiss::int32 get_event(void) { return event_code_; }
55 static void set_event(etiss::int32 code) { event_code_ = code; }
56#else
57 private:
58 static int event_code_;
59
60 public:
61 static int get_event(void) { return event_code_; }
62 static void set_event(int code) { event_code_ = code; }
63 static void set_event_flag(Event flag) { event_code_ |= flag; }
64#endif
65 static void reset_event(void) { event_code_ = 0; }
70 static bool loadXML(const std::string &file, const int coreID = 0);
71
77 static bool addFaultDefinition(const Fault &f);
78
83 static bool addFault(const Fault &f, bool injected_fault = false);
84
90 static bool removeFault(const Fault &f, bool injected_fault = false);
91
103 static bool firedTrigger(const Trigger &firedTrigger, int32_t fault_id, Injector *injector, uint64_t time_ps);
104
107 static void clear();
110 static std::map<int32_t, Fault> &faults();
111};
112
113} // namespace fault
114
115} // namespace etiss
116
117#endif
static __inline__ uint64_t
Definition arm_cde.h:31
static __inline__ int32_t
Definition arm_mve.h:51
static etiss::int32 event_code_
Definition Stressor.h:51
static bool loadXML(const std::string &file, const int coreID=0)
extracts faults out of the given xml file.
Definition Stressor.cpp:60
static etiss::int32 get_event(void)
Definition Stressor.h:54
static bool removeFault(const Fault &f, bool injected_fault=false)
removes a fault's active triggers from their injectors, thus, deactivating the fault.
Definition Stressor.cpp:282
static bool addFault(const Fault &f, bool injected_fault=false)
activates a fault's triggers in their injectors
Definition Stressor.cpp:198
static void reset_event(void)
Definition Stressor.h:65
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().
Definition Stressor.cpp:167
static void clear()
clears the fault map.
Definition Stressor.cpp:471
static std::map< int32_t, Fault > & faults()
static map with all referencable faults.
Definition Stressor.cpp:48
static void set_event(etiss::int32 code)
Definition Stressor.h:55
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.
Definition Stressor.cpp:353
forwards: include/jit/*
Definition Benchmark.h:17