OpenASIP  2.0
ProgramGraph.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 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 ProgramGraph.hh
26  *
27  * Declaration of ProgramGraph class.
28  *
29  * ProgramGraph represents a program in PDG form.
30  *
31  * @author Vladimir Guzma 2006 (vladimir.guzma-no.spam-tut.fi)
32  * @note rating: red
33  */
34 
35 #ifndef TTA_PROGRAM_GRAPH_HH
36 #define TTA_PROGRAM_GRAPH_HH
37 
38 #include <string>
39 #include <vector>
40 #include "Exception.hh"
41 #include "MoveNode.hh"
44 
46 class ControleFlowGraph;
47 
48 namespace TTAMachine {
49  class Machine;
50 }
51 
52 namespace TTAProgram{
53  class Move;
54  class Program;
55 }
56 
57 /*
58  * ProgramGraph represents program
59  */
60 class ProgramGraph {
61 public:
62 
64  virtual ~ProgramGraph();
65 
67  MoveNode& nodeOf(const TTAProgram::Move&) const;
68  int graphCount() const;
70  ProgramDependenceGraph* graph(const std::string);
71 
72 private:
73  void clear();
74 
75  /// Copying forbidden
76  ProgramGraph(const ProgramGraph&);
77  /// Assignment forbidden
79 
80  /// Original program
82 
83  /// Vector of CFG's for each procedure
84  std::vector<ControlFlowGraph*> cfgs_;
85  /// Vector of CDG's for each procedure
86  std::vector<ControlDependenceGraph*> cdgs_;
87  /// Vector of DDG's for each procedure
88  std::vector<DataDependenceGraph*> ddgs_;
89  /// Vector of PDG's for each procedure
90  std::vector<ProgramDependenceGraph*> pdgs_;
91 };
92 
93 #endif
ProgramGraph::pdgs_
std::vector< ProgramDependenceGraph * > pdgs_
Vector of PDG's for each procedure.
Definition: ProgramGraph.hh:90
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
Exception.hh
ControlDependenceGraph.hh
ProgramGraph::nodeOf
MoveNode & nodeOf(const TTAProgram::Move &) const
Definition: ProgramGraph.cc:122
MoveNode
Definition: MoveNode.hh:65
ProgramGraph::program_
TTAProgram::Program & program_
Original program.
Definition: ProgramGraph.hh:81
ProgramGraph::ddgs_
std::vector< DataDependenceGraph * > ddgs_
Vector of DDG's for each procedure.
Definition: ProgramGraph.hh:88
ProgramGraph::cdgs_
std::vector< ControlDependenceGraph * > cdgs_
Vector of CDG's for each procedure.
Definition: ProgramGraph.hh:86
ProgramDependenceGraph.hh
ProgramGraph::graph
ProgramDependenceGraph * graph(const std::string)
Definition: ProgramGraph.cc:157
ProgramGraph::operator=
ProgramGraph & operator=(const ProgramGraph &)
Assignment forbidden.
ProgramGraph::generateProgram
TTAProgram::Program & generateProgram() const
Definition: ProgramGraph.cc:109
ProgramGraph::graphAt
ProgramDependenceGraph * graphAt(int)
Definition: ProgramGraph.cc:143
ProgramDependenceGraph
Definition: ProgramDependenceGraph.hh:51
TTAProgram::Move
Definition: Move.hh:55
ProgramGraph::cfgs_
std::vector< ControlFlowGraph * > cfgs_
Vector of CFG's for each procedure.
Definition: ProgramGraph.hh:84
ProgramGraph
Definition: ProgramGraph.hh:60
ProgramGraph::graphCount
int graphCount() const
Definition: ProgramGraph.cc:133
ProgramGraph::ProgramGraph
ProgramGraph(TTAProgram::Program &program, const TTAMachine::Machine &mach)
Definition: ProgramGraph.cc:54
DataDependenceGraph
Definition: DataDependenceGraph.hh:67
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
TTAMachine
Definition: Assembler.hh:48
ProgramGraph::~ProgramGraph
virtual ~ProgramGraph()
Definition: ProgramGraph.cc:99
MoveNode.hh
ProgramGraph::clear
void clear()
Definition: ProgramGraph.cc:87
TTAMachine::Machine
Definition: Machine.hh:73