OpenASIP  2.0
ResourceConstraintAnalyzer.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2015 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file ResourceConstraintAnalyzer.hh
26  *
27  * Declaration of ResourceConstraintAlanyzer class.
28  *
29  * @author Pekka Jääskeläinen 2010,2015
30  * @note rating: red
31  */
32 
33 #ifndef TTA_RESOURCE_CONSTRAINT_ANALYZER_HH
34 #define TTA_RESOURCE_CONSTRAINT_ANALYZER_HH
35 
36 #include <map>
37 #include <set>
38 #include <list>
39 #include "TCEString.hh"
40 
43 class MoveNode;
44 
45 /**
46  * A class that analyzes the most important resource constraints in the
47  * given scheduled basic block DDG.
48  */
50 public:
54  TCEString graphName) :
55  origDDG_(ddg), rm_(rm), graphName_(graphName) {}
57 
58  void analyzePreSchedule();
59  bool analyze();
60 
61 private:
62 
64  DataDependenceGraph& ddg, std::ostream& s);
65  bool analyzeMoveNode(const MoveNode& node);
66 
68 
70  DataDependenceGraph& ddg, TCEString graphName);
71 
73  DataDependenceGraph& ddg, TCEString graphName);
74 
75  void dumpGraphWithStats(
76  DataDependenceGraph& ddg, TCEString dotFileName,
77  const std::map<int, std::list<MoveNode*> >& schedule);
78 
79  typedef std::map<std::string, int> RFCountMap;
80  typedef std::map<std::string, int> OperationCountMap;
81 
88 
91 
93 
96 
97  std::set<MoveNode*> foundMoves_;
98 
100 };
101 
102 #endif
ResourceConstraintAnalyzer::dumpGraphWithStats
void dumpGraphWithStats(DataDependenceGraph &ddg, TCEString dotFileName, const std::map< int, std::list< MoveNode * > > &schedule)
Definition: ResourceConstraintAnalyzer.cc:241
ResourceConstraintAnalyzer::ResourceConstraintAnalyzer
ResourceConstraintAnalyzer(DataDependenceGraph &ddg, SimpleResourceManager &rm, TCEString graphName)
Definition: ResourceConstraintAnalyzer.hh:51
ResourceConstraintAnalyzer::rfReadPortConstrained_
int rfReadPortConstrained_
Definition: ResourceConstraintAnalyzer.hh:85
ResourceConstraintAnalyzer
Definition: ResourceConstraintAnalyzer.hh:49
ResourceConstraintAnalyzer::writePortConstrainedRfs_
RFCountMap writePortConstrainedRfs_
Definition: ResourceConstraintAnalyzer.hh:89
ResourceConstraintAnalyzer::rm_
SimpleResourceManager & rm_
Definition: ResourceConstraintAnalyzer.hh:95
MoveNode
Definition: MoveNode.hh:65
ResourceConstraintAnalyzer::analyzeRegisterAntideps
bool analyzeRegisterAntideps(DataDependenceGraph &ddg, std::ostream &s)
Definition: ResourceConstraintAnalyzer.cc:560
ResourceConstraintAnalyzer::~ResourceConstraintAnalyzer
virtual ~ResourceConstraintAnalyzer()
Definition: ResourceConstraintAnalyzer.hh:56
ResourceConstraintAnalyzer::memoryBoundScheduleResourceUsage
void memoryBoundScheduleResourceUsage(DataDependenceGraph &ddg, TCEString graphName)
Definition: ResourceConstraintAnalyzer.cc:466
TCEString.hh
ResourceConstraintAnalyzer::optimalScheduleResourceUsage
void optimalScheduleResourceUsage(DataDependenceGraph &ddg, TCEString graphName)
Definition: ResourceConstraintAnalyzer.cc:424
ResourceConstraintAnalyzer::operationConstrainedMoves_
OperationCountMap operationConstrainedMoves_
Definition: ResourceConstraintAnalyzer.hh:92
ResourceConstraintAnalyzer::findResourceConstrainedParent
MoveNode * findResourceConstrainedParent(MoveNode *child)
Definition: ResourceConstraintAnalyzer.cc:688
ResourceConstraintAnalyzer::analyzeMoveNode
bool analyzeMoveNode(const MoveNode &node)
Definition: ResourceConstraintAnalyzer.cc:717
ResourceConstraintAnalyzer::graphName_
TCEString graphName_
Definition: ResourceConstraintAnalyzer.hh:99
ResourceConstraintAnalyzer::RFCountMap
std::map< std::string, int > RFCountMap
Definition: ResourceConstraintAnalyzer.hh:79
ResourceConstraintAnalyzer::analyzePreSchedule
void analyzePreSchedule()
Definition: ResourceConstraintAnalyzer.cc:50
ResourceConstraintAnalyzer::analyze
bool analyze()
Definition: ResourceConstraintAnalyzer.cc:62
TCEString
Definition: TCEString.hh:53
ResourceConstraintAnalyzer::origDDG_
DataDependenceGraph & origDDG_
Definition: ResourceConstraintAnalyzer.hh:94
DataDependenceGraph
Definition: DataDependenceGraph.hh:67
ResourceConstraintAnalyzer::unknownConstrained_
int unknownConstrained_
Definition: ResourceConstraintAnalyzer.hh:87
SimpleResourceManager
Definition: SimpleResourceManager.hh:58
ResourceConstraintAnalyzer::rfWritePortConstrained_
int rfWritePortConstrained_
Definition: ResourceConstraintAnalyzer.hh:84
ResourceConstraintAnalyzer::minScheduleLength_
int minScheduleLength_
Definition: ResourceConstraintAnalyzer.hh:86
ResourceConstraintAnalyzer::readPortConstrainedRfs_
RFCountMap readPortConstrainedRfs_
Definition: ResourceConstraintAnalyzer.hh:90
ResourceConstraintAnalyzer::OperationCountMap
std::map< std::string, int > OperationCountMap
Definition: ResourceConstraintAnalyzer.hh:80
ResourceConstraintAnalyzer::foundMoves_
std::set< MoveNode * > foundMoves_
Definition: ResourceConstraintAnalyzer.hh:97
ResourceConstraintAnalyzer::busConstrained_
int busConstrained_
Definition: ResourceConstraintAnalyzer.hh:82
ResourceConstraintAnalyzer::operationConstrained_
int operationConstrained_
Definition: ResourceConstraintAnalyzer.hh:83