OpenASIP
2.0
|
#include <InstructionMemory.hh>
Public Types | |
typedef std::vector< ExecutableInstruction * > | InstructionContainer |
Container for instructions. More... | |
Public Member Functions | |
InstructionMemory (InstructionAddress startAddress) | |
virtual | ~InstructionMemory () |
void | addExecutableInstruction (InstructionAddress addr, ExecutableInstruction *instruction) |
void | addImplicitExecutableInstruction (InstructionAddress addr, ExecutableInstruction *instruction) |
ExecutableInstruction & | instructionAt (InstructionAddress address) |
const ExecutableInstruction & | instructionAtConst (InstructionAddress address) const |
void | resetExecutionCounts () |
bool | hasInstructionAt (InstructionAddress addr) const |
bool | hasImplicitInstructionsAt (InstructionAddress addr) const |
const InstructionContainer & | implicitInstructionsAt (InstructionAddress addr) const |
Private Member Functions | |
InstructionMemory (const InstructionMemory &) | |
Copying not allowed. More... | |
InstructionMemory & | operator= (const InstructionMemory &) |
Assignment not allowed. More... | |
Private Attributes | |
InstructionAddress | startAddress_ |
The starting address of the instruction memory address space. More... | |
InstructionContainer | instructions_ |
All the instructions of the memory. More... | |
InstructionContainer | emptyInstructions_ |
std::map< InstructionAddress, ExecutableInstruction * > | instructionMap_ |
Stores the explicit instruction addresses. More... | |
std::map< InstructionAddress, InstructionContainer * > | implicitInstructions_ |
Stores implicit instructions that should be executed after the explicit one in the same address. More... | |
Container for ExecutableInstructions which represent the actions performed by the simulated program's instructions to the machine's state.
Definition at line 54 of file InstructionMemory.hh.
typedef std::vector<ExecutableInstruction*> InstructionMemory::InstructionContainer |
Container for instructions.
Definition at line 57 of file InstructionMemory.hh.
InstructionMemory::InstructionMemory | ( | InstructionAddress | startAddress | ) |
Constructor.
This constructor is for constant width instructions only.
startAddress | The starting address of the instruction memory. |
Definition at line 47 of file InstructionMemory.cc.
|
virtual |
Destructor.
Definition at line 55 of file InstructionMemory.cc.
References implicitInstructions_, and instructions_.
|
private |
Copying not allowed.
void InstructionMemory::addExecutableInstruction | ( | InstructionAddress | addr, |
ExecutableInstruction * | instruction | ||
) |
Adds new ExecutableInstruction to memory.
instruction | Instruction to be added. |
Definition at line 76 of file InstructionMemory.cc.
References instructionMap_, and instructions_.
Referenced by SimProgramBuilder::build().
void InstructionMemory::addImplicitExecutableInstruction | ( | InstructionAddress | addr, |
ExecutableInstruction * | instruction | ||
) |
Adds an "implicit instruction" used to simulate effects triggered by operation-triggered instructions as side-effects, but which are not controlled by the programmer.
Should be added after the explicit instruction in the order of how the effects should be done.
Definition at line 92 of file InstructionMemory.cc.
References implicitInstructions_.
Referenced by SimProgramBuilder::build().
bool InstructionMemory::hasImplicitInstructionsAt | ( | InstructionAddress | addr | ) | const |
Definition at line 123 of file InstructionMemory.cc.
References implicitInstructions_.
Referenced by OTASimulationController::simulateCycle().
bool InstructionMemory::hasInstructionAt | ( | InstructionAddress | addr | ) | const |
Returns true in case there is an implicit or explicit instruction at the given address.
Definition at line 117 of file InstructionMemory.cc.
References instructionMap_.
Referenced by OTASimulationController::simulateCycle().
const InstructionMemory::InstructionContainer & InstructionMemory::implicitInstructionsAt | ( | InstructionAddress | addr | ) | const |
Definition at line 128 of file InstructionMemory.cc.
References emptyInstructions_, and implicitInstructions_.
Referenced by SimulationStatistics::calculate(), and OTASimulationController::simulateCycle().
ExecutableInstruction& InstructionMemory::instructionAt | ( | InstructionAddress | address | ) |
Referenced by OTASimulationController::simulateCycle().
const ExecutableInstruction& InstructionMemory::instructionAtConst | ( | InstructionAddress | address | ) | const |
|
private |
Assignment not allowed.
void InstructionMemory::resetExecutionCounts | ( | ) |
Resets execution counters of all instructions.
Definition at line 105 of file InstructionMemory.cc.
References instructions_.
|
private |
Definition at line 90 of file InstructionMemory.hh.
Referenced by implicitInstructionsAt().
|
private |
Stores implicit instructions that should be executed after the explicit one in the same address.
Definition at line 98 of file InstructionMemory.hh.
Referenced by addImplicitExecutableInstruction(), hasImplicitInstructionsAt(), implicitInstructionsAt(), and ~InstructionMemory().
|
private |
Stores the explicit instruction addresses.
Definition at line 95 of file InstructionMemory.hh.
Referenced by addExecutableInstruction(), and hasInstructionAt().
|
private |
All the instructions of the memory.
Definition at line 88 of file InstructionMemory.hh.
Referenced by addExecutableInstruction(), resetExecutionCounts(), and ~InstructionMemory().
|
private |
The starting address of the instruction memory address space.
Definition at line 85 of file InstructionMemory.hh.