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

this class contains parameters that persist in between instruction lookpus/translation within a translation block. More...

#include <Instruction.h>

Collaboration diagram for etiss::instr::InstructionContext:
Collaboration graph
[legend]

Public Member Functions

 etiss_del_como (InstructionContext) inline InstructionContext()
 instruction context is initialized by etiss::Translation class More...
 
unsigned & ufield (std::string name)
 
template<typename T >
uint64_tufield (const T &plugin, std::string name)
 returns a persistent field More...
 

Public Attributes

bool is_not_default_width_
 if true the this instruction is not as long as the width of the variable instruction set More...
 
unsigned instr_width_
 
bool instr_width_fully_evaluated_
 if true the length_updater_ function will be called again after instr_width_ bits are available More...
 
bool force_append_next_instr_
 if true then the block will continue with the next instruction and cannot be terminated More...
 
bool force_block_end_
 if true then the block ends after the current instruction. More...
 
uint64_t current_address_
 start address of current instruction More...
 
uint64_t current_local_address_
 address within the current block More...
 
unsigned cf_delay_slot_
 

Private Attributes

std::map< std::string, unsigned > ufields_
 additional fields that can be used by any plugin/architecture. More...
 
std::map< void *, std::map< std::string, uint64_t > > lufields_
 additonal fields that are local (private) to a plugin/architecture. More...
 

Detailed Description

this class contains parameters that persist in between instruction lookpus/translation within a translation block.

the instruction context passed is guaranteed to have been passed to all previous instruction lookups in order.

the or1k architecture implementaion for example uses this class to store information about a delay slot instruction and forces the translaton block to newver separate jump and delay slot instructions

if an architecture needs to pass additional information in between instruction translations the ufield function can be used to create additional variables. such variable names should alway be prefixed with a unique string to avoid collision with plugins

Definition at line 336 of file Instruction.h.

Member Function Documentation

◆ etiss_del_como()

etiss::instr::InstructionContext::etiss_del_como ( InstructionContext  )
inline

instruction context is initialized by etiss::Translation class

Definition at line 340 of file Instruction.h.

◆ ufield() [1/2]

template<typename T >
uint64_t& etiss::instr::InstructionContext::ufield ( const T &  plugin,
std::string  name 
)
inline

returns a persistent field

Parameters
pluginshould always be the plugin to which the field belongs. Should almost always be (*this).

Definition at line 362 of file Instruction.h.

References lufields_.

◆ ufield() [2/2]

unsigned & etiss::instr::InstructionContext::ufield ( std::string  name)

Definition at line 261 of file Instruction.cpp.

References ufields_.

Member Data Documentation

◆ cf_delay_slot_

unsigned etiss::instr::InstructionContext::cf_delay_slot_

Definition at line 372 of file Instruction.h.

Referenced by etiss::Translation::translateBlock().

◆ current_address_

uint64_t etiss::instr::InstructionContext::current_address_

◆ current_local_address_

uint64_t etiss::instr::InstructionContext::current_local_address_

address within the current block

Definition at line 367 of file Instruction.h.

Referenced by etiss::Translation::translateBlock().

◆ force_append_next_instr_

bool etiss::instr::InstructionContext::force_append_next_instr_

if true then the block will continue with the next instruction and cannot be terminated

Definition at line 351 of file Instruction.h.

Referenced by etiss::Translation::translateBlock().

◆ force_block_end_

bool etiss::instr::InstructionContext::force_block_end_

if true then the block ends after the current instruction.

will be overridden by force_append_next_instr_

Definition at line 353 of file Instruction.h.

Referenced by etiss::Translation::translateBlock().

◆ instr_width_

unsigned etiss::instr::InstructionContext::instr_width_

◆ instr_width_fully_evaluated_

bool etiss::instr::InstructionContext::instr_width_fully_evaluated_

if true the length_updater_ function will be called again after instr_width_ bits are available

Definition at line 349 of file Instruction.h.

Referenced by RV32IMACFDArch::initInstrSet(), RV64IMACFDArch::initInstrSet(), and etiss::Translation::translateBlock().

◆ is_not_default_width_

bool etiss::instr::InstructionContext::is_not_default_width_

if true the this instruction is not as long as the width of the variable instruction set

Definition at line 346 of file Instruction.h.

Referenced by RV32IMACFDArch::initInstrSet(), RV64IMACFDArch::initInstrSet(), and etiss::Translation::translateBlock().

◆ lufields_

std::map<void *, std::map<std::string, uint64_t> > etiss::instr::InstructionContext::lufields_
private

additonal fields that are local (private) to a plugin/architecture.

Definition at line 378 of file Instruction.h.

Referenced by ufield().

◆ ufields_

std::map<std::string, unsigned> etiss::instr::InstructionContext::ufields_
private

additional fields that can be used by any plugin/architecture.

field names must consider this (as in: use descriptive,long names).

Definition at line 375 of file Instruction.h.

Referenced by ufield().


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