OpenASIP
2.0
|
#include <BUMoveNodeSelector.hh>
Public Member Functions | |
BUMoveNodeSelector (TTAProgram::BasicBlock &bb, const TTAMachine::Machine &machine) | |
BUMoveNodeSelector (DataDependenceGraph &bigDDG, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &machine) | |
BUMoveNodeSelector (DataDependenceGraph &ddg, const TTAMachine::Machine &machine) | |
virtual | ~BUMoveNodeSelector () |
virtual MoveNodeGroup | candidates () |
virtual void | notifyScheduled (MoveNode &node) |
virtual void | mightBeReady (MoveNode &node) |
virtual DataDependenceGraph & | dataDependenceGraph () |
virtual void | initializeReadylist () |
Initializes ready list from nodes that are ready. More... | |
Public Member Functions inherited from MoveNodeSelector | |
MoveNodeSelector () | |
virtual | ~MoveNodeSelector () |
Static Public Member Functions | |
static void | queueOperation (ProgramOperation &po, const DataDependenceGraph::NodeSet &nodes, DataDependenceGraph::NodeSet &queue) |
Private Member Functions | |
bool | isReadyToBeScheduled (DataDependenceGraph::NodeSet &nodes) const |
bool | isReadyToBeScheduled (MoveNode &mn, DataDependenceGraph::NodeSet &nodes) const |
virtual bool | isReadyToBeScheduled (MoveNodeGroup &nodes) const |
Private Attributes | |
DataDependenceGraph * | ddg_ |
The data dependence graph built from the basic block. More... | |
ReadyMoveNodeGroupListBU | 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. This version prioritiezed for bottom up scheduling.
Definition at line 70 of file BUMoveNodeSelector.hh.
BUMoveNodeSelector::BUMoveNodeSelector | ( | TTAProgram::BasicBlock & | bb, |
const TTAMachine::Machine & | machine | ||
) |
Constructor.
bb | The basic block from which to select moves. |
Definition at line 109 of file BUMoveNodeSelector.cc.
References DataDependenceGraphBuilder::build(), ddg_, initializeReadylist(), DataDependenceGraph::INTRA_BB_ANTIDEPS, machine, DataDependenceGraph::setCycleGrouping(), DataDependenceGraph::setMachine(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
BUMoveNodeSelector::BUMoveNodeSelector | ( | 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 88 of file BUMoveNodeSelector.cc.
References __func__, DataDependenceGraph::createSubgraph(), ddg_, initializeReadylist(), machine, Exception::setCause(), and DataDependenceGraph::setMachine().
BUMoveNodeSelector::BUMoveNodeSelector | ( | 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 129 of file BUMoveNodeSelector.cc.
References ddg_, initializeReadylist(), machine, and DataDependenceGraph::setMachine().
|
virtual |
|
virtual |
Returns a group of move nodes which should be scheduled next.
Implements MoveNodeSelector.
Definition at line 157 of file BUMoveNodeSelector.cc.
References abortWithError, ddg_, MoveNodeGroup::isAlive(), isReadyToBeScheduled(), MoveNodeGroup::isScheduled(), BoostGraph< GraphNode, GraphEdge >::maxSinkDistance(), BoostGraph< GraphNode, GraphEdge >::maxSourceDistance(), mightBeReady(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), readyList_, DataDependenceGraph::scheduledNodeCount(), MoveNode::toString(), DataDependenceGraph::unscheduledMoves(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by BUBasicBlockScheduler::handleDDG(), BUBasicBlockScheduler::handleLoopDDG(), BF2Scheduler::handleLoopDDG(), and BF2Scheduler::scheduleDDG().
|
virtual |
|
virtual |
Initializes ready list from nodes that are ready.
Add the unscheduled sink nodes of the DDG to the ready list
Definition at line 57 of file BUMoveNodeSelector.cc.
References ddg_, TTAProgram::Move::destination(), MoveNode::isDestinationOperation(), TTAProgram::Terminal::isFUPort(), mightBeReady(), MoveNode::move(), TTAProgram::Terminal::operationIndex(), readyList_, BoostGraph< GraphNode, GraphEdge >::sinkNodes(), MoveNode::toString(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by BUMoveNodeSelector(), and BF2Scheduler::handleLoopDDG().
|
private |
Returns true in case the move is "data ready", that is, all its successors have been scheduled.
It should be noted that moves within same operation are treated specially. Additionally, as we are considering a basic block at a time, the branch operation is considered always ready before all the other moves in the basic block have been scheduled.
node | Move to check. |
Definition at line 349 of file BUMoveNodeSelector.cc.
Referenced by candidates(), isReadyToBeScheduled(), and mightBeReady().
|
private |
Definition at line 362 of file BUMoveNodeSelector.cc.
References ddg_, BoostGraph< GraphNode, GraphEdge >::hasNode(), and DataDependenceGraph::otherSuccessorsScheduled().
|
privatevirtual |
Definition at line 372 of file BUMoveNodeSelector.cc.
References isReadyToBeScheduled(), MoveNodeGroup::node(), and MoveNodeGroup::nodeCount().
|
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 children in the DDG have been scheduled.
In case the node belongs to an operation, also checks that the other result 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 237 of file BUMoveNodeSelector.cc.
References MoveNodeGroup::addNode(), ddg_, TTAProgram::Move::destination(), MoveNode::destinationOperation(), MoveNode::destinationOperationCount(), BoostGraph< GraphNode, GraphEdge >::hasNode(), isReadyToBeScheduled(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), TTAProgram::Terminal::isUniversalMachineRegister(), MoveNode::move(), MoveNodeGroup::nodeCount(), DataDependenceGraph::onlyRegisterRawDestinations(), DataDependenceGraph::onlyRegisterRawSource(), queueOperation(), readyList_, TTAProgram::Move::source(), and MoveNode::sourceOperation().
Referenced by candidates(), BUBasicBlockScheduler::finalizeSchedule(), initializeReadylist(), notifyScheduled(), and BF2ScheduleFront::scheduleFrontFromMove().
|
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 209 of file BUMoveNodeSelector.cc.
References assert, ddg_, MoveNode::inSameOperation(), MoveNode::isScheduled(), mightBeReady(), and BoostGraph< GraphNode, GraphEdge >::predecessors().
Referenced by BUBasicBlockScheduler::finalizeSchedule(), and BF2ScheduleFront::scheduleFrontFromMove().
|
static |
Queues all nodes of PO into queue, if they are not already in another set.
po | ProgramOperation whose nodes to add |
nodes | nodes where the final result is. if node is here, do not add to queue |
queue | quque where to add the nodes. |
Definition at line 315 of file BUMoveNodeSelector.cc.
References ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), ProgramOperation::outputMove(), and ProgramOperation::outputMoveCount().
Referenced by BF2ScheduleFront::allNodesOfSameOperation(), and mightBeReady().
|
private |
The data dependence graph built from the basic block.
Definition at line 101 of file BUMoveNodeSelector.hh.
Referenced by BUMoveNodeSelector(), candidates(), dataDependenceGraph(), initializeReadylist(), isReadyToBeScheduled(), mightBeReady(), notifyScheduled(), and ~BUMoveNodeSelector().
|
private |
Definition at line 105 of file BUMoveNodeSelector.hh.
Referenced by ~BUMoveNodeSelector().
|
private |
The prioritized ready list.
Definition at line 103 of file BUMoveNodeSelector.hh.
Referenced by candidates(), initializeReadylist(), and mightBeReady().