ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Classes | Public Member Functions | Private Attributes | List of all members
etiss::plugin::MemMappedPeriph Class Referenceabstract

SystemWrapperPlugin to redirect data reads and writes to custom callbacks. More...

#include <MemMappedPeriph.h>

Inheritance diagram for etiss::plugin::MemMappedPeriph:
Inheritance graph
[legend]
Collaboration diagram for etiss::plugin::MemMappedPeriph:
Collaboration graph
[legend]

Classes

struct  CustomHandle
 

Public Member Functions

virtual MappedMemory getMappedMem () const =0
 Defines in which memory region to map this peripheral. More...
 
virtual etiss_uint8 read8 (etiss_uint64 addr)
 
virtual etiss_uint16 read16 (etiss_uint64 addr)
 
virtual etiss_uint32 read32 (etiss_uint64 addr)
 
virtual etiss_uint64 read64 (etiss_uint64 addr)
 
virtual void write8 (etiss_uint64 addr, etiss_uint8 val)
 
virtual void write16 (etiss_uint64 addr, etiss_uint16 val)
 
virtual void write32 (etiss_uint64 addr, etiss_uint32 val)
 
virtual void write64 (etiss_uint64 addr, etiss_uint64 val)
 
ETISS_System getWrapInfo (ETISS_System *origSystem) final
 Defines which System functions to wrap. More...
 
- Public Member Functions inherited from etiss::plugin::SelectiveSysWrapper
ETISS_Systemwrap (ETISS_CPU *cpu, ETISS_System *system) final
 change/wrap the passed system structure. More...
 
ETISS_Systemunwrap (ETISS_CPU *cpu, ETISS_System *system) final
 undo wrap function call this function will be called AFTER etiss::Plugin::cleanup More...
 
- Public Member Functions inherited from etiss::SystemWrapperPlugin
 SystemWrapperPlugin ()
 
virtual ~SystemWrapperPlugin ()
 
- Public Member Functions inherited from etiss::Plugin
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 ()
 

Private Attributes

CustomHandle customHandle_
 

Additional Inherited Members

- Static Public Attributes inherited from etiss::Plugin
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 inherited from etiss::Plugin
 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 inherited from etiss::Plugin
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...
 

Detailed Description

SystemWrapperPlugin to redirect data reads and writes to custom callbacks.

Definition at line 32 of file MemMappedPeriph.h.

Member Function Documentation

◆ getMappedMem()

virtual MappedMemory etiss::plugin::MemMappedPeriph::getMappedMem ( ) const
pure virtual

Defines in which memory region to map this peripheral.

Referenced by getWrapInfo().

Here is the caller graph for this function:

◆ getWrapInfo()

ETISS_System etiss::plugin::MemMappedPeriph::getWrapInfo ( ETISS_System origSystem)
finalvirtual

Defines which System functions to wrap.

Initialize an ETISS_System struct to zero and only set the fields of the functions that this plugin should wrap. The handle field may be set to a custom data structure that will be passed to the wrapped functions as first argument.

Parameters
origSystemThe System that is being wrapped. Must be stored by the plugin to fall back to the parent System.

Implements etiss::plugin::SelectiveSysWrapper.

Definition at line 67 of file MemMappedPeriph.cpp.

References etiss::plugin::MemMappedPeriph::CustomHandle::base, customHandle_, etiss::plugin::dread(), ETISS_System::dread, etiss::plugin::dwrite(), ETISS_System::dwrite, etiss::plugin::MemMappedPeriph::CustomHandle::end, getMappedMem(), ETISS_System::handle, etiss::plugin::MemMappedPeriph::CustomHandle::mmp, and etiss::plugin::MemMappedPeriph::CustomHandle::origSys.

Here is the call graph for this function:

◆ read16()

virtual etiss_uint16 etiss::plugin::MemMappedPeriph::read16 ( etiss_uint64  addr)
inlinevirtual

Definition at line 50 of file MemMappedPeriph.h.

References etiss::plugin::unimpl_read().

Here is the call graph for this function:

◆ read32()

virtual etiss_uint32 etiss::plugin::MemMappedPeriph::read32 ( etiss_uint64  addr)
inlinevirtual

Definition at line 51 of file MemMappedPeriph.h.

References etiss::plugin::unimpl_read().

Here is the call graph for this function:

◆ read64()

virtual etiss_uint64 etiss::plugin::MemMappedPeriph::read64 ( etiss_uint64  addr)
inlinevirtual

Definition at line 52 of file MemMappedPeriph.h.

References etiss::plugin::unimpl_read().

Here is the call graph for this function:

◆ read8()

virtual etiss_uint8 etiss::plugin::MemMappedPeriph::read8 ( etiss_uint64  addr)
inlinevirtual

Definition at line 49 of file MemMappedPeriph.h.

References etiss::plugin::unimpl_read().

Here is the call graph for this function:

◆ write16()

virtual void etiss::plugin::MemMappedPeriph::write16 ( etiss_uint64  addr,
etiss_uint16  val 
)
inlinevirtual

Definition at line 54 of file MemMappedPeriph.h.

References etiss::plugin::unimpl_write().

Here is the call graph for this function:

◆ write32()

virtual void etiss::plugin::MemMappedPeriph::write32 ( etiss_uint64  addr,
etiss_uint32  val 
)
inlinevirtual

Definition at line 55 of file MemMappedPeriph.h.

References etiss::plugin::unimpl_write().

Here is the call graph for this function:

◆ write64()

virtual void etiss::plugin::MemMappedPeriph::write64 ( etiss_uint64  addr,
etiss_uint64  val 
)
inlinevirtual

Definition at line 56 of file MemMappedPeriph.h.

References etiss::plugin::unimpl_write().

Here is the call graph for this function:

◆ write8()

virtual void etiss::plugin::MemMappedPeriph::write8 ( etiss_uint64  addr,
etiss_uint8  val 
)
inlinevirtual

Definition at line 53 of file MemMappedPeriph.h.

References etiss::plugin::unimpl_write().

Here is the call graph for this function:

Member Data Documentation

◆ customHandle_

CustomHandle etiss::plugin::MemMappedPeriph::customHandle_
private

Definition at line 61 of file MemMappedPeriph.h.

Referenced by getWrapInfo().


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