OpenASIP  2.0
ProgramDependenceEdge.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 ProgramDependenceEdge.hh
26  *
27  * Declaration of prototype of graph-based program representation:
28  * declaration of the program dependence edge.
29  *
30  * @author Vladimir Guzma 2006 (vladimir.guzma-no.spam-tut.fi)
31  * @note rating: red
32  */
33 
34 #ifndef TTA_PROGRAM_DEPENDENCE_EDGE_HH
35 #define TTA_PROGRAM_DEPENDENCE_EDGE_HH
36 
37 #include "GraphEdge.hh"
38 #include "ControlDependenceEdge.hh"
39 #include "DataDependenceEdge.hh"
40 
42 public:
43  enum EdgeType {
44  PDG_EDGE_CONTROL, /// Indicates Control Dependence Edge from CDG
45  PDG_EDGE_DATA, /// Indicates Data Dependence Edge from DDG
46  PDG_EDGE_LOOP_CLOSE, /// Loop close edge from close node to loop entry
47  PDG_EDGE_CONTROL_ARTIFICIAL /// Indicates artificial control edge for
48  /// serialization
49  };
50 
54 
55  virtual ~ProgramDependenceEdge();
56 
57  bool isControlDependence() const;
58  bool isDataDependence() const ;
59  bool isArtificialControlDependence() const;
60  bool isLoopCloseEdge() const;
63  TCEString toString() const;
64  TCEString dotString() const;
65  void setFixed() { fixed_ = true; }
66  bool fixed() { return fixed_; }
67 private:
71  /// Set to fixed if edge is not to be moved any more while serializing
72  bool fixed_;
73 };
74 
75 #endif
ProgramDependenceEdge::ProgramDependenceEdge
ProgramDependenceEdge(ControlDependenceEdge &cEdge)
Definition: ProgramDependenceEdge.cc:50
ProgramDependenceEdge::PDG_EDGE_LOOP_CLOSE
@ PDG_EDGE_LOOP_CLOSE
Indicates Data Dependence Edge from DDG.
Definition: ProgramDependenceEdge.hh:46
GraphEdge.hh
ProgramDependenceEdge::dotString
TCEString dotString() const
Definition: ProgramDependenceEdge.cc:101
ProgramDependenceEdge::EdgeType
EdgeType
Definition: ProgramDependenceEdge.hh:43
ProgramDependenceEdge::isDataDependence
bool isDataDependence() const
Definition: ProgramDependenceEdge.cc:137
ProgramDependenceEdge::type_
EdgeType type_
Definition: ProgramDependenceEdge.hh:70
ProgramDependenceEdge::PDG_EDGE_CONTROL
@ PDG_EDGE_CONTROL
Definition: ProgramDependenceEdge.hh:44
ProgramDependenceEdge::isLoopCloseEdge
bool isLoopCloseEdge() const
Definition: ProgramDependenceEdge.cc:157
ProgramDependenceEdge::setFixed
void setFixed()
Definition: ProgramDependenceEdge.hh:65
ProgramDependenceEdge
Definition: ProgramDependenceEdge.hh:41
ProgramDependenceEdge::controlDependenceEdge
ControlDependenceEdge & controlDependenceEdge()
Definition: ProgramDependenceEdge.cc:166
DataDependenceEdge.hh
ControlDependenceEdge
Definition: ControlDependenceEdge.hh:44
ProgramDependenceEdge::fixed
bool fixed()
Definition: ProgramDependenceEdge.hh:66
ProgramDependenceEdge::isArtificialControlDependence
bool isArtificialControlDependence() const
Definition: ProgramDependenceEdge.cc:147
ProgramDependenceEdge::~ProgramDependenceEdge
virtual ~ProgramDependenceEdge()
Definition: ProgramDependenceEdge.cc:73
ProgramDependenceEdge::PDG_EDGE_CONTROL_ARTIFICIAL
@ PDG_EDGE_CONTROL_ARTIFICIAL
Loop close edge from close node to loop entry.
Definition: ProgramDependenceEdge.hh:47
ControlDependenceEdge.hh
ProgramDependenceEdge::toString
TCEString toString() const
Definition: ProgramDependenceEdge.cc:81
ProgramDependenceEdge::dEdge_
DataDependenceEdge * dEdge_
Definition: ProgramDependenceEdge.hh:69
ProgramDependenceEdge::isControlDependence
bool isControlDependence() const
Definition: ProgramDependenceEdge.cc:126
ProgramDependenceEdge::cEdge_
ControlDependenceEdge * cEdge_
Definition: ProgramDependenceEdge.hh:68
GraphEdge
Definition: GraphEdge.hh:52
TCEString
Definition: TCEString.hh:53
DataDependenceEdge
Definition: DataDependenceEdge.hh:43
ProgramDependenceEdge::dataDependenceEdge
DataDependenceEdge & dataDependenceEdge()
Definition: ProgramDependenceEdge.cc:179
ProgramDependenceEdge::PDG_EDGE_DATA
@ PDG_EDGE_DATA
Indicates Control Dependence Edge from CDG.
Definition: ProgramDependenceEdge.hh:45
ProgramDependenceEdge::fixed_
bool fixed_
Set to fixed if edge is not to be moved any more while serializing.
Definition: ProgramDependenceEdge.hh:72