OpenASIP  2.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ExecutableInstruction Class Reference

#include <ExecutableInstruction.hh>

Collaboration diagram for ExecutableInstruction:
Collaboration graph

Public Member Functions

 ExecutableInstruction ()
 
virtual ~ExecutableInstruction ()
 
void addExecutableMove (ExecutableMove *move)
 
void addLongImmediateUpdateAction (LongImmUpdateAction *action)
 
void execute ()
 
ClockCycleCount executionCount () const
 
ClockCycleCount moveExecutionCount (std::size_t moveIndex) const
 
void resetExecutionCounts ()
 
bool moveSquashed (std::size_t moveIndex) const
 
void setExitPoint (bool b)
 
bool isExitPoint () const
 

Private Types

typedef std::vector< ExecutableMove * > MoveContainer
 Contains ExecutableMoves. More...
 
typedef std::vector< LongImmUpdateAction * > UpdateContainer
 Contains long immediate update actions. More...
 

Private Member Functions

 ExecutableInstruction (const ExecutableInstruction &)
 Copying not allowed. More...
 
ExecutableInstructionoperator= (const ExecutableInstruction &)
 Assignment not allowed. More...
 

Private Attributes

MoveContainer moves_
 All moves of the instruction. More...
 
UpdateContainer updateActions_
 All long immediate update actions. More...
 
ClockCycleCount executionCount_
 The count of times this instruction has been executed. More...
 
bool exitPoint_
 True in case the instruction is considered a program exit point. More...
 

Detailed Description

Represents an interpreted TTA instruction.

This class is used to simulate the data transports performed by a TTA instruction.

Definition at line 49 of file ExecutableInstruction.hh.

Member Typedef Documentation

◆ MoveContainer

Contains ExecutableMoves.

Definition at line 74 of file ExecutableInstruction.hh.

◆ UpdateContainer

Contains long immediate update actions.

Definition at line 76 of file ExecutableInstruction.hh.

Constructor & Destructor Documentation

◆ ExecutableInstruction() [1/2]

ExecutableInstruction::ExecutableInstruction ( )

Constructor.

Definition at line 42 of file ExecutableInstruction.cc.

42  :
43  exitPoint_(false) {
45 }

References resetExecutionCounts().

Here is the call graph for this function:

◆ ~ExecutableInstruction()

ExecutableInstruction::~ExecutableInstruction ( )
virtual

Destructor.

Definition at line 50 of file ExecutableInstruction.cc.

References SequenceTools::deleteAllItems(), moves_, and updateActions_.

Here is the call graph for this function:

◆ ExecutableInstruction() [2/2]

ExecutableInstruction::ExecutableInstruction ( const ExecutableInstruction )
private

Copying not allowed.

Member Function Documentation

◆ addExecutableMove()

void ExecutableInstruction::addExecutableMove ( ExecutableMove move)

Adds move to the instruction.

Moves must be added in the same order they are in source Program model's instruction.

Parameters
moveMove to be added.

Definition at line 64 of file ExecutableInstruction.cc.

64  {
65  moves_.push_back(move);
66 }

References moves_.

Referenced by CompiledSimUtilizationStats::calculate(), and SimProgramBuilder::processInstruction().

◆ addLongImmediateUpdateAction()

void ExecutableInstruction::addLongImmediateUpdateAction ( LongImmUpdateAction action)

Adds long immediate update action.

Parameters
actionAction to be added.

Definition at line 74 of file ExecutableInstruction.cc.

75  {
76  updateActions_.push_back(action);
77 }

References updateActions_.

Referenced by SimProgramBuilder::processInstruction().

◆ execute()

void ExecutableInstruction::execute ( )

◆ executionCount()

ClockCycleCount ExecutableInstruction::executionCount ( ) const

Returns the count of times this instruction has been executed so far.

Returns
The execution count of this instruction.

Definition at line 85 of file ExecutableInstruction.cc.

85  {
86  return executionCount_;
87 }

References executionCount_.

Referenced by SimulationStatistics::calculate(), SimulatorFrontend::finishSimulation(), RFAccessTracker::handleEvent(), DisasmTopCountAttrProvider::moveCellAttr(), DesignSpaceExplorer::simulate(), and DisasmTopCountAttrProvider::updateTopCountTable().

◆ isExitPoint()

bool ExecutableInstruction::isExitPoint ( ) const

◆ moveExecutionCount()

ClockCycleCount ExecutableInstruction::moveExecutionCount ( std::size_t  moveIndex) const

Returns the count of full executions so far of move at given index.

Squashed moves are not included in the count. Thus, to get count of times a move has be squashed, one should get the instruction execution count and subsract the move's execution count from it.

Returns
Count of executions of move at given move slot.

Definition at line 110 of file ExecutableInstruction.cc.

110  {
111  return moves_[moveIndex]->executionCount();
112 }

References moves_.

Referenced by UtilizationStats::calculateForInstruction(), and DisasmExecPercentageAttrProvider::moveCellAttr().

◆ moveSquashed()

bool ExecutableInstruction::moveSquashed ( std::size_t  moveIndex) const

◆ operator=()

ExecutableInstruction& ExecutableInstruction::operator= ( const ExecutableInstruction )
private

Assignment not allowed.

◆ resetExecutionCounts()

void ExecutableInstruction::resetExecutionCounts ( )

Resets the execution counters of this instruction and its moves.

Definition at line 93 of file ExecutableInstruction.cc.

93  {
94  executionCount_ = 0;
95  for (std::size_t i = 0; i < moves_.size(); ++i) {
96  moves_[i]->resetExecutionCount();
97  }
98 }

References executionCount_, and moves_.

Referenced by ExecutableInstruction().

◆ setExitPoint()

void ExecutableInstruction::setExitPoint ( bool  b)

Member Data Documentation

◆ executionCount_

ClockCycleCount ExecutableInstruction::executionCount_
private

The count of times this instruction has been executed.

Definition at line 82 of file ExecutableInstruction.hh.

Referenced by executionCount(), and resetExecutionCounts().

◆ exitPoint_

bool ExecutableInstruction::exitPoint_
private

True in case the instruction is considered a program exit point.

Definition at line 84 of file ExecutableInstruction.hh.

◆ moves_

MoveContainer ExecutableInstruction::moves_
private

All moves of the instruction.

Definition at line 78 of file ExecutableInstruction.hh.

Referenced by addExecutableMove(), moveExecutionCount(), resetExecutionCounts(), and ~ExecutableInstruction().

◆ updateActions_

UpdateContainer ExecutableInstruction::updateActions_
private

All long immediate update actions.

Definition at line 80 of file ExecutableInstruction.hh.

Referenced by addLongImmediateUpdateAction(), and ~ExecutableInstruction().


The documentation for this class was generated from the following files:
SequenceTools::deleteAllItems
static void deleteAllItems(SequenceType &aSequence)
ExecutableInstruction::updateActions_
UpdateContainer updateActions_
All long immediate update actions.
Definition: ExecutableInstruction.hh:80
ExecutableInstruction::resetExecutionCounts
void resetExecutionCounts()
Definition: ExecutableInstruction.cc:93
ExecutableInstruction::moves_
MoveContainer moves_
All moves of the instruction.
Definition: ExecutableInstruction.hh:78
ExecutableInstruction::executionCount_
ClockCycleCount executionCount_
The count of times this instruction has been executed.
Definition: ExecutableInstruction.hh:82
ExecutableInstruction::exitPoint_
bool exitPoint_
True in case the instruction is considered a program exit point.
Definition: ExecutableInstruction.hh:84