ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Fault.h
Go to the documentation of this file.
1 
52 #ifndef ETISS_FAULT_FAULT_H_
53 #define ETISS_FAULT_FAULT_H_
54 
55 #include <exception>
56 #include <iostream>
57 #include <limits>
58 #include <list>
59 #include <sstream>
60 #include <stdint.h>
61 #include <vector>
62 
63 #ifndef NO_ETISS
64 #include "etiss/fault/Action.h"
65 #include "etiss/fault/Defs.h"
66 #include "etiss/fault/Trigger.h"
67 #include "etiss/fault/XML.h"
68 #else
69 #include "fault/Action.h"
70 #include "fault/Defs.h"
71 #include "fault/Trigger.h"
72 #include "fault/XML.h"
73 #endif
74 
76 #define MUTEX_SUPPORTED CXX0X_UP_SUPPORTED
77 
78 namespace etiss
79 {
80 namespace fault
81 {
82 
83 typedef uint64_t INT;
84 
85 class Action;
86 
87 class Fault : public etiss::ToString
88 {
89  public:
90  Fault();
91 
92  std::string toString() const;
93 
94  void resolveTime(uint64_t time);
95  bool isResoved() const;
96 
97  public:
98  std::string name_;
100  std::vector<Trigger> triggers;
101  std::vector<Action> actions;
102 };
103 
104 #if ETISS_FAULT_XML
105 
106 bool parseXML(std::vector<Fault> &vec, std::istream &input, std::ostream &diagnostics_out = std::cout);
107 
108 bool writeXML(const std::vector<Fault> &vec, std::ostream &out, std::ostream &diagnostics_out = std::cout);
109 
110 namespace xml
111 {
112 
113 template <>
114 bool parse<etiss::fault::Fault>(pugi::xml_node node, etiss::fault::Fault &f, Diagnostics &diag);
115 template <>
116 bool write<etiss::fault::Fault>(pugi::xml_node node, const etiss::fault::Fault &f, Diagnostics &diag);
117 
118 } // namespace xml
119 
120 #endif
121 
122 } // namespace fault
123 } // namespace etiss
124 
125 #endif
contains an action class that describes actions associated with a fault
contains general definitions used by other fault library code
contains the Trigger class that defines conditions under which actions of a Fault need to be applied.
contains XML related functions.
static __inline__ uint64_t
Definition: arm_cde.h:31
static __inline__ int32_t
Definition: arm_mve.h:51
Marker interface for toString() support.
Definition: Misc.h:137
bool isResoved() const
check all Triggers if they are resolved.
Definition: Fault.cpp:239
Fault()
Constructor: Generates a new Fault with unique ID.
Definition: Fault.cpp:208
std::string toString() const
operator<< can be used.
Definition: Fault.cpp:213
int32_t id_
Definition: Fault.h:99
std::string name_
Definition: Fault.h:98
void resolveTime(uint64_t time)
Resolves time for all its Triggers.
Definition: Fault.cpp:230
std::vector< Trigger > triggers
contains the triggers for this fault
Definition: Fault.h:100
std::vector< Action > actions
contains the actions for this fault
Definition: Fault.h:101
uint64_t INT
Definition: Fault.h:83
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
Definition: Benchmark.h:53