OpenASIP 2.2
Loading...
Searching...
No Matches
BF2ScheduleFront.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2014 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/**
26 * @file BF2ScheduleFront.hh
27 *
28 * Declaration of BF2ScheduleFront class
29 *
30 * Tries to schedule a group of moves.
31 *
32 * @author Heikki Kultala 2014-2020(heikki.kultala-no.spam-tuni.fi)
33 * @note rating: red
34 */
35
36#ifndef BF2_SCHEDULE_FRONT_HH
37#define BF2_SCHEDULE_FRONT_HH
38
39#include "BFOptimization.hh"
41#include "BF2Scheduler.hh"
42
43class MoveNode;
44class TCEString;
45
46namespace TTAMachine {
47 class Port;
48}
49
51public:
52
54 BF2Scheduler& sched, MoveNode& mn, int lc) :
55 BFOptimization(sched), mn_(mn), lc_(lc) {}
56
57 virtual bool operator()() override;
58
59 void undoOnlyMe() override;
60
62
63 void bypassed(MoveNode& src, MoveNode& dst) {
64 bypassSources_[&dst] = &src;
65 }
66
68 bypassSources_.erase(&dst);
69 }
70
73
74 static int prefResultCycle(const MoveNode& mn);
75
76 void mightBeReady(MoveNode& n) override;
77
78 void deletingNode(MoveNode* deletedNode) {
79 nodesToNotify_.erase(deletedNode);
80 }
81
84
85protected:
86
89
90 int scheduleMove(
91 MoveNode& move,
93 bool allowEarlyBypass = true,
94 bool allowLateBypass = true,
95 bool allowEarlySharing = true);
96
98
100
101 bool tryToScheduleMoveOuter(MoveNode& mn, int& latestCycle);
102
104
106
107 void printFront(const TCEString& prefix);
108
109
111
113
114private:
115
117
119
122 const DataDependenceGraph::NodeSet& processedNodes,
124
126
128
130 int lc_;
131
132 typedef std::map<MoveNode*, int, MoveNode::Comparator> PathLengthCache;
134};
135
136#endif
BF2Scheduler::MoveNodeMap MoveNodeMap
MoveNode * getMoveNodeFromFrontBU()
DataDependenceGraph::NodeSet schedulingFront_
BF2ScheduleFront(BF2Scheduler &sched, MoveNode &mn, int lc)
bool scheduleFrontFromMove(MoveNode &mn)
DataDependenceGraph::NodeSet illegalOperandShares_
bool tryRevertEarlierBypass(MoveNode &mn)
void bypassed(MoveNode &src, MoveNode &dst)
void undoOnlyMe() override
DataDependenceGraph::NodeSet illegalBypassSources_
int scheduleMove(MoveNode &move, BF2Scheduler::SchedulingLimits limits, bool allowEarlyBypass=true, bool allowLateBypass=true, bool allowEarlySharing=true)
void deletingNode(MoveNode *deletedNode)
DataDependenceGraph::NodeSet allNodesOfSameOperation(MoveNode &mn)
void requeueOtherMovesOfSameOp(MoveNode &mn)
static int prefResultCycle(const MoveNode &mn)
BF2Scheduler::SchedulingLimits getPreferredLimits(const MoveNode &mn)
void appendBypassSources(MoveNodeMap &map)
std::map< MoveNode *, int, MoveNode::Comparator > PathLengthCache
DataDependenceGraph::NodeSet nodesToNotify_
bool tryToScheduleMoveOuter(MoveNode &mn, int &latestCycle)
MoveNodeMap bypassSources_
virtual bool operator()() override
void mightBeReady(MoveNode &n) override
MoveNode * findInducingBypassSource(MoveNode &mn)
MoveNode * findInducingBypassSourceFromOperation(ProgramOperation &po, const DataDependenceGraph::NodeSet &processedNodes, DataDependenceGraph::NodeSet &queue)
void undidBypass(MoveNode &, MoveNode &dst)
void printFront(const TCEString &prefix)
PathLengthCache pathLengthCache_
std::map< MoveNode *, MoveNode *, MoveNode::Comparator > MoveNodeMap
std::set< GraphNode *, typename GraphNode::Comparator > NodeSet
Definition Graph.hh:53