OpenASIP
2.0
|
#include <ResourceConstraintAnalyzer.hh>
Public Member Functions | |
ResourceConstraintAnalyzer (DataDependenceGraph &ddg, SimpleResourceManager &rm, TCEString graphName) | |
virtual | ~ResourceConstraintAnalyzer () |
void | analyzePreSchedule () |
bool | analyze () |
Private Types | |
typedef std::map< std::string, int > | RFCountMap |
typedef std::map< std::string, int > | OperationCountMap |
Private Member Functions | |
bool | analyzeRegisterAntideps (DataDependenceGraph &ddg, std::ostream &s) |
bool | analyzeMoveNode (const MoveNode &node) |
MoveNode * | findResourceConstrainedParent (MoveNode *child) |
void | optimalScheduleResourceUsage (DataDependenceGraph &ddg, TCEString graphName) |
void | memoryBoundScheduleResourceUsage (DataDependenceGraph &ddg, TCEString graphName) |
void | dumpGraphWithStats (DataDependenceGraph &ddg, TCEString dotFileName, const std::map< int, std::list< MoveNode * > > &schedule) |
Private Attributes | |
int | busConstrained_ |
int | operationConstrained_ |
int | rfWritePortConstrained_ |
int | rfReadPortConstrained_ |
int | minScheduleLength_ |
int | unknownConstrained_ |
RFCountMap | writePortConstrainedRfs_ |
RFCountMap | readPortConstrainedRfs_ |
OperationCountMap | operationConstrainedMoves_ |
DataDependenceGraph & | origDDG_ |
SimpleResourceManager & | rm_ |
std::set< MoveNode * > | foundMoves_ |
TCEString | graphName_ |
A class that analyzes the most important resource constraints in the given scheduled basic block DDG.
Definition at line 49 of file ResourceConstraintAnalyzer.hh.
|
private |
Definition at line 80 of file ResourceConstraintAnalyzer.hh.
|
private |
Definition at line 79 of file ResourceConstraintAnalyzer.hh.
|
inline |
Definition at line 51 of file ResourceConstraintAnalyzer.hh.
|
inlinevirtual |
Definition at line 56 of file ResourceConstraintAnalyzer.hh.
bool ResourceConstraintAnalyzer::analyze | ( | ) |
Analyzes the resource constraints in the schedule.
Definition at line 62 of file ResourceConstraintAnalyzer.cc.
References busConstrained_, DataDependenceGraph::criticalPathGraph(), MoveNode::cycle(), DataDependenceGraph::EWH_DEFAULT, DataDependenceGraph::EWH_REAL, findResourceConstrainedParent(), foundMoves_, graphName_, Application::logStream(), DataDependenceGraph::memoryDependenceGraph(), minScheduleLength_, MoveNode::move(), operationConstrained_, operationConstrainedMoves_, optimalScheduleResourceUsage(), origDDG_, readPortConstrainedRfs_, rfReadPortConstrained_, rfWritePortConstrained_, DataDependenceGraph::setEdgeWeightHeuristics(), DataDependenceGraph::setProgramOperationNodes(), TTAProgram::Move::toString(), unknownConstrained_, writePortConstrainedRfs_, and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by BBSchedulerController::executeDDGPass().
|
private |
Analyzes the resource constraints of a single move in the schedule.
Definition at line 717 of file ResourceConstraintAnalyzer.cc.
References busConstrained_, TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), MoveNode::cycle(), TTAProgram::Move::destination(), MoveNode::destinationOperation(), DataDependenceGraph::earliestCycle(), ProgramOperation::inputMove(), ProgramOperation::inputMoveCount(), SimpleResourceManager::instruction(), MoveNode::isDestinationOperation(), TTAProgram::Terminal::isGPR(), TTAProgram::Move::isJump(), MoveNode::isSourceOperation(), TTAProgram::Move::isTriggering(), Application::logStream(), DataDependenceGraph::machine(), TTAMachine::RegisterFile::maxReads(), TTAMachine::RegisterFile::maxWrites(), TTAProgram::Instruction::move(), MoveNode::move(), TTAProgram::Instruction::moveCount(), TTAMachine::Component::name(), Operation::name(), ProgramOperation::opcodeSettingNode(), ProgramOperation::operation(), operationConstrained_, operationConstrainedMoves_, origDDG_, readPortConstrainedRfs_, TTAProgram::Terminal::registerFile(), rfReadPortConstrained_, rfWritePortConstrained_, rm_, TTAProgram::Move::source(), MoveNode::sourceOperation(), TTAProgram::Move::toString(), TTAProgram::Instruction::toString(), MoveNode::toString(), ProgramOperation::toString(), ProgramOperation::triggeringMove(), unknownConstrained_, and writePortConstrainedRfs_.
Referenced by findResourceConstrainedParent().
void ResourceConstraintAnalyzer::analyzePreSchedule | ( | ) |
Definition at line 50 of file ResourceConstraintAnalyzer.cc.
References graphName_, memoryBoundScheduleResourceUsage(), origDDG_, and DataDependenceGraph::setProgramOperationNodes().
Referenced by BBSchedulerController::executeDDGPass().
|
private |
Analyzes the register antideps in the schedule.
Definition at line 560 of file ResourceConstraintAnalyzer.cc.
References DataDependenceEdge::DEP_WAR, DataDependenceEdge::dependenceType(), TTAProgram::Move::destination(), DataDependenceEdge::EDGE_REGISTER, DataDependenceEdge::edgeReason(), Exception::errorMessage(), DataDependenceGraph::EWH_DEFAULT, DataDependenceGraph::EWH_REAL, graphName_, TTAProgram::MoveGuard::guard(), TTAProgram::Move::guard(), BoostGraph< GraphNode, GraphEdge >::hasPath(), BoostGraph< GraphNode, GraphEdge >::headNode(), BoostGraph< GraphNode, GraphEdge >::height(), DataDependenceEdge::isFalseDep(), TTAProgram::Terminal::isGPR(), DataDependenceGraph::largestCycle(), Application::logStream(), DataDependenceEdge::loopDepth(), MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::node(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), BoostGraph< GraphNode, GraphEdge >::outDegree(), BoostGraph< GraphNode, GraphEdge >::outEdge(), TTAProgram::Terminal::registerFile(), TTAMachine::RegisterGuard::registerFile(), DataDependenceGraph::setEdgeWeightHeuristics(), DataDependenceGraph::smallestCycle(), TTAProgram::Move::source(), DataDependenceEdge::toString(), TTAProgram::Move::toString(), MoveNode::toString(), DataDependenceGraph::trueDependenceGraph(), Application::verboseLevel(), TTAMachine::BaseRegisterFile::width(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by dumpGraphWithStats().
|
private |
Definition at line 241 of file ResourceConstraintAnalyzer.cc.
References analyzeRegisterAntideps(), AssocTools::containsKey(), MoveNode::cycle(), MoveNode::destinationOperation(), GraphEdge::dotString(), MoveNode::dotString(), BoostGraph< GraphNode, GraphEdge >::edge(), BoostGraph< GraphNode, GraphEdge >::edgeCount(), DataDependenceGraph::EWH_DEFAULT, DataDependenceGraph::EWH_REAL, BoostGraph< GraphNode, GraphEdge >::headNode(), MoveNode::isBypass(), MoveNode::isDestinationOperation(), MoveNode::isSourceConstant(), BoostGraph< GraphNode, GraphEdge >::maxSourceDistance(), Operation::name(), BoostGraph< GraphNode, GraphEdge >::node(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), GraphNode::nodeID(), ProgramOperation::operation(), DataDependenceGraph::setEdgeWeightHeuristics(), MoveNode::sourceOperation(), BoostGraph< GraphNode, GraphEdge >::tailNode(), and MoveNode::toString().
Referenced by memoryBoundScheduleResourceUsage(), and optimalScheduleResourceUsage().
Finds a move that is a (grand)parent of the given move (or the move itself) and constraints the schedule, that is, could be scheduled before the minimum schedule length in case a resource constraint was removed.
A recursive function.
Definition at line 688 of file ResourceConstraintAnalyzer.cc.
References analyzeMoveNode(), DataDependenceGraph::earliestCycle(), foundMoves_, MoveNode::isMove(), minScheduleLength_, origDDG_, and BoostGraph< GraphNode, GraphEdge >::predecessors().
Referenced by analyze().
|
private |
Analyses the program based on a memory resource constrained schedule.
Produces statistics of maximum number of parallel operations that can be potentially utilized given that there's only a fixed number of parallel memory operations allowed.
Definition at line 466 of file ResourceConstraintAnalyzer.cc.
References CriticalPathBBMoveNodeSelector::candidates(), dumpGraphWithStats(), DataDependenceGraph::earliestCycle(), DataDependenceGraph::EWH_DEFAULT, DataDependenceGraph::EWH_REAL, MoveNode::isPlaced(), Application::logStream(), DataDependenceGraph::machine(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), CriticalPathBBMoveNodeSelector::notifyScheduled(), MoveNodeGroup::programOperationPtr(), DataDependenceGraph::scheduledMoves(), MoveNode::setCycle(), DataDependenceGraph::setEdgeWeightHeuristics(), MoveNode::toString(), and Operation::usesMemory().
Referenced by analyzePreSchedule().
|
private |
Analyses the program based on a non-resource constrained schedule.
Produces statistics of maximum number of parallel operations that can be potentially utilized.
Definition at line 424 of file ResourceConstraintAnalyzer.cc.
References MoveNode::destinationOperation(), dumpGraphWithStats(), DataDependenceGraph::EWH_DEFAULT, DataDependenceGraph::EWH_REAL, ProgramOperation::inputMove(), MoveNode::isDestinationOperation(), TTAProgram::Terminal::isImmediate(), BoostGraph< GraphNode, GraphEdge >::maxSourceDistance(), MoveNode::move(), BoostGraph< GraphNode, GraphEdge >::node(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), DataDependenceGraph::setEdgeWeightHeuristics(), TTAProgram::Move::source(), and GraphBase< GraphNode, GraphEdge >::writeToDotFile().
Referenced by analyze().
|
private |
Definition at line 82 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and analyzeMoveNode().
|
private |
Definition at line 97 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and findResourceConstrainedParent().
|
private |
Definition at line 99 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), analyzePreSchedule(), and analyzeRegisterAntideps().
|
private |
Definition at line 86 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and findResourceConstrainedParent().
|
private |
Definition at line 83 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and analyzeMoveNode().
|
private |
Definition at line 92 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and analyzeMoveNode().
|
private |
Definition at line 94 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), analyzeMoveNode(), analyzePreSchedule(), and findResourceConstrainedParent().
|
private |
Definition at line 90 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and analyzeMoveNode().
|
private |
Definition at line 85 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and analyzeMoveNode().
|
private |
Definition at line 84 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and analyzeMoveNode().
|
private |
Definition at line 95 of file ResourceConstraintAnalyzer.hh.
Referenced by analyzeMoveNode().
|
private |
Definition at line 87 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and analyzeMoveNode().
|
private |
Definition at line 89 of file ResourceConstraintAnalyzer.hh.
Referenced by analyze(), and analyzeMoveNode().