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

holds etiss::instr::Instruction instances and handles automatic instruction tree creation. More...

#include <Instruction.h>

Inheritance diagram for etiss::instr::InstructionSet:
Inheritance graph
[legend]
Collaboration diagram for etiss::instr::InstructionSet:
Collaboration graph
[legend]

Public Member Functions

 etiss_del_como (InstructionSet) VariableInstructionSet &parent_
 
 InstructionSet (VariableInstructionSet &parent, unsigned width, const std::string &name, unsigned c_size=4)
 
 ~InstructionSet ()
 
Instructionget (const OPCode &key)
 
Instructionopen (const OPCode &key, const std::string &name)
 
Instructioncreate (const OPCode &key, const std::string &name)
 
template<typename T >
Instructionopen (T code, T val, const std::string &name)
 
bool compile ()
 
bool compile (Node *node, BitArray code, Instruction *instr)
 
Instructionresolve (BitArray &instr)
 
Instructionresolve (Node *node, BitArray &instr)
 
std::string print (std::string prefix, bool printunused=false)
 
InstructiongetInvalid ()
 
void foreach (std::function< void(Instruction &)> func)
 
size_t size ()
 
std::string toString () const
 
- Public Member Functions inherited from etiss::ToString
 ToString ()
 
virtual ~ToString ()
 

Public Attributes

const std::string name_
 
const unsigned width_
 
const unsigned chunk_size
 

Private Attributes

std::map< const OPCode *, Instruction *, etiss::instr::lessinstrmap_
 
Node ** root_
 
Instruction invalid
 

Detailed Description

holds etiss::instr::Instruction instances and handles automatic instruction tree creation.

 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 441 of file Instruction.h.

Constructor & Destructor Documentation

◆ InstructionSet()

etiss::instr::InstructionSet::InstructionSet ( VariableInstructionSet parent,
unsigned  width,
const std::string &  name,
unsigned  c_size = 4 
)

Definition at line 351 of file Instruction.cpp.

◆ ~InstructionSet()

etiss::instr::InstructionSet::~InstructionSet ( )

Definition at line 357 of file Instruction.cpp.

References chunk_size, instrmap_, root_, and width_.

Member Function Documentation

◆ compile() [1/2]

bool etiss::instr::InstructionSet::compile ( )

Definition at line 413 of file Instruction.cpp.

References chunk_size, etiss::instr::BitArray::get_range(), instrmap_, etiss::instr::BitArray::permutate(), pow, root_, and width_.

Here is the call graph for this function:

◆ compile() [2/2]

bool etiss::instr::InstructionSet::compile ( Node node,
BitArray  code,
Instruction instr 
)

◆ create()

Instruction * etiss::instr::InstructionSet::create ( const OPCode key,
const std::string &  name 
)

Definition at line 396 of file Instruction.cpp.

References etiss::ERROR, instrmap_, etiss::log(), and etiss::instr::Instruction::opc_.

Referenced by etiss::instr::InstructionGroup::addTo(), and open().

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

◆ etiss_del_como()

etiss::instr::InstructionSet::etiss_del_como ( InstructionSet  ) &

◆ foreach()

void etiss::instr::InstructionSet::foreach ( std::function< void(Instruction &)>  func)

◆ get()

Instruction * etiss::instr::InstructionSet::get ( const OPCode key)

Definition at line 373 of file Instruction.cpp.

References instrmap_.

Referenced by open().

Here is the caller graph for this function:

◆ getInvalid()

Instruction & etiss::instr::InstructionSet::getInvalid ( )

Definition at line 498 of file Instruction.cpp.

References invalid.

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

Here is the caller graph for this function:

◆ open() [1/2]

Instruction & etiss::instr::InstructionSet::open ( const OPCode key,
const std::string &  name 
)

Definition at line 382 of file Instruction.cpp.

References create(), etiss_log, etiss::FATALERROR, and get().

Referenced by open(), and etiss::instr::VariableInstructionSet::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::InstructionSet::open ( code,
val,
const std::string &  name 
)
inline

Definition at line 458 of file Instruction.h.

References open(), and width_.

Here is the call graph for this function:

◆ print()

std::string etiss::instr::InstructionSet::print ( std::string  prefix,
bool  printunused = false 
)

Definition at line 484 of file Instruction.cpp.

References name_, root_, and width_.

Referenced by etiss::instr::VariableInstructionSet::print().

Here is the caller graph for this function:

◆ resolve() [1/2]

Instruction * etiss::instr::InstructionSet::resolve ( BitArray instr)

Definition at line 451 of file Instruction.cpp.

References chunk_size, etiss::instr::BitArray::get_range(), get_metrics::results, and root_.

Referenced by etiss::Translation::disasm(), and etiss::Translation::translateBlock().

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

◆ resolve() [2/2]

Instruction* etiss::instr::InstructionSet::resolve ( Node node,
BitArray instr 
)

◆ size()

size_t etiss::instr::InstructionSet::size ( )

Definition at line 522 of file Instruction.cpp.

References instrmap_.

◆ toString()

std::string etiss::instr::InstructionSet::toString ( ) const
inline

Definition at line 477 of file Instruction.h.

References name_.

Member Data Documentation

◆ chunk_size

const unsigned etiss::instr::InstructionSet::chunk_size

Definition at line 449 of file Instruction.h.

Referenced by compile(), resolve(), and ~InstructionSet().

◆ instrmap_

std::map<const OPCode *, Instruction *, etiss::instr::less> etiss::instr::InstructionSet::instrmap_
private

Definition at line 480 of file Instruction.h.

Referenced by compile(), create(), foreach(), get(), size(), and ~InstructionSet().

◆ invalid

Instruction etiss::instr::InstructionSet::invalid
private

Definition at line 484 of file Instruction.h.

Referenced by getInvalid().

◆ name_

const std::string etiss::instr::InstructionSet::name_

Definition at line 447 of file Instruction.h.

Referenced by print(), and toString().

◆ root_

Node** etiss::instr::InstructionSet::root_
private

Definition at line 482 of file Instruction.h.

Referenced by compile(), print(), resolve(), and ~InstructionSet().

◆ width_

const unsigned etiss::instr::InstructionSet::width_

Definition at line 448 of file Instruction.h.

Referenced by compile(), open(), print(), and ~InstructionSet().


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