ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Plugin.h
Go to the documentation of this file.
1 
56 #ifndef ETISS_PLUGIN_ERRORINJECTION_PLUGIN_H_
57 #define ETISS_PLUGIN_ERRORINJECTION_PLUGIN_H_
58 
59 #include "etiss/Plugin.h"
60 
61 #include <list>
62 #include <string>
63 
64 namespace etiss
65 {
66 
67 namespace plugin
68 {
69 
70 namespace errorInjection
71 {
72 
79 {
80  public:
81  class Error
82  {
83  public:
84  Error(std::string reg, unsigned errorid, etiss::uint64 time_ps, etiss::uintMax xor_,
85  etiss::uintMax and_ = (etiss::uintMax)(etiss::intMax)-1, etiss::uintMax or_ = 0);
86  std::string reg;
87  unsigned errorid;
89  etiss::uintMax xor_;
90  etiss::uintMax and_;
91  etiss::uintMax or_;
92  };
93 
96 
103  void add(etiss::uint64 time_ps, unsigned errorid, std::string register_, etiss::uintMax xor_,
104  etiss::uintMax and_ = (etiss::uintMax)(etiss::intMax)-1, etiss::uintMax or_ = 0);
105 
109  virtual etiss::int32 execute();
110 
132  void parseFile(std::string filename, std::string reg);
133 
134  virtual std::string _getPluginName() const;
135 
136  virtual void init(ETISS_CPU *cpu, ETISS_System *system, CPUArch *arch);
137  virtual void cleanup();
138 
139  private:
143  std::list<Error> errors_;
146 };
147 
148 } // namespace errorInjection
149 
150 } // namespace plugin
151 
152 } // namespace etiss
153 
154 #endif
etiss_int32 int32
Definition: 386-GCC.h:81
etiss_uint64 uint64
Definition: 386-GCC.h:82
plugins for extensions to code translation and instruction execution
the interface to translate instructions of and processor architecture
Definition: CPUArch.h:162
this plugin will be called before a block is executed.
Definition: Plugin.h:299
Error(std::string reg, unsigned errorid, etiss::uint64 time_ps, etiss::uintMax xor_, etiss::uintMax and_=(etiss::uintMax)(etiss::intMax) -1, etiss::uintMax or_=0)
Definition: Plugin.cpp:59
Register error injection class.
Definition: Plugin.h:79
virtual std::string _getPluginName() const
Definition: Plugin.cpp:238
void add(etiss::uint64 time_ps, unsigned errorid, std::string register_, etiss::uintMax xor_, etiss::uintMax and_=(etiss::uintMax)(etiss::intMax) -1, etiss::uintMax or_=0)
schedule an error
Definition: Plugin.cpp:77
virtual etiss::int32 execute()
call to apply errors
Definition: Plugin.cpp:92
virtual void init(ETISS_CPU *cpu, ETISS_System *system, CPUArch *arch)
this function is called before the plugin is used in the cpu execution loop (etiss::CPUCore::execute)...
Definition: Plugin.cpp:243
virtual void cleanup()
this function is called after cpu execution loop (etiss::CPUCore::execute) finished.
Definition: Plugin.cpp:249
void parseFile(std::string filename, std::string reg)
reads a file and adds the errors.
Definition: Plugin.cpp:158
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
Definition: Benchmark.h:53
basic cpu state structure needed for execution of any cpu architecture.
Definition: CPU.h:89
memory access and time synchronization functions.
Definition: System.h:78