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::ModedInstructionSet Class Reference

holds etiss::instr::VariableInstructionSet instances for different modes. More...

#include <Instruction.h>

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

Public Member Functions

VariableInstructionSetget (uint32_t mode)
 
VariableInstructionSetcreate (uint32_t mode, unsigned width, const std::string &name=std::string())
 
VariableInstructionSetopen (uint32_t mode, unsigned width, const std::string &name=std::string())
 
template<typename T >
Instructionopen (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_tstringtomode_
 
std::map< uint32_t, VariableInstructionSet * > vismap_
 
std::map< VariableInstructionSet *, uint32_tinvvismap_
 

Detailed Description

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:
    ModedInstructionSetVariableInstructionSet (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.

Member Function Documentation

◆ compile()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create()

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

Here is the caller graph for this function:

◆ foreach()

void etiss::instr::ModedInstructionSet::foreach ( std::function< void(VariableInstructionSet &)>  call)

◆ get()

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

Here is the caller graph for this function:

◆ getMode() [1/2]

uint32_t etiss::instr::ModedInstructionSet::getMode ( VariableInstructionSet vis)
inline

Definition at line 592 of file Instruction.h.

References getMode().

Referenced by getMode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMode() [2/2]

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

Here is the caller graph for this function:

◆ open() [1/2]

VariableInstructionSet & etiss::instr::ModedInstructionSet::open ( uint32_t  mode,
unsigned  width,
const std::string &  name = std::string() 
)
Attention
in non debug build a width missmatch will be silently ignored

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ open() [2/2]

template<typename T >
Instruction& etiss::instr::ModedInstructionSet::open ( uint32_t  mode,
unsigned  width,
unsigned  bits,
code,
mask,
const char *  instrname 
)
inline

Definition at line 586 of file Instruction.h.

References get_metrics::mode, open(), and etiss::instr::VariableInstructionSet::open().

Here is the call graph for this function:

◆ print()

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

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ archname_

const std::string etiss::instr::ModedInstructionSet::archname_

Definition at line 570 of file Instruction.h.

Referenced by print().

◆ invvismap_

std::map<VariableInstructionSet *, uint32_t> etiss::instr::ModedInstructionSet::invvismap_
private

Definition at line 567 of file Instruction.h.

Referenced by create(), and getMode().

◆ modetostring_

std::map<uint32_t, std::string> etiss::instr::ModedInstructionSet::modetostring_
private

Definition at line 564 of file Instruction.h.

◆ stringtomode_

std::map<std::string, uint32_t> etiss::instr::ModedInstructionSet::stringtomode_
private

Definition at line 565 of file Instruction.h.

◆ vismap_

std::map<uint32_t, VariableInstructionSet *> etiss::instr::ModedInstructionSet::vismap_
private

Definition at line 566 of file Instruction.h.

Referenced by create(), foreach(), and get().


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