OpenASIP
2.0
|
#include <ExecutionPipelineResource.hh>
Classes | |
struct | OperandUseHelper |
struct | ResultHelper |
Public Member Functions | |
ExecutionPipelineResource (const TTAMachine::FunctionUnit &fu, const unsigned int ii=0) | |
virtual | ~ExecutionPipelineResource () |
virtual bool | isInUse (const int cycle) const override |
virtual bool | isAvailable (const int cycle) const override |
virtual bool | canAssign (const int cycle, const MoveNode &node) const override |
virtual bool | canAssignSource (int cycle, const MoveNode &node, const TTAMachine::Port &resultPort) const |
virtual bool | canAssignDestination (const int cycle, const MoveNode &node, const bool triggering=false) const |
virtual void | assign (const int cycle, MoveNode &node) override |
virtual void | assignSource (int cycle, MoveNode &node) |
virtual void | assignDestination (const int cycle, MoveNode &node) |
virtual void | unassign (const int cycle, MoveNode &node) override |
virtual void | unassignSource (const int cycle, MoveNode &node) |
virtual void | unassignDestination (const int cycle, MoveNode &node) |
virtual bool | isExecutionPipelineResource () const override |
int | highestKnownCycle () const |
int | nextResultCycle (const TTAMachine::Port &port, int cycle, const MoveNode &node, const MoveNode *trigger=NULL, int triggerCycle=INT_MAX) const |
bool | otherTriggerBeforeMyTrigger (const TTAMachine::Port &port, const MoveNode &node, int cycle) const |
bool | resultNotOverWritten (int resultReadCycle, int resultReadyCycle, const MoveNode &node, const TTAMachine::Port &port, const MoveNode *trigger, int triggerCycle) const |
bool | hasConflictingResultsOnCycle (const ProgramOperation &po, const TTAMachine::Port &port, int cycle) const |
bool | operandsOverwritten (int triggerCycle, const MoveNode &trigger) const |
void | clear () override |
void | setDDG (const DataDependenceGraph *ddg) |
virtual void | setMaxCycle (unsigned int maxCycle) override |
Public Member Functions inherited from SchedulingResource | |
virtual | ~SchedulingResource () |
SchedulingResource (const std::string &name, const unsigned int ii=0) | |
virtual int | relatedResourceGroupCount () const |
virtual int | dependentResourceGroupCount () const |
int | relatedResourceCount (const int group) const |
int | dependentResourceCount (const int group) const |
virtual void | addToRelatedGroup (const int group, SchedulingResource &resource) |
virtual void | addToDependentGroup (const int group, SchedulingResource &resource) |
virtual SchedulingResource & | relatedResource (const int group, const int index) const |
virtual SchedulingResource & | dependentResource (const int group, const int index) const |
virtual bool | hasRelatedResource (const SchedulingResource &sResource) const |
virtual bool | hasDependentResource (const SchedulingResource &sResource) const |
virtual const std::string & | name () const |
virtual int | useCount () const |
virtual void | increaseUseCount () |
virtual void | decreaseUseCount () |
virtual bool | isInputPSocketResource () const |
virtual bool | isOutputPSocketResource () const |
virtual bool | isShortImmPSocketResource () const |
virtual bool | isInputFUResource () const |
virtual bool | isOutputFUResource () const |
virtual bool | isBusResource () const |
virtual bool | isSegmentResource () const |
virtual bool | isIUResource () const |
virtual bool | isITemplateResource () const |
int | instructionIndex (int cycle) const |
void | setInitiationInterval (unsigned int ii) |
int | initiationInterval () const |
virtual bool | operator< (const SchedulingResource &other) const |
Protected Member Functions | |
virtual bool | validateDependentGroups () override |
virtual bool | validateRelatedGroups () override |
unsigned int | size () const |
Private Types | |
typedef std::pair< ResultHelper, ResultHelper > | ResultHelperPair |
typedef std::pair< OperandUseHelper, OperandUseHelper > | OperandUsePair |
typedef std::pair< const MoveNode *, const MoveNode * > | ResourceReservation |
typedef std::vector< ResourceReservation > | ResourceReservationVector |
Type for resource vector, represents one cycle of use. Includes the ownerships of the reservation. More... | |
typedef SparseVector< ResultHelperPair > | ResultVector |
Used for both result read and result written. More... | |
typedef std::map< const TTAMachine::Port *, ResultVector > | ResultMap |
typedef std::pair< MoveNode *, MoveNode * > | MoveNodePtrPair |
typedef SparseVector< MoveNodePtrPair > | OperandWriteVector |
typedef SparseVector< OperandUsePair > | OperandUseVector |
typedef std::map< const TTAMachine::Port *, OperandUseVector > | OperandUseMap |
typedef std::map< const TTAMachine::Port *, OperandWriteVector > | OperandWriteMap |
typedef SparseVector< ResourceReservationVector > | ResourceReservationTable |
Type for resource reservation table, resource vector x latency. Includes the ownerships of the reservation. More... | |
Private Member Functions | |
bool | cyclesOverlap (int rangeFirst, int rangeLast, int targetCycle) const |
bool | cyclesConflict (const MoveNode *mn1, const MoveNode *mn2, int guardCycle, int rangeFirst, int rangeLast, int targetCycle) const |
bool | isLoopBypass (const MoveNode &node) const |
ExecutionPipelineResource (const ExecutionPipelineResource &) | |
ExecutionPipelineResource & | operator= (const ExecutionPipelineResource &) |
void | findRange (const int cycle, const MoveNode &node, int popIndex, int &first, int &last, int &triggering) const |
Find first and last cycles already scheduled for same PO. More... | |
int | resultReadyCycle (const ProgramOperation &po, const TTAMachine::Port &resultPort) const |
void | setResultWriten (const TTAMachine::Port &port, unsigned int realCycle, const ProgramOperation &po) |
void | setResultWriten (const ProgramOperation &po, unsigned int triggerCycle) |
void | unsetResultWriten (const TTAMachine::Port &port, unsigned int realCycle, const ProgramOperation &po) |
void | unsetResultWriten (const ProgramOperation &po, unsigned int triggerCycle) |
void | setOperandUsed (const TTAMachine::Port &port, unsigned int realCycle, const ProgramOperation &po) |
void | setOperandsUsed (const ProgramOperation &po, unsigned int triggerCycle) |
void | unsetOperandUsed (const TTAMachine::Port &port, unsigned int realCycle, const ProgramOperation &po) |
void | unsetOperandsUsed (const ProgramOperation &po, unsigned int triggerCycle) |
const TTAMachine::Port & | operandPort (const MoveNode &mn) const |
bool | operandOverwritten (int operandWriteCycle, int triggerCycle, const ProgramOperation &po, const MoveNode &operand, const MoveNode &trigger) const |
bool | operandOverwritten (const MoveNode &mn, int cycle) const |
bool | testTriggerResult (const MoveNode &trigger, int cycle) const |
bool | resultAllowedAtCycle (int resultCycle, const ProgramOperation &po, const TTAMachine::Port &resultPort, const MoveNode &trigger, int triggerCycle) const |
bool | resourcesAllowTrigger (int cycle, const MoveNode &move) const |
bool | operandPossibleAtCycle (const TTAMachine::Port &port, const MoveNode &mn, int cycle) const |
bool | operandAllowedAtCycle (const TTAMachine::Port &port, const MoveNode &mn, int cycle) const |
bool | checkOperandAllowed (const MoveNode ¤tMn, const TTAMachine::Port &port, int operandWriteCycle, const OperandUseHelper &operandUse, int operandUseModCycle, ProgramOperation &currOp) const |
bool | triggerTooEarly (const MoveNode &trigger, int cycle) const |
bool | operandTooLate (const MoveNode &node, int cycle) const |
bool | triggerAllowedAtCycle (int inputCount, const TTAMachine::HWOperation &hwop, const MoveNode &node, int cycle) const |
bool | operandSharePreventsTriggerForScheduledResult (const TTAMachine::Port &port, const MoveNode &mn, int cycle) const |
bool | resultCausesTriggerBetweenOperandSharing (const MoveNode &mn, int cycle) const |
const MoveNode * | nodeOfInputPort (const ProgramOperation &po, TTAMachine::Port &port) |
bool | poConflictsWithInputPort (const TTAMachine::Port &port, const ProgramOperation &po, const MoveNode &mn) const |
const TTAMachine::Port & | resultPort (const MoveNode &mn) const |
bool | exclusiveMoves (const MoveNode *mn1, const MoveNode *mn2, int cycle=INT_MAX) const |
int | latestTriggerWriteCycle (const MoveNode &mn) const |
bool | isDestOpOfMN (const MoveNode &mn, const ProgramOperation &po) const |
Private Attributes | |
const ExecutionPipelineResourceTable * | resources |
ResourceReservationTable | fuExecutionPipeline_ |
Stores one resource vector per cycle of scope for whole FU. More... | |
OperandWriteMap | operandsWriten_ |
OperandUseMap | operandsUsed_ |
ResultMap | resultWriten_ |
ResultMap | resultRead_ |
std::map< MoveNode *, int, MoveNode::Comparator > | storedResultCycles_ |
std::multimap< int, MoveNode * > | assignedSourceNodes_ |
std::multimap< int, MoveNode * > | assignedDestinationNodes_ |
int | cachedSize_ |
int | maxCycle_ |
const DataDependenceGraph * | ddg_ |
const TTAMachine::FunctionUnit & | fu_ |
const TTAMachine::Port * | triggerPort_ |
int | operandShareCount_ |
Additional Inherited Members | |
Protected Attributes inherited from SchedulingResource | |
int | initiationInterval_ |
ExecutionPipelineResource keeps book of pipeline resource reservation status. It uses rather simple resource reservation table approach.
Definition at line 64 of file ExecutionPipelineResource.hh.
|
private |
Definition at line 164 of file ExecutionPipelineResource.hh.
|
private |
Definition at line 169 of file ExecutionPipelineResource.hh.
|
private |
Definition at line 149 of file ExecutionPipelineResource.hh.
|
private |
Definition at line 167 of file ExecutionPipelineResource.hh.
|
private |
Definition at line 171 of file ExecutionPipelineResource.hh.
|
private |
Definition at line 166 of file ExecutionPipelineResource.hh.
|
private |
Definition at line 151 of file ExecutionPipelineResource.hh.
|
private |
Type for resource reservation table, resource vector x latency. Includes the ownerships of the reservation.
Definition at line 175 of file ExecutionPipelineResource.hh.
|
private |
Type for resource vector, represents one cycle of use. Includes the ownerships of the reservation.
Definition at line 157 of file ExecutionPipelineResource.hh.
|
private |
Definition at line 148 of file ExecutionPipelineResource.hh.
|
private |
Definition at line 162 of file ExecutionPipelineResource.hh.
|
private |
Used for both result read and result written.
Definition at line 160 of file ExecutionPipelineResource.hh.
ExecutionPipelineResource::ExecutionPipelineResource | ( | const TTAMachine::FunctionUnit & | fu, |
const unsigned int | ii = 0 |
||
) |
Constructor.
Creates new resource with defined name
name | Name of resource |
resNum | Number of resources in FU |
maxLatency | Latency of longest operation FU supports |
Definition at line 82 of file ExecutionPipelineResource.cc.
|
virtual |
|
private |
|
overridevirtual |
Implements SchedulingResource.
Definition at line 392 of file ExecutionPipelineResource.cc.
References abortWithError.
|
virtual |
Assign resource to given node for given cycle.
cycle | Cycle to assign |
node | MoveNode assigned in case move is bypassed |
Definition at line 487 of file ExecutionPipelineResource.cc.
References __func__, assert, assignedDestinationNodes_, cachedSize_, TTAProgram::Move::destination(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), exclusiveMoves(), fuExecutionPipeline_, SchedulingResource::instructionIndex(), MoveNode::isDestinationOperation(), TTAProgram::Terminal::isOpcodeSetting(), TTAProgram::Terminal::isTriggering(), ExecutionPipelineResourceTable::maximalLatency(), MoveNode::move(), SchedulingResource::name(), Operation::name(), ExecutionPipelineResourceTable::numberOfResources(), operandPort(), operandShareCount_, operandsWriten_, TTAProgram::Terminal::operation(), ExecutionPipelineResourceTable::operationIndex(), ExecutionPipelineResourceTable::operationPipeline(), resources, setOperandsUsed(), setResultWriten(), size(), Conversion::toString(), MoveNode::toString(), and ProgramOperation::toString().
Referenced by InputFUResource::assign().
|
virtual |
Assign resource to given node for given cycle.
cycle | Cycle to assign |
node | MoveNode assigned |
source | Indicates if we want to unassing source part of move in case move is bypassed |
Assiging result read
Record Program Operation in cycle where the "result read" is scheduled
Definition at line 405 of file ExecutionPipelineResource.cc.
References assert, assignedSourceNodes_, cachedSize_, MoveNode::guardOperation(), SchedulingResource::initiationInterval_, SchedulingResource::instructionIndex(), isLoopBypass(), MoveNode::isSourceOperation(), resultPort(), resultRead_, setResultWriten(), SparseVector< ValueType >::size(), MoveNode::sourceOperation(), and storedResultCycles_.
Referenced by OutputFUResource::assign().
|
overridevirtual |
Not to be used. ExecutionPipelineResource needs to be tested also with PSocket parameter to find if the desired part of MoveNode is source or destination from type of PSocket.
Implements SchedulingResource.
Definition at line 102 of file ExecutionPipelineResource.cc.
References abortWithError.
Referenced by resourcesAllowTrigger().
|
virtual |
Return true if resource can be assigned for given node in given cycle.
cycle | Cycle to test |
node | MoveNode to test |
pSocket | Socket which was assigned to move by previous broker |
triggers | Indicates if move is triggering |
Definition at line 990 of file ExecutionPipelineResource.cc.
References abortWithError, TTAProgram::Move::destination(), MoveNode::destinationOperation(), Exception::errorMessage(), fu_, SchedulingResource::initiationInterval_, MoveNode::isDestinationOperation(), latestTriggerWriteCycle(), MoveNode::move(), Operation::name(), Operation::numberOfInputs(), operandAllowedAtCycle(), operandOverwritten(), operandPossibleAtCycle(), operandSharePreventsTriggerForScheduledResult(), operandsOverwritten(), operandTooLate(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), otherTriggerBeforeMyTrigger(), TTAMachine::HWOperation::port(), resourcesAllowTrigger(), testTriggerResult(), MoveNode::toString(), ProgramOperation::toString(), triggerAllowedAtCycle(), and triggerTooEarly().
Referenced by InputFUResource::canAssign().
|
virtual |
Return true if resource can be assigned for given node in given cycle.
cycle | Cycle to test |
node | MoveNode to test |
pSocket | Socket which was assigned to move by previous broker |
triggers | Indicates if move is triggering |
Testing the result read move Find the cycle first of the possible results of PO will be produced
Check if the port has a register. If not result read must be in same cycle as result ready.
Definition at line 819 of file ExecutionPipelineResource.cc.
References assert, MoveNodeSet::at(), MoveNodeSet::count(), MoveNode::cycle(), MoveNode::earliestResultReadCycle(), fu_, MoveNode::guardOperation(), hasConflictingResultsOnCycle(), SchedulingResource::initiationInterval_, MoveNode::isGuardOperation(), isLoopBypass(), MoveNode::isPlaced(), MoveNode::isSourceOperation(), TTAMachine::HWOperation::latency(), MoveNode::move(), Operation::name(), TTAMachine::FUPort::noRegister(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), ProgramOperation::outputIndexFromGuardOfMove(), ProgramOperation::outputNode(), TTAMachine::HWOperation::port(), resultAllowedAtCycle(), resultCausesTriggerBetweenOperandSharing(), resultNotOverWritten(), resultPort(), TTAProgram::Move::source(), MoveNode::sourceOperation(), MoveNode::toString(), and ProgramOperation::triggeringMove().
Referenced by OutputFUResource::canAssign().
|
private |
Definition at line 2234 of file ExecutionPipelineResource.cc.
References MoveNode::cycle(), TTAProgram::Move::destination(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), exclusiveMoves(), ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), SchedulingResource::instructionIndex(), MoveNode::isPlaced(), MoveNode::move(), TTAMachine::Port::name(), ExecutionPipelineResource::OperandUseHelper::po, TTAProgram::Terminal::port(), MoveNode::toString(), and ProgramOperation::toString().
Referenced by operandAllowedAtCycle().
|
overridevirtual |
Clears bookkeeping of the scheduling resource.
After this call the state of the resource should be identical to a newly-created and initialized resource.
Reimplemented from SchedulingResource.
Definition at line 1759 of file ExecutionPipelineResource.cc.
References assignedDestinationNodes_, assignedSourceNodes_, cachedSize_, SchedulingResource::clear(), ddg_, fuExecutionPipeline_, operandShareCount_, operandsUsed_, operandsWriten_, resultRead_, resultWriten_, and storedResultCycles_.
|
private |
Definition at line 2843 of file ExecutionPipelineResource.cc.
References cyclesOverlap(), and exclusiveMoves().
Referenced by operandSharePreventsTriggerForScheduledResult().
|
inlineprivate |
Definition at line 2823 of file ExecutionPipelineResource.cc.
References SchedulingResource::instructionIndex().
Referenced by cyclesConflict().
|
private |
Checks whether both of two moves have exclusive guards so that both moves are never executed, only either of those. Those can then be scheduled to use same resources.
This checks that the guards are exclusive, and that the moves are to be scheduled in same cycle (one already scheduled, on is going to be scheudled to given cycle, which has to be the same. the same cycle requirements makes sure the value of the guard cannot be changed between the moves.
mn1 | movenode which has already been scheduled |
mn2 | move which we are going to schedule |
cycle | cycle where we are going to scheudle mn2. |
Definition at line 1719 of file ExecutionPipelineResource.cc.
References MoveNode::cycle(), ddg_, DataDependenceGraph::exclusingGuards(), TTAProgram::MoveGuard::guard(), TTAProgram::Move::guard(), MoveNode::isMove(), TTAMachine::Guard::isOpposite(), MoveNode::isPlaced(), TTAProgram::Move::isUnconditional(), and MoveNode::move().
Referenced by assignDestination(), checkOperandAllowed(), cyclesConflict(), hasConflictingResultsOnCycle(), nextResultCycle(), operandAllowedAtCycle(), operandOverwritten(), operandPossibleAtCycle(), otherTriggerBeforeMyTrigger(), resourcesAllowTrigger(), resultAllowedAtCycle(), and resultCausesTriggerBetweenOperandSharing().
|
private |
Find first and last cycles already scheduled for same PO.
bool ExecutionPipelineResource::hasConflictingResultsOnCycle | ( | const ProgramOperation & | po, |
const TTAMachine::Port & | port, | ||
int | cycle | ||
) | const |
Definition at line 1559 of file ExecutionPipelineResource.cc.
References assert, exclusiveMoves(), SchedulingResource::instructionIndex(), resultWriten_, and ProgramOperation::triggeringMove().
Referenced by canAssignSource().
int ExecutionPipelineResource::highestKnownCycle | ( | ) | const |
Returns the highest cycle known to Execution Pipeline to be used by either pipeline resources or some operands, trigger or result read/write
TODO: module thingies
Definition at line 1479 of file ExecutionPipelineResource.cc.
References assignedDestinationNodes_, assignedSourceNodes_, SchedulingResource::initiationInterval_, resultRead_, resultWriten_, SparseVector< ValueType >::size(), and size().
Referenced by ExecutionPipelineBroker::highestKnownCycle().
|
overridevirtual |
Test if resource ExecutionPipelineResource is available for any of the supported operations (at least one).
cycle | Cycle which to test |
Implements SchedulingResource.
Definition at line 178 of file ExecutionPipelineResource.cc.
References fu_, SchedulingResource::instructionIndex(), operandsWriten_, TTAMachine::FunctionUnit::port(), and TTAMachine::Unit::portCount().
|
private |
Definition at line 2477 of file ExecutionPipelineResource.cc.
References MoveNode::destinationOperation(), and MoveNode::destinationOperationCount().
Referenced by otherTriggerBeforeMyTrigger().
|
overridevirtual |
Always return true.
Reimplemented from SchedulingResource.
Definition at line 1378 of file ExecutionPipelineResource.cc.
|
overridevirtual |
Test if resource ExecutionPipelineResource is used in given cycle.
If there is any of pipeline resources already used in given cycle.
cycle | Cycle which to test |
Internal | error, the recorded resource usage for cycle is shorter then the number of resources the FU has. |
Some result is already read in tested cycle
Cycle is beyond already scheduled scope, not in use therefore
Some pipeline resource is already in use in tested cycle
Implements SchedulingResource.
Definition at line 117 of file ExecutionPipelineResource.cc.
References __func__, fuExecutionPipeline_, SchedulingResource::instructionIndex(), ExecutionPipelineResourceTable::numberOfResources(), operandsWriten_, resources, resultRead_, and size().
|
private |
Definition at line 791 of file ExecutionPipelineResource.cc.
References ddg_, DataDependenceEdge::EDGE_OPERATION, DataDependenceEdge::edgeReason(), BoostGraph< GraphNode, GraphEdge >::hasNode(), BoostGraph< GraphNode, GraphEdge >::inEdges(), and DataDependenceEdge::isBackEdge().
Referenced by assignSource(), canAssignSource(), latestTriggerWriteCycle(), and testTriggerResult().
|
private |
Returns the lates cycle the given trigger move can be scheduled at, taking in the account the latency of the operation results.
In case the none of the result moves has been scheduled yet, returns INT_MAX.
IllegalObject | if this MoveNode is not a result read. |
Definition at line 2393 of file ExecutionPipelineResource.cc.
References __func__, MoveNode::cycle(), MoveNode::destinationOperation(), ProgramOperation::fuFromOutMove(), SchedulingResource::initiationInterval_, MoveNode::isDestinationOperation(), isLoopBypass(), MoveNode::isScheduled(), TTAMachine::HWOperation::latency(), Operation::name(), ProgramOperation::operation(), ProgramOperation::outputIndexOfMove(), ProgramOperation::outputMove(), and ProgramOperation::outputMoveCount().
Referenced by canAssignDestination().
int ExecutionPipelineResource::nextResultCycle | ( | const TTAMachine::Port & | port, |
int | cycle, | ||
const MoveNode & | node, | ||
const MoveNode * | trigger = NULL , |
||
int | triggerCycle = INT_MAX |
||
) | const |
Returns a cycle in which result of next program operation will be writen to result. This method results the next one of any iteration, not just the current iteration.
cycle | Cycle from which to start testing. |
node | Node for which to test |
Definition at line 1602 of file ExecutionPipelineResource.cc.
References __func__, assert, exclusiveMoves(), MoveNode::guardOperation(), SchedulingResource::initiationInterval_, SchedulingResource::instructionIndex(), MoveNode::isGuardOperation(), MoveNode::isSourceOperation(), resultWriten_, SparseVector< ValueType >::size(), MoveNode::sourceOperation(), and ProgramOperation::triggeringMove().
Referenced by ExecutionPipelineBroker::latestFromSource(), and resultNotOverWritten().
|
private |
Definition at line 2853 of file ExecutionPipelineResource.cc.
References MoveNodeSet::begin(), fu_, ProgramOperation::inputNode(), TTAMachine::HWOperation::io(), Operation::name(), TTAMachine::FunctionUnit::operation(), and ProgramOperation::operation().
|
private |
Definition at line 2131 of file ExecutionPipelineResource.cc.
References __func__, checkOperandAllowed(), MoveNode::destinationOperation(), exclusiveMoves(), SchedulingResource::initiationInterval(), ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), SchedulingResource::instructionIndex(), MoveNode::isDestinationOperation(), MoveNode::isPlaced(), TTAProgram::Move::isUnconditional(), MoveNode::move(), TTAMachine::Port::name(), operandsUsed_, ExecutionPipelineResource::OperandUseHelper::po, SparseVector< ValueType >::size(), MoveNode::toString(), and ProgramOperation::triggeringMove().
Referenced by canAssignDestination(), resultCausesTriggerBetweenOperandSharing(), and triggerAllowedAtCycle().
|
private |
Definition at line 1105 of file ExecutionPipelineResource.cc.
References MoveNode::cycle(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), MoveNode::isPlaced(), operandOverwritten(), MoveNode::toString(), ProgramOperation::toString(), and ProgramOperation::triggeringMove().
|
private |
Definition at line 1137 of file ExecutionPipelineResource.cc.
References TTAProgram::Move::destination(), exclusiveMoves(), fu_, SchedulingResource::initiationInterval_, SchedulingResource::instructionIndex(), MoveNode::move(), TTAMachine::Port::name(), Operation::name(), operandsWriten_, TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), TTAMachine::HWOperation::port(), TTAMachine::HWOperation::slack(), MoveNode::toString(), and ProgramOperation::toString().
Referenced by canAssignDestination(), operandOverwritten(), and operandsOverwritten().
|
private |
Gives the port where from the movenode writes an operand.
Definition at line 2027 of file ExecutionPipelineResource.cc.
References assert, TTAProgram::Move::destination(), MoveNode::destinationOperation(), fu_, MoveNode::isDestinationOperation(), MoveNode::move(), Operation::name(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), and TTAMachine::HWOperation::port().
Referenced by assignDestination(), and unassignDestination().
|
private |
Checks that no other operand of another op is written at exactly same cycle
Definition at line 2106 of file ExecutionPipelineResource.cc.
References exclusiveMoves(), SchedulingResource::instructionIndex(), and operandsWriten_.
Referenced by canAssignDestination().
|
private |
Definition at line 2605 of file ExecutionPipelineResource.cc.
References assert, MoveNode::cycle(), cyclesConflict(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), fu_, SchedulingResource::instructionIndex(), TTAMachine::HWOperation::io(), TTAProgram::Terminal::isFUPort(), MoveNode::isScheduled(), TTAMachine::HWOperation::latency(), MoveNode::move(), Operation::name(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), ProgramOperation::outputIndexOfMove(), ProgramOperation::outputMove(), ProgramOperation::outputMoveCount(), ExecutionPipelineResource::ResultHelper::po, poConflictsWithInputPort(), TTAMachine::HWOperation::port(), TTAProgram::Terminal::port(), ExecutionPipelineResource::ResultHelper::realCycle, resultRead_, TTAProgram::Move::source(), and ProgramOperation::triggeringMove().
Referenced by canAssignDestination().
bool ExecutionPipelineResource::operandsOverwritten | ( | int | triggerCycle, |
const MoveNode & | trigger | ||
) | const |
Definition at line 1216 of file ExecutionPipelineResource.cc.
References MoveNode::cycle(), MoveNode::destinationOperation(), ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), MoveNode::isPlaced(), operandOverwritten(), and ProgramOperation::toString().
Referenced by canAssignDestination().
|
private |
Checks that operand is not scheduled too late(after trigger+slack)
Definition at line 2291 of file ExecutionPipelineResource.cc.
References MoveNode::cycle(), TTAProgram::Move::destination(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), fu_, MoveNode::isPlaced(), MoveNode::move(), Operation::name(), TTAMachine::FUPort::noRegister(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), TTAMachine::HWOperation::port(), TTAMachine::HWOperation::slack(), and ProgramOperation::triggeringMove().
Referenced by canAssignDestination().
|
private |
bool ExecutionPipelineResource::otherTriggerBeforeMyTrigger | ( | const TTAMachine::Port & | port, |
const MoveNode & | node, | ||
int | cycle | ||
) | const |
Definition at line 2425 of file ExecutionPipelineResource.cc.
References MoveNode::cycle(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), exclusiveMoves(), SchedulingResource::instructionIndex(), isDestOpOfMN(), MoveNode::isScheduled(), operandsUsed_, and ProgramOperation::triggeringMove().
Referenced by canAssignDestination().
|
private |
Definition at line 2866 of file ExecutionPipelineResource.cc.
References TTAProgram::Move::destination(), ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), TTAProgram::Terminal::isFUPort(), MoveNode::move(), Operation::name(), Operation::numberOfInputs(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAMachine::Port::parentUnit(), TTAMachine::HWOperation::port(), and TTAProgram::Terminal::port().
Referenced by operandSharePreventsTriggerForScheduledResult().
|
private |
Definition at line 1244 of file ExecutionPipelineResource.cc.
References assert, canAssign(), TTAProgram::Move::destination(), exclusiveMoves(), fuExecutionPipeline_, ExecutionPipelineResourceTable::hasOperation(), TTAProgram::Terminal::hintOperation(), SchedulingResource::initiationInterval(), SchedulingResource::instructionIndex(), TTAProgram::Terminal::isOpcodeSetting(), maxCycle_, ExecutionPipelineResourceTable::maximalLatency(), MoveNode::move(), Operation::name(), ExecutionPipelineResourceTable::numberOfResources(), TTAProgram::Terminal::operation(), ExecutionPipelineResourceTable::operationIndex(), ExecutionPipelineResourceTable::operationPipeline(), resources, SparseVector< ValueType >::size(), and size().
Referenced by canAssignDestination().
|
private |
Tests that a new result at given cycle does not mess up result of some other operation
resultCycle | cycle when the nw result appears @po Programoperation which the new result belongs to @resultPort port where the result is written to @trigger trigger movenode of the operation @triggercycle cycle of the trigger |
Definition at line 1852 of file ExecutionPipelineResource.cc.
References assert, exclusiveMoves(), SchedulingResource::initiationInterval_, SchedulingResource::instructionIndex(), TTAProgram::Move::isUnconditional(), MoveNode::move(), resultPort(), resultRead_, resultReadyCycle(), SparseVector< ValueType >::size(), MoveNode::toString(), and ProgramOperation::toString().
Referenced by canAssignSource(), and testTriggerResult().
|
private |
Definition at line 2488 of file ExecutionPipelineResource.cc.
References TTAProgram::Move::destination(), exclusiveMoves(), ProgramOperation::findTriggerFromUnit(), fu_, SchedulingResource::initiationInterval_, ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), SchedulingResource::instructionIndex(), TTAProgram::Terminal::isFUPort(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), TTAMachine::HWOperation::latency(), MoveNode::move(), Operation::name(), operandAllowedAtCycle(), operandShareCount_, TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), ProgramOperation::outputIndexOfMove(), ExecutionPipelineResource::ResultHelper::po, TTAMachine::HWOperation::port(), ExecutionPipelineResource::ResultHelper::realCycle, resultRead_, MoveNode::sourceOperation(), and ProgramOperation::triggeringMove().
Referenced by canAssignSource().
bool ExecutionPipelineResource::resultNotOverWritten | ( | int | resultReadCycle, |
int | resultReadyCycle, | ||
const MoveNode & | node, | ||
const TTAMachine::Port & | resultPort, | ||
const MoveNode * | trigger, | ||
int | triggerCycle | ||
) | const |
Returns if the result can be scheduled to given cycle so that the results of other operations do not overwrite it.
resultReadCycle | cycle when the result is read |
resultReadyCycle | cycle when the result becomes available |
po | ProgramOperation where the result move belongs |
node | the result read node being scheduled |
resultPort | the port which is being read by the result |
trigger | Trigger of the program operation |
triggercycle | cycle of the trigger of the PO |
Definition at line 2048 of file ExecutionPipelineResource.cc.
References SchedulingResource::initiationInterval_, SchedulingResource::instructionIndex(), nextResultCycle(), resultPort(), and resultReadyCycle().
Referenced by canAssignSource(), ExecutionPipelineBroker::earliestFromSource(), and testTriggerResult().
|
private |
Gives the port where from the movenode reads a result.
Definition at line 2010 of file ExecutionPipelineResource.cc.
References assert, fu_, TTAProgram::MoveGuard::guard(), TTAProgram::Move::guard(), MoveNode::isGuardOperation(), MoveNode::isSourceOperation(), MoveNode::move(), Operation::name(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), TTAMachine::HWOperation::port(), TTAProgram::Move::source(), and MoveNode::sourceOperation().
Referenced by assignSource(), canAssignSource(), resultAllowedAtCycle(), resultNotOverWritten(), resultReadyCycle(), and unassignSource().
|
private |
Returns cycle when result of some PO is ready.
po | programoperation int resultReadCycle cycle when the result is read |
@TODO: multiple out values still not supported correctly.
Definition at line 1677 of file ExecutionPipelineResource.cc.
References MoveNode::cycle(), fu_, MoveNode::isPlaced(), TTAMachine::HWOperation::latency(), Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAMachine::HWOperation::port(), resultPort(), ProgramOperation::toString(), and ProgramOperation::triggeringMove().
Referenced by resultAllowedAtCycle(), and resultNotOverWritten().
void ExecutionPipelineResource::setDDG | ( | const DataDependenceGraph * | ddg | ) |
Definition at line 1776 of file ExecutionPipelineResource.cc.
References ddg_.
|
inlineoverridevirtual |
Reimplemented from SchedulingResource.
Definition at line 116 of file ExecutionPipelineResource.hh.
References maxCycle_.
|
private |
Definition at line 283 of file ExecutionPipelineResource.cc.
References fu_, Operation::name(), Operation::numberOfInputs(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAMachine::HWOperation::port(), setOperandUsed(), and TTAMachine::HWOperation::slack().
Referenced by assignDestination().
|
private |
Definition at line 241 of file ExecutionPipelineResource.cc.
References assert, SchedulingResource::instructionIndex(), and operandsUsed_.
Referenced by setOperandsUsed().
|
private |
Definition at line 266 of file ExecutionPipelineResource.cc.
References fu_, TTAMachine::HWOperation::latency(), Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAMachine::HWOperation::port(), and setResultWriten().
|
private |
Definition at line 211 of file ExecutionPipelineResource.cc.
References SchedulingResource::instructionIndex(), and resultWriten_.
Referenced by assignDestination(), assignSource(), and setResultWriten().
|
protected |
Return number of cycles current execution pipeline for FU contains. Effectively, highest cycle in which any of the resources of an FU is occupied plus 1.
Definition at line 1417 of file ExecutionPipelineResource.cc.
References assignedDestinationNodes_, assignedSourceNodes_, cachedSize_, fuExecutionPipeline_, ExecutionPipelineResourceTable::numberOfResources(), resources, and SparseVector< ValueType >::size().
Referenced by assignDestination(), highestKnownCycle(), isInUse(), resourcesAllowTrigger(), and unassignDestination().
|
private |
Tests the conflicts caused by results if a trigger is scheduled to given cycle.
Definition at line 1785 of file ExecutionPipelineResource.cc.
References assert, MoveNode::cycle(), MoveNode::destinationOperation(), fu_, MoveNode::guardOperation(), SchedulingResource::initiationInterval_, TTAProgram::Terminal::isFUPort(), MoveNode::isGuardOperation(), isLoopBypass(), MoveNode::isPlaced(), MoveNode::isSourceOperation(), TTAMachine::HWOperation::latency(), MoveNode::move(), Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), ProgramOperation::outputIndexFromGuardOfMove(), ProgramOperation::outputMove(), ProgramOperation::outputMoveCount(), TTAMachine::HWOperation::port(), resultAllowedAtCycle(), resultNotOverWritten(), TTAProgram::Move::source(), MoveNode::sourceOperation(), and MoveNode::toString().
Referenced by canAssignDestination().
|
private |
Definition at line 2369 of file ExecutionPipelineResource.cc.
References operandAllowedAtCycle(), and TTAMachine::HWOperation::port().
Referenced by canAssignDestination().
|
private |
Checks that trigger is not scheduled too early(before operand-slack)
Definition at line 2327 of file ExecutionPipelineResource.cc.
References MoveNode::cycle(), TTAProgram::Move::destination(), MoveNode::destinationOperation(), fu_, ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), MoveNode::isPlaced(), MoveNode::move(), Operation::name(), TTAMachine::FUPort::noRegister(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAProgram::Terminal::operationIndex(), TTAProgram::Terminal::port(), TTAMachine::HWOperation::slack(), MoveNode::toString(), and ProgramOperation::toString().
Referenced by canAssignDestination().
|
overridevirtual |
Implements SchedulingResource.
Definition at line 582 of file ExecutionPipelineResource.cc.
References abortWithError.
|
virtual |
Unassign resource from given node for given cycle.
cycle | Cycle to remove assignment from |
node | MoveNode to remove assignment from in case move is bypassed |
In | case there was no previous assignment or wrong operation is unassigned |
Now unassing destination part of move
Definition at line 676 of file ExecutionPipelineResource.cc.
References __func__, assert, assignedDestinationNodes_, MapTools::containsValue(), TTAProgram::Move::destination(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), fuExecutionPipeline_, ExecutionPipelineResourceTable::hasOperation(), TTAProgram::Terminal::hintOperation(), SchedulingResource::initiationInterval_, SchedulingResource::instructionIndex(), MoveNode::isDestinationOperation(), TTAProgram::Terminal::isOpcodeSetting(), TTAProgram::Terminal::isTriggering(), ExecutionPipelineResourceTable::maximalLatency(), MoveNode::move(), Operation::name(), ExecutionPipelineResourceTable::numberOfResources(), operandPort(), operandShareCount_, operandsWriten_, TTAProgram::Terminal::operation(), ExecutionPipelineResourceTable::operationIndex(), ExecutionPipelineResourceTable::operationPipeline(), MapTools::removeItemsByValue(), resources, SparseVector< ValueType >::size(), size(), Conversion::toString(), MoveNode::toString(), unsetOperandsUsed(), and unsetResultWriten().
Referenced by InputFUResource::unassign().
|
virtual |
Unassign resource from given node for given cycle.
cycle | Cycle to remove assignment from |
node | MoveNode to remove assignment from |
source | Indicates if we want to unassign source part of move in case move is bypassed |
In | case there was no previous assignment or wrong operation is unassigned |
Unscheduling result read
Remove record of result beeing written to result register or decrease count in case there are more results
Remove record or decrease count of result read moves
Remove record or decrease count of result read moves
Definition at line 597 of file ExecutionPipelineResource.cc.
References __func__, assert, assignedSourceNodes_, cachedSize_, MapTools::containsKey(), MapTools::containsValue(), MoveNode::cycle(), MoveNode::guardOperation(), SchedulingResource::initiationInterval_, SchedulingResource::instructionIndex(), MoveNode::isSourceOperation(), MapTools::removeItemsByValue(), resultPort(), resultRead_, SparseVector< ValueType >::size(), MoveNode::sourceOperation(), storedResultCycles_, and unsetResultWriten().
Referenced by OutputFUResource::unassign().
|
private |
Definition at line 377 of file ExecutionPipelineResource.cc.
References fu_, Operation::name(), Operation::numberOfInputs(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAMachine::HWOperation::port(), TTAMachine::HWOperation::slack(), and unsetOperandUsed().
Referenced by unassignDestination().
|
private |
Definition at line 336 of file ExecutionPipelineResource.cc.
References assert, SchedulingResource::instructionIndex(), and operandsUsed_.
Referenced by unsetOperandsUsed().
|
private |
Definition at line 360 of file ExecutionPipelineResource.cc.
References fu_, TTAMachine::HWOperation::latency(), Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), TTAMachine::FunctionUnit::operation(), ProgramOperation::operation(), TTAMachine::HWOperation::port(), and unsetResultWriten().
|
private |
Definition at line 305 of file ExecutionPipelineResource.cc.
References assert, SchedulingResource::instructionIndex(), and resultWriten_.
Referenced by unassignDestination(), unassignSource(), and unsetResultWriten().
|
overrideprotectedvirtual |
Tests if all referred resources in dependent groups are of proper types.
Reimplemented from SchedulingResource.
Definition at line 1388 of file ExecutionPipelineResource.cc.
|
overrideprotectedvirtual |
Tests if all resources in related resource groups are of proper types.
Reimplemented from SchedulingResource.
Definition at line 1399 of file ExecutionPipelineResource.cc.
References SchedulingResource::isInputPSocketResource(), SchedulingResource::relatedResource(), SchedulingResource::relatedResourceCount(), and SchedulingResource::relatedResourceGroupCount().
|
private |
Definition at line 325 of file ExecutionPipelineResource.hh.
Referenced by assignDestination(), clear(), highestKnownCycle(), size(), and unassignDestination().
|
private |
Definition at line 323 of file ExecutionPipelineResource.hh.
Referenced by assignSource(), clear(), highestKnownCycle(), size(), and unassignSource().
|
mutableprivate |
Definition at line 327 of file ExecutionPipelineResource.hh.
Referenced by assignDestination(), assignSource(), clear(), size(), and unassignSource().
|
private |
Definition at line 330 of file ExecutionPipelineResource.hh.
Referenced by clear(), exclusiveMoves(), isLoopBypass(), and setDDG().
|
private |
Definition at line 331 of file ExecutionPipelineResource.hh.
Referenced by canAssignDestination(), canAssignSource(), isAvailable(), nodeOfInputPort(), operandOverwritten(), operandPort(), operandSharePreventsTriggerForScheduledResult(), operandTooLate(), resultCausesTriggerBetweenOperandSharing(), resultPort(), resultReadyCycle(), setOperandsUsed(), setResultWriten(), testTriggerResult(), triggerTooEarly(), unsetOperandsUsed(), and unsetResultWriten().
|
mutableprivate |
Stores one resource vector per cycle of scope for whole FU.
Definition at line 298 of file ExecutionPipelineResource.hh.
Referenced by assignDestination(), clear(), isInUse(), resourcesAllowTrigger(), size(), and unassignDestination().
|
private |
Definition at line 328 of file ExecutionPipelineResource.hh.
Referenced by resourcesAllowTrigger(), and setMaxCycle().
|
private |
Definition at line 336 of file ExecutionPipelineResource.hh.
Referenced by assignDestination(), clear(), resultCausesTriggerBetweenOperandSharing(), and unassignDestination().
|
private |
Definition at line 310 of file ExecutionPipelineResource.hh.
Referenced by clear(), operandAllowedAtCycle(), otherTriggerBeforeMyTrigger(), setOperandUsed(), and unsetOperandUsed().
|
private |
Definition at line 309 of file ExecutionPipelineResource.hh.
Referenced by assignDestination(), clear(), isAvailable(), isInUse(), operandOverwritten(), operandPossibleAtCycle(), and unassignDestination().
|
private |
Definition at line 295 of file ExecutionPipelineResource.hh.
Referenced by assignDestination(), isInUse(), resourcesAllowTrigger(), size(), and unassignDestination().
|
private |
Definition at line 316 of file ExecutionPipelineResource.hh.
Referenced by assignSource(), clear(), highestKnownCycle(), isInUse(), operandSharePreventsTriggerForScheduledResult(), resultAllowedAtCycle(), resultCausesTriggerBetweenOperandSharing(), and unassignSource().
|
private |
Definition at line 313 of file ExecutionPipelineResource.hh.
Referenced by clear(), hasConflictingResultsOnCycle(), highestKnownCycle(), nextResultCycle(), setResultWriten(), and unsetResultWriten().
|
private |
Definition at line 321 of file ExecutionPipelineResource.hh.
Referenced by assignSource(), clear(), and unassignSource().
|
private |
Definition at line 334 of file ExecutionPipelineResource.hh.