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

#include <OneCycleOperationExecutor.hh>

Inheritance diagram for OneCycleOperationExecutor:
Inheritance graph
Collaboration diagram for OneCycleOperationExecutor:
Collaboration graph

Public Member Functions

 OneCycleOperationExecutor (FUState &parent)
 
virtual ~OneCycleOperationExecutor ()
 
virtual int latency () const
 
virtual void startOperation (Operation &op)
 
virtual void advanceClock ()
 
virtual OperationExecutorcopy ()
 
virtual void setContext (OperationContext &context)
 
- Public Member Functions inherited from OperationExecutor
 OperationExecutor ()
 
 OperationExecutor (FUState &parent)
 
virtual ~OperationExecutor ()
 
FUStateparent () const
 
void setParent (FUState &parent)
 
void addBinding (int io, PortState &port)
 
PortStatebinding (int io) const
 
bool hasPendingOperations () const
 
virtual void reset ()
 

Private Member Functions

OneCycleOperationExecutoroperator= (const OneCycleOperationExecutor &)
 Assignment not allowed. More...
 
void initializeIOVector ()
 

Private Attributes

OperationContextcontext_
 Operation context. More...
 
Operationoperation_
 Operation to be executed next. More...
 
SimValue ** io_
 Inputs and outputs for the operation. More...
 
bool ready_
 True if all the results are ready. More...
 
bool ioVectorInitialized_
 True if the io_ vector is initialized-. More...
 

Additional Inherited Members

- Protected Attributes inherited from OperationExecutor
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...
 

Detailed Description

Operation executor for one cycle latency operations.

Definition at line 45 of file OneCycleOperationExecutor.hh.

Constructor & Destructor Documentation

◆ OneCycleOperationExecutor()

OneCycleOperationExecutor::OneCycleOperationExecutor ( FUState parent)
explicit

Constructor.

Parameters
parentParent of the executor.

Definition at line 55 of file OneCycleOperationExecutor.cc.

55  :
57  io_(NULL), ready_(false), ioVectorInitialized_(false) {
58 }

Referenced by copy().

◆ ~OneCycleOperationExecutor()

OneCycleOperationExecutor::~OneCycleOperationExecutor ( )
virtual

Destructor.

Definition at line 63 of file OneCycleOperationExecutor.cc.

63  {
64  delete[] io_;
65  io_ = NULL;
66 }

References io_.

Member Function Documentation

◆ advanceClock()

void OneCycleOperationExecutor::advanceClock ( )
virtual

Advances clock by one cycle.

Implements OperationExecutor.

Definition at line 113 of file OneCycleOperationExecutor.cc.

113  {
114  operation_ = NULL;
115  hasPendingOperations_ = false;
116 }

References OperationExecutor::hasPendingOperations_, and operation_.

◆ copy()

OperationExecutor * OneCycleOperationExecutor::copy ( )
virtual

Copies OperationExecutor.

Returns
The copied OperationExecutor.

Implements OperationExecutor.

Definition at line 124 of file OneCycleOperationExecutor.cc.

124  {
125  return new OneCycleOperationExecutor(*this);
126 }

References OneCycleOperationExecutor().

Here is the call graph for this function:

◆ initializeIOVector()

void OneCycleOperationExecutor::initializeIOVector ( )
inlineprivate

Initializes the operation input/output vector.

The I/O vector points directly to the function unit port register values. This is possible because there cannot be any other pending operations at once because of latency of 1.

Definition at line 86 of file OneCycleOperationExecutor.cc.

86  {
88  return;
89  io_ = new SimValue*[bindings_.size()];
90  for (size_t i = 0; i < bindings_.size(); ++i) {
91  io_[i] = const_cast<SimValue*>(&bindings_[i]->value());
92  }
93  ioVectorInitialized_ = true;
94 }

References OperationExecutor::bindings_, io_, and ioVectorInitialized_.

Referenced by startOperation().

◆ latency()

int OneCycleOperationExecutor::latency ( ) const
virtual

Returns the latency of the executor.

Returns
The latency of the executor.

Definition at line 74 of file OneCycleOperationExecutor.cc.

74  {
75  return 1;
76 }

◆ operator=()

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

Assignment not allowed.

◆ setContext()

void OneCycleOperationExecutor::setContext ( OperationContext context)
virtual

Sets new context for the OperationExecutor.

Parameters
contextNew OperationContext.

Implements OperationExecutor.

Definition at line 134 of file OneCycleOperationExecutor.cc.

134  {
135  context_ = &context;
136 }

References context_.

◆ startOperation()

void OneCycleOperationExecutor::startOperation ( Operation op)
virtual

Starts the execution of the operation.

Parameters
opOperation to be triggered.

Implements OperationExecutor.

Definition at line 102 of file OneCycleOperationExecutor.cc.

102  {
103  operation_ = &op;
107 }

References context_, OperationExecutor::hasPendingOperations_, initializeIOVector(), io_, operation_, ready_, and Operation::simulateTrigger().

Here is the call graph for this function:

Member Data Documentation

◆ context_

OperationContext* OneCycleOperationExecutor::context_
private

Operation context.

Definition at line 65 of file OneCycleOperationExecutor.hh.

Referenced by setContext(), and startOperation().

◆ io_

SimValue** OneCycleOperationExecutor::io_
private

Inputs and outputs for the operation.

Definition at line 69 of file OneCycleOperationExecutor.hh.

Referenced by initializeIOVector(), startOperation(), and ~OneCycleOperationExecutor().

◆ ioVectorInitialized_

bool OneCycleOperationExecutor::ioVectorInitialized_
private

True if the io_ vector is initialized-.

Definition at line 73 of file OneCycleOperationExecutor.hh.

Referenced by initializeIOVector().

◆ operation_

Operation* OneCycleOperationExecutor::operation_
private

Operation to be executed next.

Definition at line 67 of file OneCycleOperationExecutor.hh.

Referenced by advanceClock(), and startOperation().

◆ ready_

bool OneCycleOperationExecutor::ready_
private

True if all the results are ready.

Definition at line 71 of file OneCycleOperationExecutor.hh.

Referenced by startOperation().


The documentation for this class was generated from the following files:
OneCycleOperationExecutor::io_
SimValue ** io_
Inputs and outputs for the operation.
Definition: OneCycleOperationExecutor.hh:69
OneCycleOperationExecutor::ioVectorInitialized_
bool ioVectorInitialized_
True if the io_ vector is initialized-.
Definition: OneCycleOperationExecutor.hh:73
OneCycleOperationExecutor::operation_
Operation * operation_
Operation to be executed next.
Definition: OneCycleOperationExecutor.hh:67
OneCycleOperationExecutor::context_
OperationContext * context_
Operation context.
Definition: OneCycleOperationExecutor.hh:65
OperationExecutor::OperationExecutor
OperationExecutor()
Definition: OperationExecutor.hh:51
OneCycleOperationExecutor::OneCycleOperationExecutor
OneCycleOperationExecutor(FUState &parent)
Definition: OneCycleOperationExecutor.cc:55
OneCycleOperationExecutor::ready_
bool ready_
True if all the results are ready.
Definition: OneCycleOperationExecutor.hh:71
SimValue
Definition: SimValue.hh:96
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
OperationExecutor::parent
FUState & parent() const
Operation::simulateTrigger
virtual bool simulateTrigger(SimValue **, OperationContext &context) const
Definition: Operation.cc:555
OneCycleOperationExecutor::initializeIOVector
void initializeIOVector()
Definition: OneCycleOperationExecutor.cc:86