OpenASIP
2.0
|
#include <CriticalPathBBMoveNodeSelector.hh>
Public Member Functions | |
CriticalPathBBMoveNodeSelector (TTAProgram::BasicBlock &bb, const TTAMachine::Machine &machine) | |
CriticalPathBBMoveNodeSelector (DataDependenceGraph &bigDDG, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &machine) | |
CriticalPathBBMoveNodeSelector (DataDependenceGraph &ddg, const TTAMachine::Machine &machine) | |
virtual | ~CriticalPathBBMoveNodeSelector () |
virtual MoveNodeGroup | candidates () |
virtual void | notifyScheduled (MoveNode &node) |
virtual DataDependenceGraph & | dataDependenceGraph () |
void | mightBeReady (MoveNode &node) |
Public Member Functions inherited from MoveNodeSelector | |
MoveNodeSelector () | |
virtual | ~MoveNodeSelector () |
Private Member Functions | |
bool | isReadyToBeScheduled (MoveNode &node) const |
void | initializeReadylist () |
Initializes ready list from nodes that are ready. More... | |
Private Attributes | |
DataDependenceGraph * | ddg_ |
The data dependence graph built from the basic block. More... | |
ReadyMoveNodeGroupList | readyList_ |
The prioritized ready list. More... | |
bool | ddgOwned_ |
Selects move nodes from a basic block and prioritizes move nodes on the critical path of the data dependence graph.
Definition at line 70 of file CriticalPathBBMoveNodeSelector.hh.
CriticalPathBBMoveNodeSelector::CriticalPathBBMoveNodeSelector | ( | TTAProgram::BasicBlock & | bb, |
const TTAMachine::Machine & | machine | ||
) |
Constructor.
bb | The basic block from which to select moves. |
Definition at line 96 of file CriticalPathBBMoveNodeSelector.cc.
References DataDependenceGraphBuilder::build(), ddg_, initializeReadylist(), DataDependenceGraph::INTRA_BB_ANTIDEPS, machine, DataDependenceGraph::setCycleGrouping(), DataDependenceGraph::setMachine(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
CriticalPathBBMoveNodeSelector::CriticalPathBBMoveNodeSelector | ( | DataDependenceGraph & | bigDDG, |
TTAProgram::BasicBlock & | bb, | ||
const TTAMachine::Machine & | machine | ||
) |
Constructor. Creates subgraph of the given big graph
bigDDG | big ddg containing more than just the basic block |
bb | basic block for this selector. |
Definition at line 75 of file CriticalPathBBMoveNodeSelector.cc.
References __func__, DataDependenceGraph::createSubgraph(), ddg_, initializeReadylist(), machine, Exception::setCause(), and DataDependenceGraph::setMachine().
CriticalPathBBMoveNodeSelector::CriticalPathBBMoveNodeSelector | ( | DataDependenceGraph & | ddg, |
const TTAMachine::Machine & | machine | ||
) |
Constructor.
ddg | The data dependence graph from which to select moves. Selector does not take the ownership of the ddg. |
Definition at line 119 of file CriticalPathBBMoveNodeSelector.cc.
References ddg_, initializeReadylist(), machine, DataDependenceGraph::setCycleGrouping(), DataDependenceGraph::setMachine(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
|
virtual |
|
virtual |
Returns a group of move nodes which should be scheduled next.
Implements MoveNodeSelector.
Definition at line 148 of file CriticalPathBBMoveNodeSelector.cc.
References ddg_, MoveNodeGroup::isAlive(), MoveNodeGroup::isScheduled(), mightBeReady(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), readyList_, DataDependenceGraph::scheduledNodeCount(), and DataDependenceGraph::unscheduledMoves().
Referenced by BasicBlockScheduler::handleDDG(), BasicBlockScheduler::handleLoopDDG(), and ResourceConstraintAnalyzer::memoryBoundScheduleResourceUsage().
|
virtual |
Returns the DDG used internally.
This is needed temporarily only until the MoveNodeManager is done.
Definition at line 191 of file CriticalPathBBMoveNodeSelector.cc.
References ddg_.
|
private |
Initializes ready list from nodes that are ready.
Add the unscheduled root nodes of the DDG to the ready list
Definition at line 50 of file CriticalPathBBMoveNodeSelector.cc.
References ddg_, TTAProgram::Move::destination(), MoveNode::isDestinationOperation(), mightBeReady(), MoveNode::move(), TTAProgram::Terminal::operationIndex(), and BoostGraph< GraphNode, GraphEdge >::rootNodes().
Referenced by CriticalPathBBMoveNodeSelector().
|
private |
Returns true in case the move is "data ready", that is, all its predecessors have been scheduled.
It should be noted that moves within same operation are treated specially. Result move is considered ready even if the operands moves are not to allow scheduling all moves in the same operation as a single entity. Additionally, as we are considering a basic block at a time, the branch operation is considered never ready before all the other moves in the basic block have been scheduled.
node | Move to check. |
Definition at line 324 of file CriticalPathBBMoveNodeSelector.cc.
References ddg_, TTAProgram::Move::isControlFlowMove(), MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), DataDependenceGraph::predecessorsReady(), DataDependenceGraph::scheduledNodeCount(), and DataDependenceGraph::unscheduledMoves().
Referenced by mightBeReady().
|
virtual |
Adds the given move node (along with the other possible move nodes in the same operation) to the ready list in case all its parents in the DDG have been scheduled.
In case the node belongs to an operation, also checks that the other operand moves are also ready. In that case adds all the nodes in the said MoveOperation to the ready list in a single MoveNodeGroup.
node | Move node that might be ready. |
Implements MoveNodeSelector.
Definition at line 235 of file CriticalPathBBMoveNodeSelector.cc.
References __func__, MoveNodeGroup::addNode(), ddg_, TTAProgram::Move::destination(), MoveNode::destinationOperation(), POMDisassembler::disassemble(), ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), MoveNode::isDestinationOperation(), MoveNode::isDestinationVariable(), TTAProgram::Terminal::isRA(), isReadyToBeScheduled(), MoveNode::isScheduled(), MoveNode::isSourceConstant(), MoveNode::isSourceOperation(), MoveNode::isSourceVariable(), MoveNode::move(), ProgramOperation::outputMove(), ProgramOperation::outputMoveCount(), readyList_, TTAProgram::Move::source(), and MoveNode::sourceOperation().
Referenced by candidates(), initializeReadylist(), and notifyScheduled().
|
virtual |
This should be called by the client as soon as a MoveNode is scheduled in order to update the internal state of the selector.
node | The scheduled MoveNode. |
Implements MoveNodeSelector.
Definition at line 202 of file CriticalPathBBMoveNodeSelector.cc.
References assert, ddg_, MoveNode::inSameOperation(), MoveNode::isScheduled(), mightBeReady(), DataDependenceGraph::setCycleGrouping(), BoostGraph< GraphNode, GraphEdge >::successors(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by ResourceConstraintAnalyzer::memoryBoundScheduleResourceUsage().
|
private |
The data dependence graph built from the basic block.
Definition at line 96 of file CriticalPathBBMoveNodeSelector.hh.
Referenced by candidates(), CriticalPathBBMoveNodeSelector(), dataDependenceGraph(), initializeReadylist(), isReadyToBeScheduled(), mightBeReady(), notifyScheduled(), and ~CriticalPathBBMoveNodeSelector().
|
private |
Definition at line 100 of file CriticalPathBBMoveNodeSelector.hh.
Referenced by ~CriticalPathBBMoveNodeSelector().
|
private |
The prioritized ready list.
Definition at line 98 of file CriticalPathBBMoveNodeSelector.hh.
Referenced by candidates(), and mightBeReady().