ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
|
holds etiss::instr::VariableInstructionSet instances for different modes. More...
#include <Instruction.h>
Public Member Functions | |
VariableInstructionSet * | get (uint32_t mode) |
VariableInstructionSet * | create (uint32_t mode, unsigned width, const std::string &name=std::string()) |
VariableInstructionSet & | open (uint32_t mode, unsigned width, const std::string &name=std::string()) |
template<typename T > | |
Instruction & | open (uint32_t mode, unsigned width, unsigned bits, T code, T mask, const char *instrname) |
uint32_t | getMode (VariableInstructionSet *vis) |
uint32_t | getMode (VariableInstructionSet &vis) |
void | foreach (std::function< void(VariableInstructionSet &)> call) |
bool | compile () |
std::string | print (std::string prefix=std::string()) |
Public Attributes | |
const std::string | archname_ |
Private Attributes | |
std::map< uint32_t, std::string > | modetostring_ |
std::map< std::string, uint32_t > | stringtomode_ |
std::map< uint32_t, VariableInstructionSet * > | vismap_ |
std::map< VariableInstructionSet *, uint32_t > | invvismap_ |
holds etiss::instr::VariableInstructionSet instances for different modes.
The field ETISS_CPU::mode selects the matching VariableInstructionSet from this ModedInstructionSet.
ETISS includes a mode check at the start of a translation block to check if the translated block was compiled with the same mode as the current mode. If the modes mismatch the block will be discarded and translated again.
Location in an instruction translation tree: ModedInstructionSet ↳ VariableInstructionSet (e.g. for mode 0) ↳ InstructionSet (e.g. 32 bit) ↳ Instruction (e.g. LDR, STR) ↳ InstructionSet (e.g. 16 bit)
Definition at line 561 of file Instruction.h.
bool etiss::instr::ModedInstructionSet::compile | ( | ) |
Definition at line 689 of file Instruction.cpp.
References etiss::instr::VariableInstructionSet::compile().
Referenced by etiss::Translation::init(), RV32IMACFDArch::initInstrSet(), and RV64IMACFDArch::initInstrSet().
VariableInstructionSet * etiss::instr::ModedInstructionSet::create | ( | uint32_t | mode, |
unsigned | width, | ||
const std::string & | name = std::string() |
||
) |
Definition at line 631 of file Instruction.cpp.
References etiss::ERROR, etiss_log, invvismap_, get_metrics::mode, and vismap_.
Referenced by open().
void etiss::instr::ModedInstructionSet::foreach | ( | std::function< void(VariableInstructionSet &)> | call | ) |
Definition at line 674 of file Instruction.cpp.
References etiss::ERROR, etiss_log, and vismap_.
Referenced by etiss::CPUArch::finalizeInstrSet(), etiss::plugin::InstructionAccurateCallback::finalizeInstrSet(), etiss::plugin::InstructionSpecificAddressCallback::finalizeInstrSet(), etiss::plugin::PrintInstruction::finalizeInstrSet(), etiss::plugin::VariableValueLogger::finalizeInstrSet(), etiss::plugin::gdb::Server::finalizeInstrSet(), and etiss::DataSheetAccurateTiming::initInstrSet().
VariableInstructionSet * etiss::instr::ModedInstructionSet::get | ( | uint32_t | mode | ) |
Definition at line 624 of file Instruction.cpp.
References get_metrics::mode, and vismap_.
Referenced by etiss::Translation::disasm(), RV32IMACFDArch::initInstrSet(), RV64IMACFDArch::initInstrSet(), open(), and etiss::Translation::translateBlock().
|
inline |
Definition at line 592 of file Instruction.h.
References getMode().
Referenced by getMode().
uint32_t etiss::instr::ModedInstructionSet::getMode | ( | VariableInstructionSet * | vis | ) |
Definition at line 664 of file Instruction.cpp.
References etiss::ERROR, etiss_log, invvismap_, and uint32_t.
Referenced by etiss::DataSheetAccurateTiming::initInstrSet(), and print().
VariableInstructionSet & etiss::instr::ModedInstructionSet::open | ( | uint32_t | mode, |
unsigned | width, | ||
const std::string & | name = std::string() |
||
) |
Definition at line 649 of file Instruction.cpp.
References create(), etiss::ERROR, etiss_log, get(), get_metrics::mode, and etiss::instr::VariableInstructionSet::width_.
Referenced by etiss::instr::InstructionCollection::addTo(), and open().
|
inline |
Definition at line 586 of file Instruction.h.
References get_metrics::mode, open(), and etiss::instr::VariableInstructionSet::open().
std::string etiss::instr::ModedInstructionSet::print | ( | std::string | prefix = std::string() | ) |
Definition at line 697 of file Instruction.cpp.
References archname_, getMode(), etiss::instr::VariableInstructionSet::parent_, and etiss::instr::VariableInstructionSet::print().
Referenced by RV32IMACFDArch::initInstrSet(), and RV64IMACFDArch::initInstrSet().
const std::string etiss::instr::ModedInstructionSet::archname_ |
Definition at line 570 of file Instruction.h.
Referenced by print().
|
private |
Definition at line 567 of file Instruction.h.
|
private |
Definition at line 564 of file Instruction.h.
|
private |
Definition at line 565 of file Instruction.h.
|
private |
Definition at line 566 of file Instruction.h.