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

Contains a small code snipped. More...

#include <CodePart.h>

Collaboration diagram for etiss::CodePart:
Collaboration graph
[legend]

Public Types

enum  TYPE {
  PREINITIALDEBUGRETURNING , INITIALREQUIRED , OPTIONALMIDDLE , APPENDEDREQUIRED ,
  APPENDEDOPTIONAL , APPENDEDRETURNINGREQUIRED
}
 defines position,optionality and the ability to return a code for a CodePart. More...
 

Public Member Functions

 CodePart ()
 
 CodePart (const std::string &code, const RegisterSet &registerDependencies=RegisterSet(), const RegisterSet &affectedRegisters=RegisterSet())
 
RegisterSetgetRegisterDependencies ()
 
RegisterSetgetAffectedRegisters ()
 
std::string & getCode ()
 
std::string & code ()
 
const std::string & code () const
 
const RegisterSetgetRegisterDependencies () const
 
const RegisterSetgetAffectedRegisters () const
 
const std::string & getCode () const
 
const boolfullRegistersDependency () const
 

Private Attributes

std::string code_
 
RegisterSet registerDependencies_
 
RegisterSet affectedRegisters_
 
bool flag_requireAll_
 

Detailed Description

Contains a small code snipped.

usually mulatiple CodeParts are used in a CodeSet to translate on instruction.

Each code part consists of a code snipped (e.g. "cpu->R[1] = cpu->R[2] + 42;") a set of register dependencies (e.g. "R2") and a set of affected registers (e.g. "R1"). CodeParts are assembled in a CodeSet where they can be possitioned in defferent consecutive sections (CodePart::TYPE).

Definition at line 385 of file CodePart.h.

Member Enumeration Documentation

◆ TYPE

defines position,optionality and the ability to return a code for a CodePart.

The order of declaration of these types is also the order of code sections

Only PREINITIALDEBUGRETURNING and APPENDEDRETURNINGREQUIRED may be chosen for CodeParts that contain a return statement (e.g. "return 0;"). If a TYPE contains the sequence OPTIONAL then the affected registers are inspected to decide if the CodePart is needed

Enumerator
PREINITIALDEBUGRETURNING 
INITIALREQUIRED 
OPTIONALMIDDLE 
APPENDEDREQUIRED 
APPENDEDOPTIONAL 
APPENDEDRETURNINGREQUIRED 

Definition at line 395 of file CodePart.h.

Constructor & Destructor Documentation

◆ CodePart() [1/2]

etiss::CodePart::CodePart ( )
inline

Definition at line 404 of file CodePart.h.

◆ CodePart() [2/2]

etiss::CodePart::CodePart ( const std::string &  code,
const RegisterSet registerDependencies = RegisterSet(),
const RegisterSet affectedRegisters = RegisterSet() 
)
inline

Definition at line 405 of file CodePart.h.

Member Function Documentation

◆ code() [1/2]

std::string& etiss::CodePart::code ( )
inline

◆ code() [2/2]

const std::string& etiss::CodePart::code ( ) const
inline

Definition at line 417 of file CodePart.h.

References code_.

◆ fullRegistersDependency()

const bool& etiss::CodePart::fullRegistersDependency ( ) const
inline

Definition at line 421 of file CodePart.h.

References flag_requireAll_.

◆ getAffectedRegisters() [1/2]

RegisterSet& etiss::CodePart::getAffectedRegisters ( )
inline

Definition at line 414 of file CodePart.h.

References affectedRegisters_.

Referenced by etiss::DataSheetAccurateTiming::handleMatch_cycles(), RV32IMACFDArch::initInstrSet(), and RV64IMACFDArch::initInstrSet().

Here is the caller graph for this function:

◆ getAffectedRegisters() [2/2]

const RegisterSet& etiss::CodePart::getAffectedRegisters ( ) const
inline

Definition at line 419 of file CodePart.h.

References affectedRegisters_.

◆ getCode() [1/2]

std::string& etiss::CodePart::getCode ( )
inline

Definition at line 415 of file CodePart.h.

References code_.

◆ getCode() [2/2]

const std::string& etiss::CodePart::getCode ( ) const
inline

Definition at line 420 of file CodePart.h.

References code_.

◆ getRegisterDependencies() [1/2]

RegisterSet& etiss::CodePart::getRegisterDependencies ( )
inline

Definition at line 413 of file CodePart.h.

References registerDependencies_.

Referenced by etiss::plugin::InstructionAccurateCallback::finalizeInstrSet(), and etiss::plugin::VariableValueLogger::finalizeInstrSet().

Here is the caller graph for this function:

◆ getRegisterDependencies() [2/2]

const RegisterSet& etiss::CodePart::getRegisterDependencies ( ) const
inline

Definition at line 418 of file CodePart.h.

References registerDependencies_.

Member Data Documentation

◆ affectedRegisters_

RegisterSet etiss::CodePart::affectedRegisters_
private

Definition at line 426 of file CodePart.h.

Referenced by getAffectedRegisters().

◆ code_

std::string etiss::CodePart::code_
private

Definition at line 424 of file CodePart.h.

Referenced by code(), and getCode().

◆ flag_requireAll_

bool etiss::CodePart::flag_requireAll_
private

Definition at line 427 of file CodePart.h.

Referenced by fullRegistersDependency().

◆ registerDependencies_

RegisterSet etiss::CodePart::registerDependencies_
private

Definition at line 425 of file CodePart.h.

Referenced by getRegisterDependencies().


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