ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
Plugin.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.
18#ifndef ETISS_PLUGIN_ERRORINJECTION_PLUGIN_H_
19#define ETISS_PLUGIN_ERRORINJECTION_PLUGIN_H_
20
21#include "etiss/Plugin.h"
22
23#include <list>
24#include <string>
25
26namespace etiss
27{
28
29namespace plugin
30{
31
32namespace errorInjection
33{
34
41{
42 public:
43 class Error
44 {
45 public:
46 Error(std::string reg, unsigned errorid, etiss::uint64 time_ps, etiss::uintMax xor_,
47 etiss::uintMax and_ = (etiss::uintMax)(etiss::intMax)-1, etiss::uintMax or_ = 0);
48 std::string reg;
49 unsigned errorid;
50 etiss::uint64 time_ps;
51 etiss::uintMax xor_;
52 etiss::uintMax and_;
53 etiss::uintMax or_;
54 };
55
58
65 void add(etiss::uint64 time_ps, unsigned errorid, std::string register_, etiss::uintMax xor_,
66 etiss::uintMax and_ = (etiss::uintMax)(etiss::intMax)-1, etiss::uintMax or_ = 0);
67
71 virtual etiss::int32 execute();
72
94 void parseFile(std::string filename, std::string reg);
95
96 virtual std::string _getPluginName() const;
97
98 virtual void init(ETISS_CPU *cpu, ETISS_System *system, CPUArch *arch);
99 virtual void cleanup();
100
101 private:
105 std::list<Error> errors_;
106 etiss::uint64 last_time_ps;
107 etiss::uint64 next_time_ps;
108};
109
110} // namespace errorInjection
111
112} // namespace plugin
113
114} // namespace etiss
115
116#endif
plugins for extensions to code translation and instruction execution
the interface to translate instructions of and processor architecture
Definition CPUArch.h:116
this plugin will be called before a block is executed.
Definition Plugin.h:259
Register error injection class.
Definition Plugin.h:41
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:40
virtual etiss::int32 execute()
call to apply errors
Definition Plugin.cpp:55
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:206
virtual void cleanup()
this function is called after cpu execution loop (etiss::CPUCore::execute) finished.
Definition Plugin.cpp:212
void parseFile(std::string filename, std::string reg)
reads a file and adds the errors.
Definition Plugin.cpp:121
forwards: include/jit/*
Definition Benchmark.h:17
basic cpu state structure needed for execution of any cpu architecture.
Definition CPU.h:51
memory access and time synchronization functions.
Definition System.h:40