ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TracePrinter Class Reference

A simple logger dedicated to print PC trace. More...

#include <TracePrinter.h>

Inheritance diagram for TracePrinter:
Inheritance graph
[legend]
Collaboration diagram for TracePrinter:
Collaboration graph
[legend]

Public Member Functions

 TracePrinter (etiss::uint32 terminateAddr, bool printOnScreen=false, char terminateHit=1)
 
 ~TracePrinter ()
 
etiss::int32 execute ()
 called before a block and may act in the same way as a block More...
 
std::string _getPluginName () const
 
void init (ETISS_CPU *cpu, ETISS_System *system, etiss::CPUArch *arch)
 this function is called before the plugin is used in the cpu execution loop (etiss::CPUCore::execute). More...
 
void cleanup ()
 this function is called after cpu execution loop (etiss::CPUCore::execute) finished. More...
 
- Public Member Functions inherited from etiss::CoroutinePlugin
 CoroutinePlugin ()
 
virtual ~CoroutinePlugin ()
 
virtual void executionEnd (int32_t code)
 called when the simulation ends but before any deinitialization is done More...
 
virtual bool isActive ()
 indicates if the plugin will do something in execution loop. More...
 
- 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 Member Functions

void printLog ()
 

Private Attributes

ETISS_CPUcpu_
 
ETISS_Systemsystem_
 
etiss::CPUArcharch_
 
std::stringstream pcTrace_
 
char hitTimes_ = 0
 
bool printOnScreen_
 
const etiss::uint32 terminateAddr_
 
const char terminateHit_
 

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)
 
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

A simple logger dedicated to print PC trace.

Most accurate when etiss.max_block_size in ETISS.ini is set to 1.

Parameters
terminateAddrTerminate simulation when hit certain address
[Optional]printOnScreen: Print PC on screen if true
[Optional]terminateAddr:Terminate simulation only when hit the address *terminateHit* times.

Definition at line 60 of file TracePrinter.h.

Constructor & Destructor Documentation

◆ TracePrinter()

TracePrinter::TracePrinter ( etiss::uint32  terminateAddr,
bool  printOnScreen = false,
char  terminateHit = 1 
)
inline

Definition at line 64 of file TracePrinter.h.

◆ ~TracePrinter()

TracePrinter::~TracePrinter ( )
inline

Definition at line 70 of file TracePrinter.h.

References printLog().

Here is the call graph for this function:

Member Function Documentation

◆ _getPluginName()

std::string TracePrinter::_getPluginName ( ) const
inlinevirtual

Implements etiss::Plugin.

Definition at line 89 of file TracePrinter.h.

◆ cleanup()

void TracePrinter::cleanup ( )
inlinevirtual

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

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

Reimplemented from etiss::Plugin.

Definition at line 98 of file TracePrinter.h.

References arch_, cpu_, and system_.

◆ execute()

etiss::int32 TracePrinter::execute ( )
inlinevirtual

called before a block and may act in the same way as a block

Implements etiss::CoroutinePlugin.

Definition at line 72 of file TracePrinter.h.

References cpu_, hitTimes_, ETISS_CPU::instructionPointer, etiss::mm::NOERROR, pcTrace_, printLog(), printOnScreen_, terminateAddr_, and terminateHit_.

Here is the call graph for this function:

◆ init()

void TracePrinter::init ( ETISS_CPU cpu,
ETISS_System system,
etiss::CPUArch arch 
)
inlinevirtual

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 from etiss::Plugin.

Definition at line 91 of file TracePrinter.h.

References arch_, cpu_, and system_.

◆ printLog()

void TracePrinter::printLog ( )
inlineprivate

Definition at line 116 of file TracePrinter.h.

References pcTrace_.

Referenced by execute(), and ~TracePrinter().

Here is the caller graph for this function:

Member Data Documentation

◆ arch_

etiss::CPUArch* TracePrinter::arch_
private

Definition at line 108 of file TracePrinter.h.

Referenced by cleanup(), and init().

◆ cpu_

ETISS_CPU* TracePrinter::cpu_
private

Definition at line 106 of file TracePrinter.h.

Referenced by cleanup(), execute(), and init().

◆ hitTimes_

char TracePrinter::hitTimes_ = 0
private

Definition at line 111 of file TracePrinter.h.

Referenced by execute().

◆ pcTrace_

std::stringstream TracePrinter::pcTrace_
private

Definition at line 110 of file TracePrinter.h.

Referenced by execute(), and printLog().

◆ printOnScreen_

bool TracePrinter::printOnScreen_
private

Definition at line 112 of file TracePrinter.h.

Referenced by execute().

◆ system_

ETISS_System* TracePrinter::system_
private

Definition at line 107 of file TracePrinter.h.

Referenced by cleanup(), and init().

◆ terminateAddr_

const etiss::uint32 TracePrinter::terminateAddr_
private

Definition at line 113 of file TracePrinter.h.

Referenced by execute().

◆ terminateHit_

const char TracePrinter::terminateHit_
private

Definition at line 114 of file TracePrinter.h.

Referenced by execute().


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