54 #ifndef ETISS_INCLUDE_PLUGIN_H_
55 #define ETISS_INCLUDE_PLUGIN_H_
61 #include "etiss/jit/CPU.h"
62 #include "etiss/jit/System.h"
132 if (
name_.length() <= 0)
134 std::stringstream ss;
140 ss << (fe ?
"" :
",") <<
"INTERRUPTLISTENER";
145 ss << (fe ?
"" :
",") <<
"COROUTINE";
150 ss << (fe ?
"" :
",") <<
"SYSTEMWRAPPER";
155 ss << (fe ?
"" :
",") <<
"REGISTERDEVICE";
160 ss << (fe ?
"" :
",") <<
"TRANSLATION";
classes to hold code and additional information used for optimization of instruction translations
static __inline__ int32_t
the interface to translate instructions of and processor architecture
CPUCore is responsible for the simulation of a CPU core in ETISS.
this plugin will be called before a block is executed.
virtual ~CoroutinePlugin()
virtual void executionEnd(int32_t code)
called when the simulation ends but before any deinitialization is done
virtual etiss::int32 execute()=0
called before a block and may act in the same way as a block
virtual bool isActive()
indicates if the plugin will do something in execution loop.
InterruptListenerPlugin()
virtual bool interruptWrite(unsigned bit, bool value)=0
gets called whenever an external write to the interrrupt vector takes place
virtual ~InterruptListenerPlugin()
base plugin class that provides access to different plugin functions if present
CPUCore * plugin_core_
holds a pointer to the associated CPUCore instance.
void setCorrespondingCPUCoreName(std::string name)
virtual std::string _getPluginName() const =0
static const unsigned REGISTERDEVICE
gets noticed of changes to special registers (e.g. mmu register etc. [depends on architecture])
InterruptListenerPlugin * tplugin_
TranslationPlugin * getTranslationPlugin()
std::string toString() const
static const unsigned COROUTINE
callback after execution of each translated block
TranslationPlugin * trplugin_
std::string name_
contains a name that is build from the return value of getPluginName_() + the implemented interfaces ...
const std::string & getLastAssignedCoreName()
static const unsigned TRANSLATION
access to translated code during translation phase or when instruction tree is built
virtual void cleanup()
this function is called after cpu execution loop (etiss::CPUCore::execute) finished.
SystemWrapperPlugin * getSystemWrapperPlugin()
ETISS_CPU * plugin_cpu_
holds a pointer to the cpu structure. will be set before init call and after cleanup call
std::string lastAssignedCoreName_
InterruptListenerPlugin * getInterruptListenerPlugin()
CoroutinePlugin * getCoroutinePlugin()
CoroutinePlugin * cplugin_
ETISS_System * plugin_system_
holds a pointer to the system structure.
RegisterDevicePlugin * getRegisterDevicePlugin()
SystemWrapperPlugin * splugin_
static const unsigned INTERRUPTLISTENER
access to translated code
virtual void removedFromCPUCore(etiss::CPUCore *core)
called as soon a plugin has been removed from its CPUCore.
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)...
static const unsigned SYSTEMWRAPPER
can wrap/change ETISS_System structure at execution start
CPUArch * plugin_arch_
holds a pointer to the CPUArch instance. will be set before init call and after cleanup call
virtual void addedToCPUCore(etiss::CPUCore *core)
called as soon a plugin has been added to its CPUCore.
std::string getPluginName() const
RegisterDevicePlugin * rplugin_
RegisterDevicePlugin::changedRegister is called if a supported register has been changed.
virtual ~RegisterDevicePlugin()
virtual void changedRegister(const char *name)=0
called when an observable register has been changed
this plugin allows to wrap the ETISS_System interface
virtual ~SystemWrapperPlugin()
virtual ETISS_System * unwrap(ETISS_CPU *cpu, ETISS_System *system)=0
undo wrap function call this function will be called AFTER etiss::Plugin::cleanup
virtual ETISS_System * wrap(ETISS_CPU *cpu, ETISS_System *system)=0
change/wrap the passed system structure.
Marker interface for toString() support.
allows to add code to the translation of instructions
virtual void initCodeBlock(etiss::CodeBlock &) const
called before instructions are translated for the code block
virtual void finalizeInstrSet(etiss::instr::ModedInstructionSet &) const
called after all instructions have been added to allow last changes
virtual void finalizeCodeBlock(etiss::CodeBlock &) const
called after all instructions have been translated for the code block
virtual void initInstrSet(etiss::instr::ModedInstructionSet &) const
called to add instructions to the instruction set
std::string getPointerCode() const
returns a C code expression that allows to get or assign a pointer to the variable assigned to this t...
virtual void * getPluginHandle()
called to get the handle that is available in translated code via getPoinerCode()....
virtual ~TranslationPlugin()
holds etiss::instr::VariableInstructionSet instances for different modes.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
basic cpu state structure needed for execution of any cpu architecture.
memory access and time synchronization functions.