OpenASIP
2.0
|
#include <MultiLatencyOperationExecutor.hh>
Public Member Functions | |
MultiLatencyOperationExecutor (FUState &parent, TTAMachine::HWOperation &hwOp) | |
MultiLatencyOperationExecutor () | |
virtual | ~MultiLatencyOperationExecutor () |
virtual void | startOperation (Operation &op) |
virtual void | advanceClock () |
virtual OperationExecutor * | copy () |
virtual void | setContext (OperationContext &context) |
virtual void | reset () |
virtual void | setOperationSimulator (DetailedOperationSimulator &sim) |
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 |
Private Member Functions | |
MultiLatencyOperationExecutor & | operator= (const MultiLatencyOperationExecutor &) |
Assignment not allowed. More... | |
ExecutingOperation & | findFreeExecutingOperation () |
Private Attributes | |
OperationContext * | context_ |
Operation context. More... | |
TTAMachine::HWOperation * | hwOperation_ |
The hardware operation this executor simulates. More... | |
Operation * | operation_ |
The OSAL operation. More... | |
std::vector< ExecutingOperation > | executingOps_ |
The operations "on flight" in this operation executor. More... | |
ExecutingOperation * | freeExecOp_ |
If non-NULL, points to a known free ExecutingOperation slot. More... | |
bool | execOperationsInitialized_ |
DetailedOperationSimulator * | opSimulator_ |
If non-NULL, points to a detailed cycle-by-cycle simulation model for the operation simulated by this executor. 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... | |
OperationExecutor that supports multi-output operation pipelines with different latencies for results.
Can be also used for cycle-accurate modeling of the operation pipeline. In addition to simulate the execution of operations with multiple outputs with different latencies in the standalone TTA simulation, this execution model is used in the SystemC TTA core function unit simulation model.
Definition at line 61 of file MultiLatencyOperationExecutor.hh.
MultiLatencyOperationExecutor::MultiLatencyOperationExecutor | ( | FUState & | parent, |
TTAMachine::HWOperation & | hwOp | ||
) |
Constructor.
parent | Parent of the OperationExecutor. |
hwOp | The hardware operation to simulate. |
Initialize a list of pending executing operations that is the size of the maximum on flight operations. Each element in the list is initialized to contain a large enough I/O vector for inputs and outputs. In addition, the models for simulating the output latencies are initialized so it's as fast as possible to trigger new operations.
Definition at line 54 of file MultiLatencyOperationExecutor.cc.
References executingOps_, OperationExecutor::hasPendingOperations_, ExecutingOperation::iostorage_, TTAMachine::HWOperation::latency(), TTAMachine::HWOperation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), OperationPool::operation(), and operation_.
|
inline |
|
virtual |
|
virtual |
Advances clock by one cycle.
Implements OperationExecutor.
Reimplemented in ConflictDetectingOperationExecutor.
Definition at line 168 of file MultiLatencyOperationExecutor.cc.
References ExecutingOperation::advanceCycle(), context_, executingOps_, ExecutingOperation::free_, freeExecOp_, OperationExecutor::hasPendingOperations_, hwOperation_, ExecutingOperation::iovec_, TTAMachine::HWOperation::latency(), Application::logStream(), Operation::name(), ExecutingOperation::operation(), operation_, opSimulator_, DetailedOperationSimulator::simulateStage(), Operation::simulateTrigger(), ExecutingOperation::stage_, and ExecutingOperation::stop().
Referenced by ConflictDetectingOperationExecutor::advanceClock().
|
virtual |
Copies OperationExecutor.
Implements OperationExecutor.
Reimplemented in ConflictDetectingOperationExecutor.
Definition at line 204 of file MultiLatencyOperationExecutor.cc.
References MultiLatencyOperationExecutor().
|
private |
Definition at line 89 of file MultiLatencyOperationExecutor.cc.
References assert, executingOps_, ExecutingOperation::free_, and freeExecOp_.
Referenced by startOperation().
|
private |
Assignment not allowed.
|
virtual |
Resets the state to allow simulation restart. hasPendingOperations_ is resetted because otherwise some operations could be left in middle of execution if there was a runtime error during operation.
Reimplemented from OperationExecutor.
Definition at line 225 of file MultiLatencyOperationExecutor.cc.
References OperationExecutor::hasPendingOperations_.
|
virtual |
Sets the OperationContext for the OperationExecutor.
context | New OperationContext. |
Implements OperationExecutor.
Definition at line 214 of file MultiLatencyOperationExecutor.cc.
References context_.
|
inlinevirtual |
Definition at line 74 of file MultiLatencyOperationExecutor.hh.
References opSimulator_.
Referenced by FUState::setOperationSimulator().
|
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.
Reimplemented in ConflictDetectingOperationExecutor.
Definition at line 118 of file MultiLatencyOperationExecutor.cc.
References OperationExecutor::binding(), execOperationsInitialized_, executingOps_, findFreeExecutingOperation(), OperationExecutor::hasPendingOperations_, hwOperation_, ExecutingOperation::initIOVec(), ExecutingOperation::iostorage_, TTAMachine::HWOperation::latency(), Application::logStream(), Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), ExecutingOperation::operation(), operation_, ExecutingOperation::pendingResults_, ExecutingOperation::start(), and RegisterState::value().
Referenced by ConflictDetectingOperationExecutor::startOperation().
|
private |
Operation context.
Definition at line 87 of file MultiLatencyOperationExecutor.hh.
Referenced by advanceClock(), and setContext().
|
private |
Definition at line 96 of file MultiLatencyOperationExecutor.hh.
Referenced by startOperation().
|
private |
The operations "on flight" in this operation executor.
Definition at line 93 of file MultiLatencyOperationExecutor.hh.
Referenced by advanceClock(), findFreeExecutingOperation(), MultiLatencyOperationExecutor(), and startOperation().
|
private |
If non-NULL, points to a known free ExecutingOperation slot.
Definition at line 95 of file MultiLatencyOperationExecutor.hh.
Referenced by advanceClock(), and findFreeExecutingOperation().
|
private |
The hardware operation this executor simulates.
Definition at line 89 of file MultiLatencyOperationExecutor.hh.
Referenced by advanceClock(), and startOperation().
|
private |
The OSAL operation.
Definition at line 91 of file MultiLatencyOperationExecutor.hh.
Referenced by advanceClock(), MultiLatencyOperationExecutor(), and startOperation().
|
private |
If non-NULL, points to a detailed cycle-by-cycle simulation model for the operation simulated by this executor.
Definition at line 99 of file MultiLatencyOperationExecutor.hh.
Referenced by advanceClock(), and setOperationSimulator().