ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
|
holds information and translation callbacks for an instruction. More...
#include <Instruction.h>
Public Member Functions | |
Instruction (const OPCode &opc, const std::string &name) | |
template<typename T , typename = typename std::enable_if<std::is_integral<T>::value, T>::type> | |
Instruction (unsigned width, const T code, const T mask, const std::string &name) | |
virtual std::string | print (std::string indent, I pos, unsigned pfillwidth, bool printunused=false) |
bool | addCallback (std::function< bool(BitArray &, etiss::CodeSet &, InstructionContext &)> callback, uint32_t builtinGroups, const std::set< uint32_t > &groups=std::set< uint32_t >()) |
bool | translate (BitArray &, CodeSet &cs, InstructionContext &context) |
uint32_t & | presentBuiltinGroups () |
std::set< uint32_t > & | presentGroups () |
std::string | printASM (BitArray &) |
void | setASMPrinter (std::function< std::string(BitArray &, Instruction &)> printer) |
std::string | toString () const |
Public Member Functions inherited from etiss::ToString | |
ToString () | |
virtual | ~ToString () |
Static Public Member Functions | |
static std::string | printASMSimple (BitArray &ba, Instruction &instr) |
Public Attributes | |
etiss_del_como(Instruction) enum class BUILTINGROUP const BitArray::size_type | width |
const OPCode | opc_ |
const std::string | name_ |
Private Attributes | |
std::list< std::tuple< std::function< bool(BitArray &, etiss::CodeSet &, InstructionContext &)>, uint32_t, std::set< uint32_t > > > | callbacks_ |
uint32_t | builtinGroups_ |
std::set< uint32_t > | groups_ |
std::function< std::string(BitArray &, Instruction &)> | printer_ |
holds information and translation callbacks for an instruction.
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 392 of file Instruction.h.
etiss::instr::Instruction::Instruction | ( | const OPCode & | opc, |
const std::string & | name | ||
) |
Definition at line 266 of file Instruction.cpp.
|
inline |
Definition at line 416 of file Instruction.h.
bool etiss::instr::Instruction::addCallback | ( | std::function< bool(BitArray &, etiss::CodeSet &, InstructionContext &)> | callback, |
uint32_t | builtinGroups, | ||
const std::set< uint32_t > & | groups = std::set<uint32_t>() |
||
) |
Definition at line 284 of file Instruction.cpp.
References builtinGroups_, callbacks_, groups_, etiss::log(), uint32_t, and etiss::VERBOSE.
Referenced by etiss::instr::InstructionDefinition::addTo(), etiss::plugin::InstructionAccurateCallback::finalizeInstrSet(), etiss::plugin::InstructionSpecificAddressCallback::finalizeInstrSet(), etiss::plugin::PrintInstruction::finalizeInstrSet(), etiss::plugin::VariableValueLogger::finalizeInstrSet(), etiss::DataSheetAccurateTiming::handleMatch_cycles(), RV32IMACFDArch::initInstrSet(), RV64IMACFDArch::initInstrSet(), and Server_finalizeInstrSet().
uint32_t & etiss::instr::Instruction::presentBuiltinGroups | ( | ) |
Definition at line 330 of file Instruction.cpp.
References builtinGroups_.
Referenced by CPUArch_finalizeInstrSet().
std::set< uint32_t > & etiss::instr::Instruction::presentGroups | ( | ) |
Definition at line 334 of file Instruction.cpp.
References groups_.
|
virtual |
Definition at line 277 of file Instruction.cpp.
References name_.
std::string etiss::instr::Instruction::printASM | ( | BitArray & | ba | ) |
Definition at line 339 of file Instruction.cpp.
References printer_.
Referenced by etiss::Translation::disasm(), and etiss::plugin::PrintInstruction::finalizeInstrSet().
|
static |
Definition at line 270 of file Instruction.cpp.
References name_.
Referenced by setASMPrinter().
void etiss::instr::Instruction::setASMPrinter | ( | std::function< std::string(BitArray &, Instruction &)> | printer | ) |
Definition at line 344 of file Instruction.cpp.
References printASMSimple(), and printer_.
Referenced by etiss::instr::InstructionDefinition::addTo().
|
inline |
Definition at line 428 of file Instruction.h.
References name_.
bool etiss::instr::Instruction::translate | ( | BitArray & | ba, |
CodeSet & | cs, | ||
InstructionContext & | context | ||
) |
Definition at line 320 of file Instruction.cpp.
References callbacks_.
Referenced by etiss::Translation::translateBlock().
|
private |
Definition at line 397 of file Instruction.h.
Referenced by addCallback(), and presentBuiltinGroups().
|
private |
Definition at line 396 of file Instruction.h.
Referenced by addCallback(), and translate().
|
private |
Definition at line 398 of file Instruction.h.
Referenced by addCallback(), and presentGroups().
const std::string etiss::instr::Instruction::name_ |
Definition at line 410 of file Instruction.h.
Referenced by print(), printASMSimple(), and toString().
const OPCode etiss::instr::Instruction::opc_ |
Definition at line 409 of file Instruction.h.
Referenced by etiss::instr::InstructionDefinition::addTo(), and etiss::instr::InstructionSet::create().
|
private |
Definition at line 399 of file Instruction.h.
Referenced by printASM(), and setASMPrinter().
etiss_del_como (Instruction) enum class BUILTINGROUP const BitArray::size_type etiss::instr::Instruction::width |
Definition at line 408 of file Instruction.h.