OpenASIP
2.2
Loading...
Searching...
No Matches
src
applibs
Scheduler
Algorithms
BFConnectNodes.cc
Go to the documentation of this file.
1
/*
2
Copyright (c) 2002-2020 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 BFConnectNodes.cc
26
*
27
* Definition of Connect (ddg) Nodes scheduling operation class.
28
*
29
* @author Heikki Kultala 2020 (hkultala-no.spam-tuni.fi)
30
* @note rating: red
31
*/
32
33
#include "
BFConnectNodes.hh
"
34
#include "
DataDependenceGraph.hh
"
35
36
BFConnectNodes::BFConnectNodes
(
BF2Scheduler
& sched,
37
const
MoveNode
& tail,
38
const
MoveNode
& head,
39
DataDependenceEdge
* e,
40
bool
copyEdge) :
41
BFOptimization
(sched),
42
tail_(tail),
43
head_(head),
44
edge_(e),
45
copyEdge_(copyEdge) {}
46
47
bool
BFConnectNodes::operator()
() {
48
49
50
if
(
copyEdge_
) {
51
edge_
=
new
DataDependenceEdge
(*
edge_
);
52
}
53
54
ddg
().
rootGraph
()->
connectNodes
(
tail_
,
head_
, *
edge_
);
55
return
true
;
56
}
57
58
void
BFConnectNodes::undoOnlyMe
() {
59
60
ddg
().
rootGraph
()->
removeEdge
(*
edge_
);
61
}
BFConnectNodes.hh
DataDependenceGraph.hh
BF2Scheduler
Definition
BF2Scheduler.hh:74
BFConnectNodes::operator()
bool operator()() override
Definition
BFConnectNodes.cc:47
BFConnectNodes::edge_
DataDependenceEdge * edge_
Definition
BFConnectNodes.hh:55
BFConnectNodes::copyEdge_
bool copyEdge_
Definition
BFConnectNodes.hh:56
BFConnectNodes::head_
const MoveNode & head_
Definition
BFConnectNodes.hh:54
BFConnectNodes::BFConnectNodes
BFConnectNodes(BF2Scheduler &sched, const MoveNode &tail, const MoveNode &head, DataDependenceEdge *e, bool copyEdge=false)
Definition
BFConnectNodes.cc:36
BFConnectNodes::tail_
const MoveNode & tail_
Definition
BFConnectNodes.hh:53
BFConnectNodes::undoOnlyMe
void undoOnlyMe() override
Definition
BFConnectNodes.cc:58
BFOptimization
Definition
BFOptimization.hh:73
BFOptimization::ddg
DataDependenceGraph & ddg()
Definition
BFOptimization.cc:70
BoostGraph::rootGraph
BoostGraph * rootGraph()
BoostGraph::removeEdge
virtual void removeEdge(Edge &e)
BoostGraph::connectNodes
virtual void connectNodes(const Node &nTail, const Node &nHead, Edge &e)
DataDependenceEdge
Definition
DataDependenceEdge.hh:43
MoveNode
Definition
MoveNode.hh:65
Generated by
1.9.8