ETISS 0.11.2
ExtendableTranslatingInstructionSetSimulator(version0.11.2)
Loading...
Searching...
No Matches
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

etiss_del_como(ModedInstructionSet) ModedInstructionSet(const std ~ModedInstructionSet ()
 
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 516 of file Instruction.h.

Constructor & Destructor Documentation

◆ ~ModedInstructionSet()

etiss::instr::ModedInstructionSet::~ModedInstructionSet ( )

Definition at line 601 of file Instruction.cpp.

References vismap_.

Member Function Documentation

◆ compile()

bool etiss::instr::ModedInstructionSet::compile ( )

Definition at line 674 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 616 of file Instruction.cpp.

References etiss::ERROR, etiss_log, invvismap_, 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 609 of file Instruction.cpp.

References 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 547 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 649 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 634 of file Instruction.cpp.

References create(), etiss::ERROR, etiss_log, get(), 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 541 of file Instruction.h.

References 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 682 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 525 of file Instruction.h.

Referenced by print().

◆ invvismap_

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

Definition at line 522 of file Instruction.h.

Referenced by create(), and getMode().

◆ modetostring_

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

Definition at line 519 of file Instruction.h.

◆ stringtomode_

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

Definition at line 520 of file Instruction.h.

◆ vismap_

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

Definition at line 521 of file Instruction.h.

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


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