OpenASIP  2.0
Classes | Public Member Functions | Public Attributes | List of all members
ExecutingOperation Class Reference

#include <ExecutingOperation.hh>

Collaboration diagram for ExecutingOperation:
Collaboration graph

Classes

struct  PendingResult
 

Public Member Functions

 ExecutingOperation (Operation &op, unsigned stages)
 
SimValueio (int operand)
 
const Operationoperation () const
 
unsigned stage () const
 
bool isLastPipelineStage () const
 
void start ()
 
void stop ()
 
void advanceCycle ()
 
void initIOVec ()
 

Public Attributes

std::vector< SimValueiostorage_
 
std::vector< SimValue * > iovec_
 OSAL simulateTrigger() compatible I/O vector for fast execution. More...
 
std::vector< PendingResultpendingResults_
 
int stage_
 
int stages_
 
bool free_
 
const Operationop_
 

Detailed Description

Models an operation executing in the FU pipeline.

This is a helper class used by MultiCycleOperationExecutor to produce a more detailed simulation of operations executing in the FUs. Notably, this model is used in the interface to override operation simulation models from SystemC simulations (see tce_systemc.hh).

Definition at line 48 of file ExecutingOperation.hh.

Constructor & Destructor Documentation

◆ ExecutingOperation()

ExecutingOperation::ExecutingOperation ( Operation op,
unsigned  stages 
)
inline

Definition at line 50 of file ExecutingOperation.hh.

50  :
51  stage_(0), stages_(stages), free_(true), op_(&op) {}

Member Function Documentation

◆ advanceCycle()

void ExecutingOperation::advanceCycle ( )

Should be called at the end of a simulation cycle.

Definition at line 73 of file ExecutingOperation.cc.

73  {
74  for (std::size_t i = 0; i < pendingResults_.size(); ++i)
76  ++stage_;
77 }

References pendingResults_, and stage_.

Referenced by MultiLatencyOperationExecutor::advanceClock().

◆ initIOVec()

void ExecutingOperation::initIOVec ( )
inline

Definition at line 116 of file ExecutingOperation.hh.

116  {
117  for (std::size_t i = 0; i < iostorage_.size(); ++i)
118  iovec_.push_back(&iostorage_.at(i));
119  }

References iostorage_, and iovec_.

Referenced by MultiLatencyOperationExecutor::startOperation().

◆ io()

SimValue & ExecutingOperation::io ( int  operand)

Returns the value bound to the input or output operand with the given ID.

Note
operand is the OSAL ID, thus 1 is the first input and the outputs follow sequentially.

Definition at line 41 of file ExecutingOperation.cc.

41  {
42  return iostorage_[operand - 1];
43 }

References iostorage_.

◆ isLastPipelineStage()

bool ExecutingOperation::isLastPipelineStage ( ) const
inline

Returns true in case the currently simulated stage for the operation is the last before finishing the execution.

The next advanceCycle call will push the operation out from the FU pipeline after which all results are assumed to have arrived.

Definition at line 75 of file ExecutingOperation.hh.

75 { return stage_ == stages_ - 1; }

References stage_, and stages_.

◆ operation()

const Operation& ExecutingOperation::operation ( ) const
inline

Definition at line 63 of file ExecutingOperation.hh.

63 { return *op_; }

References op_.

Referenced by MultiLatencyOperationExecutor::advanceClock(), and MultiLatencyOperationExecutor::startOperation().

◆ stage()

unsigned ExecutingOperation::stage ( ) const
inline

Definition at line 65 of file ExecutingOperation.hh.

65 { return stage_; }

References stage_.

◆ start()

void ExecutingOperation::start ( )

Methods that should not be called from SystemC models.

Sets the operation execution to be started.

Should be called at the beginning of a single operation's simulation.

Definition at line 51 of file ExecutingOperation.cc.

51  {
52  for (std::size_t i = 0; i < pendingResults_.size(); ++i)
53  pendingResults_[i].reset();
54  free_ = false;
55  stage_ = 0;
56 }

References free_, pendingResults_, and stage_.

Referenced by MultiLatencyOperationExecutor::startOperation().

◆ stop()

void ExecutingOperation::stop ( )

Sets the operation execution to be stopped.

Should be called at the end of a single operation's simulation. This sets the object to be reusable for other operation execution.

Definition at line 65 of file ExecutingOperation.cc.

65  {
66  free_ = true;
67 }

References free_.

Referenced by MultiLatencyOperationExecutor::advanceClock().

Member Data Documentation

◆ free_

bool ExecutingOperation::free_

◆ iostorage_

std::vector<SimValue> ExecutingOperation::iostorage_

◆ iovec_

std::vector<SimValue*> ExecutingOperation::iovec_

OSAL simulateTrigger() compatible I/O vector for fast execution.

Definition at line 127 of file ExecutingOperation.hh.

Referenced by MultiLatencyOperationExecutor::advanceClock(), and initIOVec().

◆ op_

const Operation* ExecutingOperation::op_

Definition at line 140 of file ExecutingOperation.hh.

Referenced by operation().

◆ pendingResults_

std::vector<PendingResult> ExecutingOperation::pendingResults_

◆ stage_

int ExecutingOperation::stage_

◆ stages_

int ExecutingOperation::stages_

Definition at line 137 of file ExecutingOperation.hh.

Referenced by isLastPipelineStage().


The documentation for this class was generated from the following files:
ExecutingOperation::stage_
int stage_
Definition: ExecutingOperation.hh:134
ExecutingOperation::iostorage_
std::vector< SimValue > iostorage_
Definition: ExecutingOperation.hh:125
ExecutingOperation::free_
bool free_
Definition: ExecutingOperation.hh:138
ExecutingOperation::stages_
int stages_
Definition: ExecutingOperation.hh:137
ExecutingOperation::op_
const Operation * op_
Definition: ExecutingOperation.hh:140
ExecutingOperation::advanceCycle
void advanceCycle()
Definition: ExecutingOperation.cc:73
ExecutingOperation::pendingResults_
std::vector< PendingResult > pendingResults_
Definition: ExecutingOperation.hh:132
ExecutingOperation::iovec_
std::vector< SimValue * > iovec_
OSAL simulateTrigger() compatible I/O vector for fast execution.
Definition: ExecutingOperation.hh:127