OpenASIP  2.0
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
OperationExecutor Class Referenceabstract

#include <OperationExecutor.hh>

Inheritance diagram for OperationExecutor:
Inheritance graph
Collaboration diagram for OperationExecutor:
Collaboration graph

Public Member Functions

 OperationExecutor ()
 
 OperationExecutor (FUState &parent)
 
virtual ~OperationExecutor ()
 
FUStateparent () const
 
void setParent (FUState &parent)
 
void addBinding (int io, PortState &port)
 
PortStatebinding (int io) const
 
virtual void startOperation (Operation &op)=0
 
bool hasPendingOperations () const
 
virtual void advanceClock ()=0
 
virtual OperationExecutorcopy ()=0
 
virtual void setContext (OperationContext &context)=0
 
virtual void reset ()
 

Protected Attributes

std::vector< PortState * > bindings_
 PortStates that are bound to a certain input or output operand. More...
 
bool hasPendingOperations_
 This is set to true if the OperationExecutor is not in 'idle' mode. More...
 

Private Member Functions

OperationExecutoroperator= (const OperationExecutor &)
 Assignment not allowed. More...
 

Private Attributes

FUStateparent_
 Parent of the executor. More...
 

Detailed Description

Executes operations in function units.

Definition at line 49 of file OperationExecutor.hh.

Constructor & Destructor Documentation

◆ OperationExecutor() [1/2]

OperationExecutor::OperationExecutor ( )
inline

Definition at line 51 of file OperationExecutor.hh.

51 : hasPendingOperations_(false), parent_(NULL) {}

◆ OperationExecutor() [2/2]

OperationExecutor::OperationExecutor ( FUState parent)
explicit

Constructor.

Parameters
parentParent FUState.

Definition at line 48 of file OperationExecutor.cc.

48  :
50 }

◆ ~OperationExecutor()

OperationExecutor::~OperationExecutor ( )
virtual

Destructor.

Definition at line 55 of file OperationExecutor.cc.

55  {
56 }

Member Function Documentation

◆ addBinding()

void OperationExecutor::addBinding ( int  io,
PortState port 
)

Adds binding of operand to a port.

Parameters
ioOperand index.
portPort to be bind.
Exceptions
IllegalRegistrationIf parent of the port is not the same as the parent of the executor.

Definition at line 67 of file OperationExecutor.cc.

67  {
68  if (io > static_cast<int>(bindings_.size()) - 1) {
69  bindings_.resize(io, NULL);
70  }
71 
72  if (&port.parent() != parent_) {
73  string msg = "Parent of the port and executors differs";
74  throw IllegalRegistration(__FILE__, __LINE__, __func__, msg);
75  }
76 
77  if (bindings_[io - 1] != NULL) {
78  string msg = "Operand with given index has been already bound"
79  " to a port";
80  throw IllegalRegistration(__FILE__, __LINE__, __func__, msg);
81  }
82 
83  bindings_[io - 1] = &port;
84 }

References __func__, bindings_, PortState::parent(), and parent_.

Referenced by MachineStateBuilder::bindPortsToOperands(), and FUState::replaceOperationExecutor().

Here is the call graph for this function:

◆ advanceClock()

virtual void OperationExecutor::advanceClock ( )
pure virtual

◆ binding()

PortState& OperationExecutor::binding ( int  io) const

◆ copy()

virtual OperationExecutor* OperationExecutor::copy ( )
pure virtual

◆ hasPendingOperations()

bool OperationExecutor::hasPendingOperations ( ) const

◆ operator=()

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

Assignment not allowed.

◆ parent()

FUState& OperationExecutor::parent ( ) const

◆ reset()

void OperationExecutor::reset ( )
virtual

Reimplemented in MultiLatencyOperationExecutor.

Definition at line 87 of file OperationExecutor.cc.

87  {
88  return;
89 }

◆ setContext()

virtual void OperationExecutor::setContext ( OperationContext context)
pure virtual

◆ setParent()

void OperationExecutor::setParent ( FUState parent)
inline

Definition at line 56 of file OperationExecutor.hh.

56 { parent_ = &parent; }

References parent(), and parent_.

Referenced by FUState::replaceOperationExecutor().

Here is the call graph for this function:

◆ startOperation()

virtual void OperationExecutor::startOperation ( Operation op)
pure virtual

Member Data Documentation

◆ bindings_

std::vector<PortState*> OperationExecutor::bindings_
protected

PortStates that are bound to a certain input or output operand.

Definition at line 70 of file OperationExecutor.hh.

Referenced by addBinding(), and OneCycleOperationExecutor::initializeIOVector().

◆ hasPendingOperations_

bool OperationExecutor::hasPendingOperations_
protected

◆ parent_

FUState* OperationExecutor::parent_
private

Parent of the executor.

Definition at line 79 of file OperationExecutor.hh.

Referenced by addBinding(), and setParent().


The documentation for this class was generated from the following files:
OperationExecutor::parent_
FUState * parent_
Parent of the executor.
Definition: OperationExecutor.hh:79
PortState::parent
virtual FUState & parent() const
Definition: PortState.cc:80
OperationExecutor::hasPendingOperations_
bool hasPendingOperations_
This is set to true if the OperationExecutor is not in 'idle' mode.
Definition: OperationExecutor.hh:73
OperationExecutor::bindings_
std::vector< PortState * > bindings_
PortStates that are bound to a certain input or output operand.
Definition: OperationExecutor.hh:70
__func__
#define __func__
Definition: Application.hh:67
IllegalRegistration
Definition: Exception.hh:532
OperationExecutor::parent
FUState & parent() const