ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
etiss::Plugin Class Referenceabstract

base plugin class that provides access to different plugin functions if present More...

#include <Plugin.h>

Inheritance diagram for etiss::Plugin:
Inheritance graph
[legend]
Collaboration diagram for etiss::Plugin:
Collaboration graph
[legend]

Public Member Functions

virtual ~Plugin ()
 
unsigned getType ()
 
InterruptListenerPlugingetInterruptListenerPlugin ()
 
CoroutinePlugingetCoroutinePlugin ()
 
SystemWrapperPlugingetSystemWrapperPlugin ()
 
RegisterDevicePlugingetRegisterDevicePlugin ()
 
TranslationPlugingetTranslationPlugin ()
 
std::string getPluginName () const
 
const std::string & getLastAssignedCoreName ()
 
std::string toString () const
 
- Public Member Functions inherited from etiss::ToString
 ToString ()
 
virtual ~ToString ()
 

Static Public Attributes

static const unsigned INTERRUPTLISTENER = 1 << 0
 access to translated code More...
 
static const unsigned COROUTINE = 1 << 1
 callback after execution of each translated block More...
 
static const unsigned SYSTEMWRAPPER = 1 << 2
 can wrap/change ETISS_System structure at execution start More...
 
static const unsigned REGISTERDEVICE
 gets noticed of changes to special registers (e.g. mmu register etc. [depends on architecture]) More...
 
static const unsigned TRANSLATION
 access to translated code during translation phase or when instruction tree is built More...
 

Protected Member Functions

 Plugin (unsigned type=0)
 
virtual std::string _getPluginName () const =0
 
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). More...
 
virtual void cleanup ()
 this function is called after cpu execution loop (etiss::CPUCore::execute) finished. More...
 
void setCorrespondingCPUCoreName (std::string name)
 
virtual void addedToCPUCore (etiss::CPUCore *core)
 called as soon a plugin has been added to its CPUCore. More...
 
virtual void removedFromCPUCore (etiss::CPUCore *core)
 called as soon a plugin has been removed from its CPUCore. More...
 

Protected Attributes

ETISS_CPUplugin_cpu_
 holds a pointer to the cpu structure. will be set before init call and after cleanup call More...
 
ETISS_Systemplugin_system_
 holds a pointer to the system structure. More...
 
CPUArchplugin_arch_
 holds a pointer to the CPUArch instance. will be set before init call and after cleanup call More...
 
CPUCoreplugin_core_
 holds a pointer to the associated CPUCore instance. More...
 

Private Attributes

unsigned type_
 
std::string name_
 contains a name that is build from the return value of getPluginName_() + the implemented interfaces of a plugin More...
 
InterruptListenerPlugintplugin_
 
SystemWrapperPluginsplugin_
 
CoroutinePlugincplugin_
 
RegisterDevicePluginrplugin_
 
TranslationPlugintrplugin_
 
std::string lastAssignedCoreName_
 

Friends

class InterruptListenerPlugin
 
class TranslationPlugin
 
class CoroutinePlugin
 
class SystemWrapperPlugin
 
class RegisterDevicePlugin
 
class CPUCore
 

Detailed Description

base plugin class that provides access to different plugin functions if present

See also
InterruptListenerPlugin
CoroutinePlugin
SystemWrapperPlugin
RegisterDevicePlugin

Definition at line 76 of file Plugin.h.

Constructor & Destructor Documentation

◆ Plugin()

Plugin::Plugin ( unsigned  type = 0)
protected

Definition at line 57 of file Plugin.cpp.

◆ ~Plugin()

Plugin::~Plugin ( )
virtual

Definition at line 72 of file Plugin.cpp.

Member Function Documentation

◆ _getPluginName()

virtual std::string etiss::Plugin::_getPluginName ( ) const
protectedpure virtual

◆ addedToCPUCore()

virtual void etiss::Plugin::addedToCPUCore ( etiss::CPUCore core)
inlineprotectedvirtual

called as soon a plugin has been added to its CPUCore.

this method explicitly allows to configure/manipulate the cpu core and doesn't run into deadlock if a synchronized CPUCore function is called.

Definition at line 210 of file Plugin.h.

◆ cleanup()

void Plugin::cleanup ( )
protectedvirtual

this function is called after cpu execution loop (etiss::CPUCore::execute) finished.

Only the SystemWrapperPlugin::unwrap function is called AFTER Plugin::cleanup

Reimplemented in etiss::plugin::gdb::Server, TracePrinter, and etiss::plugin::errorInjection::BlockAccurateHandler.

Definition at line 75 of file Plugin.cpp.

◆ getCoroutinePlugin()

CoroutinePlugin* etiss::Plugin::getCoroutinePlugin ( )
inline
Returns
a pointer to an implemented CoroutinePlugin

Definition at line 112 of file Plugin.h.

References cplugin_.

◆ getInterruptListenerPlugin()

InterruptListenerPlugin* etiss::Plugin::getInterruptListenerPlugin ( )
inline
Returns
a pointer to an implemented InterruptListenerPlugin

Definition at line 108 of file Plugin.h.

References tplugin_.

Referenced by etiss::CPUCore::InterruptVectorWrapper::setBit().

Here is the caller graph for this function:

◆ getLastAssignedCoreName()

const std::string& etiss::Plugin::getLastAssignedCoreName ( )
inline
Note
Every Plugin is assigned to an CPUCore. When the CPUCore is destructed this Function can be used to get the CoreName again. Especially for needed for Core Specific Configurations
Returns
Name of the Core which was last assigned to this Plugin

Definition at line 175 of file Plugin.h.

References lastAssignedCoreName_.

◆ getPluginName()

std::string etiss::Plugin::getPluginName ( ) const
inline
Returns
a plugin name consisting of the value returned by Plugin::_getPluginName and a list of implemented interfaces

Definition at line 130 of file Plugin.h.

References _getPluginName(), COROUTINE, INTERRUPTLISTENER, name_, REGISTERDEVICE, SYSTEMWRAPPER, TRANSLATION, and type_.

Referenced by etiss::CPUCore::execute(), and toString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRegisterDevicePlugin()

RegisterDevicePlugin* etiss::Plugin::getRegisterDevicePlugin ( )
inline
Returns
a pointer to an implemented RegisterDevicePlugin

Definition at line 120 of file Plugin.h.

References rplugin_.

◆ getSystemWrapperPlugin()

SystemWrapperPlugin* etiss::Plugin::getSystemWrapperPlugin ( )
inline
Returns
a pointer to an implemented SystemWrapperPlugin

Definition at line 116 of file Plugin.h.

References splugin_.

◆ getTranslationPlugin()

TranslationPlugin* etiss::Plugin::getTranslationPlugin ( )
inline
Returns
a pointer to an implemented RegisterDevicePlugin

Definition at line 125 of file Plugin.h.

References trplugin_.

Referenced by etiss::Translation::init().

Here is the caller graph for this function:

◆ getType()

unsigned etiss::Plugin::getType ( )
inline
Returns
an integer that has the appropriate bits set for its implemented plugin types (Plugin::INTERRUPTLISTENER,Plugin::COROUTINE,Plugin::SYSTEMWRAPPER,Plugin::REGISTERDEVICE)

Definition at line 104 of file Plugin.h.

References type_.

◆ init()

void Plugin::init ( ETISS_CPU cpu,
ETISS_System system,
CPUArch arch 
)
protectedvirtual

this function is called before the plugin is used in the cpu execution loop (etiss::CPUCore::execute).

Only exception is the SystemWrapperPlugin whose SystemWrapperPlugin::wrap function is called BEFORE Plugin::init

Reimplemented in TracePrinter, etiss::plugin::gdb::Server, and etiss::plugin::errorInjection::BlockAccurateHandler.

Definition at line 74 of file Plugin.cpp.

◆ removedFromCPUCore()

virtual void etiss::Plugin::removedFromCPUCore ( etiss::CPUCore core)
inlineprotectedvirtual

called as soon a plugin has been removed from its CPUCore.

similar to addedToCPUCore() it is possible to modify the CPUCore

Definition at line 215 of file Plugin.h.

Referenced by etiss::CPUCore::removePlugin().

Here is the caller graph for this function:

◆ setCorrespondingCPUCoreName()

void etiss::Plugin::setCorrespondingCPUCoreName ( std::string  name)
inlineprotected

Definition at line 204 of file Plugin.h.

References lastAssignedCoreName_.

Referenced by etiss::CPUArch::CPUArch().

Here is the caller graph for this function:

◆ toString()

std::string etiss::Plugin::toString ( ) const
inline

Definition at line 177 of file Plugin.h.

References getPluginName().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ CoroutinePlugin

friend class CoroutinePlugin
friend

Definition at line 80 of file Plugin.h.

◆ CPUCore

friend class CPUCore
friend

Definition at line 83 of file Plugin.h.

◆ InterruptListenerPlugin

friend class InterruptListenerPlugin
friend

Definition at line 78 of file Plugin.h.

◆ RegisterDevicePlugin

friend class RegisterDevicePlugin
friend

Definition at line 82 of file Plugin.h.

◆ SystemWrapperPlugin

friend class SystemWrapperPlugin
friend

Definition at line 81 of file Plugin.h.

◆ TranslationPlugin

friend class TranslationPlugin
friend

Definition at line 79 of file Plugin.h.

Member Data Documentation

◆ COROUTINE

const unsigned etiss::Plugin::COROUTINE = 1 << 1
static

callback after execution of each translated block

Definition at line 93 of file Plugin.h.

Referenced by etiss::CoroutinePlugin::CoroutinePlugin(), and getPluginName().

◆ cplugin_

CoroutinePlugin* etiss::Plugin::cplugin_
private

Definition at line 223 of file Plugin.h.

Referenced by etiss::CoroutinePlugin::CoroutinePlugin(), and getCoroutinePlugin().

◆ INTERRUPTLISTENER

const unsigned etiss::Plugin::INTERRUPTLISTENER = 1 << 0
static

access to translated code

Definition at line 92 of file Plugin.h.

Referenced by getPluginName(), and etiss::InterruptListenerPlugin::InterruptListenerPlugin().

◆ lastAssignedCoreName_

std::string etiss::Plugin::lastAssignedCoreName_
private

Definition at line 226 of file Plugin.h.

Referenced by getLastAssignedCoreName(), and setCorrespondingCPUCoreName().

◆ name_

std::string etiss::Plugin::name_
mutableprivate

contains a name that is build from the return value of getPluginName_() + the implemented interfaces of a plugin

Definition at line 219 of file Plugin.h.

Referenced by getPluginName().

◆ plugin_arch_

CPUArch* etiss::Plugin::plugin_arch_
protected

holds a pointer to the CPUArch instance. will be set before init call and after cleanup call

Definition at line 199 of file Plugin.h.

◆ plugin_core_

CPUCore* etiss::Plugin::plugin_core_
protected

holds a pointer to the associated CPUCore instance.

this pointer is valid as long a plugin is associtated with a cpu core. use with caution since this pointer may change in a non threadsafe manner.

Definition at line 200 of file Plugin.h.

Referenced by etiss::plugin::InstructionAccurateCallback::call(), etiss::plugin::errorInjection::BlockAccurateHandler::execute(), etiss::plugin::VariableValueLogger::finalizeInstrSet(), etiss::plugin::gdb::Server::handlePacket(), etiss::CPUCore::removePlugin(), and etiss::plugin::VariableValueLogger::writeValue().

◆ plugin_cpu_

ETISS_CPU* etiss::Plugin::plugin_cpu_
protected

◆ plugin_system_

ETISS_System* etiss::Plugin::plugin_system_
protected

holds a pointer to the system structure.

will be set before init call and after cleanup call

Definition at line 196 of file Plugin.h.

Referenced by etiss::plugin::fault::SwitchSystem::dread(), etiss::plugin::fault::SwitchSystem::dwrite(), etiss::plugin::fault::SwitchSystem::iread(), and etiss::plugin::fault::SwitchSystem::iwrite().

◆ REGISTERDEVICE

const unsigned etiss::Plugin::REGISTERDEVICE
static
Initial value:
=
1 << 3

gets noticed of changes to special registers (e.g. mmu register etc. [depends on architecture])

Definition at line 95 of file Plugin.h.

Referenced by getPluginName(), and etiss::RegisterDevicePlugin::RegisterDevicePlugin().

◆ rplugin_

RegisterDevicePlugin* etiss::Plugin::rplugin_
private

◆ splugin_

SystemWrapperPlugin* etiss::Plugin::splugin_
private

◆ SYSTEMWRAPPER

const unsigned etiss::Plugin::SYSTEMWRAPPER = 1 << 2
static

can wrap/change ETISS_System structure at execution start

Definition at line 94 of file Plugin.h.

Referenced by getPluginName(), and etiss::SystemWrapperPlugin::SystemWrapperPlugin().

◆ tplugin_

InterruptListenerPlugin* etiss::Plugin::tplugin_
private

◆ TRANSLATION

const unsigned etiss::Plugin::TRANSLATION
static
Initial value:
=
1 << 4

access to translated code during translation phase or when instruction tree is built

Definition at line 97 of file Plugin.h.

Referenced by getPluginName(), and etiss::TranslationPlugin::TranslationPlugin().

◆ trplugin_

TranslationPlugin* etiss::Plugin::trplugin_
private

Definition at line 225 of file Plugin.h.

Referenced by getTranslationPlugin(), and etiss::TranslationPlugin::TranslationPlugin().

◆ type_

unsigned etiss::Plugin::type_
private

The documentation for this class was generated from the following files: