|
ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
|
#include <Timing.h>


Classes | |
| struct | Rule |
Public Member Functions | |
| void | addRule (std::function< bool(uint32_t)> matchesMode, std::function< bool(unsigned)> matchesWidth, std::function< bool(etiss::instr::Instruction &)> matchesInstr, std::function< void(etiss::instr::Instruction &)> handleMatch) |
| this is the main add rule function. | |
| void | addRule (const std::tuple< uint32_t, unsigned, const char *, std::function< void(etiss::instr::Instruction &)> > &tuple) |
| adds a rule for the given mode,width and instruction name | |
| void | addRule (const std::tuple< std::regex, std::regex, std::regex, std::function< void(etiss::instr::Instruction &)> > &tuple) |
| adds a rule that uses regular expressions to match mode,width and instruction name | |
| void | addRule (const std::tuple< std::regex, std::regex, std::regex, void(*)(etiss::instr::Instruction &)> &tuple) |
| template<typename... T> | |
| DataSheetAccurateTiming (const std::string &name, const T &...rules) | |
| virtual | ~DataSheetAccurateTiming () |
| virtual void | initInstrSet (etiss::instr::ModedInstructionSet &) const |
| performs lookups for instructions that are in the modded instruction set to add timing code (e.g. | |
Public Member Functions inherited from etiss::TranslationPlugin | |
| TranslationPlugin () | |
| virtual | ~TranslationPlugin () |
| virtual void | finalizeInstrSet (etiss::instr::ModedInstructionSet &) const |
| called after all instructions have been added to allow last changes | |
| virtual void | initCodeBlock (etiss::CodeBlock &) const |
| called before instructions are translated for the code block | |
| virtual void | finalizeCodeBlock (etiss::CodeBlock &) const |
| called after all instructions have been translated for the code block | |
| virtual void * | getPluginHandle () |
| called to get the handle that is available in translated code via getPoinerCode(). [default: this] | |
Public Member Functions inherited from etiss::Plugin | |
| virtual | ~Plugin () |
| unsigned | getType () |
| InterruptListenerPlugin * | getInterruptListenerPlugin () |
| CoroutinePlugin * | getCoroutinePlugin () |
| SystemWrapperPlugin * | getSystemWrapperPlugin () |
| RegisterDevicePlugin * | getRegisterDevicePlugin () |
| TranslationPlugin * | getTranslationPlugin () |
| std::string | getPluginName () const |
| const std::string & | getLastAssignedCoreName () |
| std::string | toString () const |
Public Member Functions inherited from etiss::ToString | |
| ToString () | |
| virtual | ~ToString () |
Static Public Member Functions | |
| template<unsigned cycles, bool isNotAdditionalTime = true> | |
| static void | handleMatch_cycles (etiss::instr::Instruction &instr) |
| simple template function that adds the given number of cycles to the cpu time if the related rule matches if isNotAdditionalTime is true then this handler will signal that no other main timing rules need to be applied. | |
Public Attributes | |
| const std::string | name_ |
Protected Member Functions | |
| std::string | _getPluginName () const |
Protected Member Functions inherited from etiss::TranslationPlugin | |
| std::string | getPointerCode () const |
| returns a C code expression that allows to get or assign a pointer to the variable assigned to this translation plugin. | |
Protected Member Functions inherited from etiss::Plugin | |
| Plugin (unsigned type=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). | |
| virtual void | cleanup () |
| this function is called after cpu execution loop (etiss::CPUCore::execute) finished. | |
| void | setCorrespondingCPUCoreName (std::string name) |
| virtual void | addedToCPUCore (etiss::CPUCore *core) |
| called as soon a plugin has been added to its CPUCore. | |
| virtual void | removedFromCPUCore (etiss::CPUCore *core) |
| called as soon a plugin has been removed from its CPUCore. | |
Private Member Functions | |
| void | ctor_hlpr () |
| terminates recursion | |
| template<typename A , typename... T> | |
| void | ctor_hlpr (const A &arg, const T &...rules) |
| handles the argument list passed to the template constructor | |
Private Attributes | |
| std::list< Rule * > | rules_ |
Additional Inherited Members | |
Static Public Attributes inherited from etiss::Plugin | |
| static const unsigned | INTERRUPTLISTENER = 1 << 0 |
| access to translated code | |
| static const unsigned | COROUTINE = 1 << 1 |
| callback after execution of each translated block | |
| static const unsigned | SYSTEMWRAPPER = 1 << 2 |
| can wrap/change ETISS_System structure at execution start | |
| static const unsigned | REGISTERDEVICE |
| gets noticed of changes to special registers (e.g. mmu register etc. [depends on architecture]) | |
| static const unsigned | TRANSLATION |
| access to translated code during translation phase or when instruction tree is built | |
Protected Attributes inherited from etiss::Plugin | |
| ETISS_CPU * | plugin_cpu_ |
| holds a pointer to the cpu structure. will be set before init call and after cleanup call | |
| ETISS_System * | plugin_system_ |
| holds a pointer to the system structure. | |
| CPUArch * | plugin_arch_ |
| holds a pointer to the CPUArch instance. will be set before init call and after cleanup call | |
| CPUCore * | plugin_core_ |
| holds a pointer to the associated CPUCore instance. | |
|
inline |
Definition at line 113 of file Timing.h.
References ctor_hlpr().

|
virtual |
Definition at line 78 of file Timing.cpp.
References rules_.
|
inlineprotectedvirtual |
| void etiss::DataSheetAccurateTiming::addRule | ( | const std::tuple< std::regex, std::regex, std::regex, std::function< void(etiss::instr::Instruction &)> > & | tuple | ) |
adds a rule that uses regular expressions to match mode,width and instruction name
Definition at line 64 of file Timing.cpp.
References addRule(), etiss::toString(), and uint32_t.

|
inline |
| void etiss::DataSheetAccurateTiming::addRule | ( | const std::tuple< uint32_t, unsigned, const char *, std::function< void(etiss::instr::Instruction &)> > & | tuple | ) |
adds a rule for the given mode,width and instruction name
Definition at line 51 of file Timing.cpp.
References addRule(), and uint32_t.

| void etiss::DataSheetAccurateTiming::addRule | ( | std::function< bool(uint32_t)> | matchesMode, |
| std::function< bool(unsigned)> | matchesWidth, | ||
| std::function< bool(etiss::instr::Instruction &)> | matchesInstr, | ||
| std::function< void(etiss::instr::Instruction &)> | handleMatch | ||
| ) |
this is the main add rule function.
any other addRule function must map to this
Definition at line 13 of file Timing.cpp.
References etiss::DataSheetAccurateTiming::Rule::handler, etiss::DataSheetAccurateTiming::Rule::instr, etiss::log(), etiss::DataSheetAccurateTiming::Rule::mode, rules_, uint32_t, etiss::WARNING, and etiss::DataSheetAccurateTiming::Rule::width.
Referenced by addRule(), addRule(), addRule(), and ctor_hlpr().


|
inlineprivate |
terminates recursion
Definition at line 101 of file Timing.h.
Referenced by ctor_hlpr(), and DataSheetAccurateTiming().

|
inlineprivate |
handles the argument list passed to the template constructor
Definition at line 104 of file Timing.h.
References addRule(), and ctor_hlpr().

|
inlinestatic |
simple template function that adds the given number of cycles to the cpu time if the related rule matches if isNotAdditionalTime is true then this handler will signal that no other main timing rules need to be applied.
usually this should prevent the CPUArch implementation from adding the default timing
Definition at line 72 of file Timing.h.
References etiss::instr::Instruction::addCallback(), etiss::CodePart::code(), etiss::CodePart::getAffectedRegisters(), etiss::CodePart::INITIALREQUIRED, etiss::CodeSet::prepend(), etiss::toString(), and uint32_t.

|
virtual |
performs lookups for instructions that are in the modded instruction set to add timing code (e.g.
"cpu->cpuTime_ps += X * cpu->cycleTime_ps;")
TODO? pass mode parameter in foreach/ store mode with vis
Reimplemented from etiss::TranslationPlugin.
Definition at line 87 of file Timing.cpp.
References etiss::instr::InstructionSet::foreach(), etiss::instr::VariableInstructionSet::foreach(), etiss::instr::ModedInstructionSet::foreach(), etiss::instr::ModedInstructionSet::getMode(), etiss::DataSheetAccurateTiming::Rule::mode, etiss::instr::VariableInstructionSet::parent_, rules_, uint32_t, etiss::DataSheetAccurateTiming::Rule::width, and etiss::instr::InstructionSet::width_.

| const std::string etiss::DataSheetAccurateTiming::name_ |
Definition at line 111 of file Timing.h.
Referenced by _getPluginName().
|
private |
Definition at line 129 of file Timing.h.
Referenced by addRule(), initInstrSet(), and ~DataSheetAccurateTiming().