OpenASIP
2.0
|
#include <SimpleOperationExecutor.hh>
Classes | |
struct | BufferCell |
Public Member Functions | |
SimpleOperationExecutor (int latency, FUState &parent) | |
virtual | ~SimpleOperationExecutor () |
virtual int | latency () const |
virtual void | startOperation (Operation &op) |
virtual void | advanceClock () |
virtual OperationExecutor * | copy () |
virtual void | setContext (OperationContext &context) |
Public Member Functions inherited from OperationExecutor | |
OperationExecutor () | |
OperationExecutor (FUState &parent) | |
virtual | ~OperationExecutor () |
FUState & | parent () const |
void | setParent (FUState &parent) |
void | addBinding (int io, PortState &port) |
PortState & | binding (int io) const |
bool | hasPendingOperations () const |
virtual void | reset () |
Private Types | |
typedef std::vector< BufferCell > | Buffer |
Ring buffer type for the pipeline slots. More... | |
Private Member Functions | |
SimpleOperationExecutor & | operator= (const SimpleOperationExecutor &) |
Assignment not allowed. More... | |
Private Attributes | |
int | nextSlot_ |
Position of the ring buffer where to put the next triggered operation. More... | |
Buffer | buffer_ |
Ring buffer for the pipeline slots. More... | |
OperationContext * | context_ |
Operation context. More... | |
std::size_t | pendingOperations_ |
Count of pending operations in the pipeline. 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... | |
Simple implementation of OperationExecutor.
Definition at line 48 of file SimpleOperationExecutor.hh.
|
private |
Ring buffer type for the pipeline slots.
Definition at line 93 of file SimpleOperationExecutor.hh.
SimpleOperationExecutor::SimpleOperationExecutor | ( | int | latency, |
FUState & | parent | ||
) |
Constructor.
latency | Latency of the operation. |
parent | Parent of the OperationExecutor. |
Definition at line 54 of file SimpleOperationExecutor.cc.
References buffer_, OperationExecutor::hasPendingOperations_, and latency().
Referenced by copy().
|
virtual |
|
virtual |
Advances clock by one cycle.
Takes the oldest result in the pipeline and makes it visible in the function unit's ports.
Implements OperationExecutor.
Definition at line 138 of file SimpleOperationExecutor.cc.
References OperationExecutor::binding(), buffer_, OperationExecutor::hasPendingOperations_, SimpleOperationExecutor::BufferCell::io_, nextSlot_, Operation::numberOfInputs(), Operation::numberOfOutputs(), SimpleOperationExecutor::BufferCell::operation_, pendingOperations_, and RegisterState::setValue().
|
virtual |
Copies OperationExecutor.
Implements OperationExecutor.
Definition at line 169 of file SimpleOperationExecutor.cc.
References SimpleOperationExecutor().
|
virtual |
Returns the latency of the executor.
Definition at line 79 of file SimpleOperationExecutor.cc.
References buffer_.
Referenced by SimpleOperationExecutor().
|
private |
Assignment not allowed.
|
virtual |
Sets the OperationContext for the OperationExecutor.
context | New OperationContext. |
Implements OperationExecutor.
Definition at line 179 of file SimpleOperationExecutor.cc.
References context_.
|
virtual |
Starts new operation.
First original inputs and outputs are stored. Then outputs of the operation are stored. Then operation is triggered.
op | Operation to be triggered. |
Implements OperationExecutor.
Definition at line 94 of file SimpleOperationExecutor.cc.
References assert, OperationExecutor::binding(), SimpleOperationExecutor::BufferCell::boundOperation_, buffer_, context_, EXECUTOR_MAX_OPERAND_COUNT, OperationExecutor::hasPendingOperations_, SimpleOperationExecutor::BufferCell::io_, SimpleOperationExecutor::BufferCell::ioOrig_, nextSlot_, Operation::numberOfInputs(), Operation::numberOfOutputs(), Operation::operand(), SimpleOperationExecutor::BufferCell::operation_, pendingOperations_, SimpleOperationExecutor::BufferCell::ready_, SimValue::setBitWidth(), Operation::simulateTrigger(), RegisterState::value(), and Operand::width().
|
private |
Ring buffer for the pipeline slots.
Definition at line 97 of file SimpleOperationExecutor.hh.
Referenced by advanceClock(), latency(), SimpleOperationExecutor(), and startOperation().
|
private |
Operation context.
Definition at line 99 of file SimpleOperationExecutor.hh.
Referenced by setContext(), and startOperation().
|
private |
Position of the ring buffer where to put the next triggered operation.
Definition at line 95 of file SimpleOperationExecutor.hh.
Referenced by advanceClock(), and startOperation().
|
private |
Count of pending operations in the pipeline.
Definition at line 101 of file SimpleOperationExecutor.hh.
Referenced by advanceClock(), and startOperation().