OpenASIP 2.2
Loading...
Searching...
No Matches
BUMoveNodeSelector.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2011 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 BUMoveNodeSelector.hh
26 *
27 * Declaration of BUMoveNodeSelector class.
28 *
29 * @author Vladimir Guzma 2011(vladimir.guzma-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_BU_MOVE_NODE_SELECTOR_HH
34#define TTA_BU_MOVE_NODE_SELECTOR_HH
35
36#ifdef _GLIBCXX_DEBUG
37/* If enabled, the priority list crashes with error
38 "elements in iterator range [__first, __last) do not form a heap
39 with respect to the predicate __comp" when calling readyList_.pop() in
40 CriticalPathBBMoveNodeSelector::candidates().
41
42 It's probably caused by a situation in which a node's priority changes
43 during scheduling and the priority list does not notify the change before
44 pop() is called and it detects a malformed heap (a parent node larger than
45 a child node), or something.
46
47 @todo This needs to be fixed at some point somehow as it might result in
48 weird errors in some machines or undeterministic schedule.
49*/
50#undef _GLIBCXX_DEBUG
51#endif
52
53#include "MoveNodeSelector.hh"
56
57namespace TTAProgram {
58 class BasicBlock;
59}
60
61namespace TTAMachine {
62 class Machine;
63}
64
65/**
66 * Selects move nodes from a basic block and prioritizes move nodes on
67 * the critical path of the data dependence graph.
68 * This version prioritiezed for bottom up scheduling.
69 */
71public:
79 virtual ~BUMoveNodeSelector();
80
81 virtual MoveNodeGroup candidates();
82 virtual void notifyScheduled(MoveNode& node);
83 virtual void mightBeReady(MoveNode& node);
85
86 /// Initializes ready list from nodes that are ready.
87 virtual void initializeReadylist();
88
89 static void queueOperation(
93
94private:
96
98
99 virtual bool isReadyToBeScheduled(MoveNodeGroup& nodes) const;
100 /// The data dependence graph built from the basic block.
102 /// The prioritized ready list.
104 // whether owns the DDG?
106};
107
108#endif
TTAMachine::Machine * machine
the architecture definition of the estimated processor
std::priority_queue< MoveNodeGroup, std::vector< MoveNodeGroup >, RLBUPriorityCriticalPath > ReadyMoveNodeGroupListBU
A prioritized list for the ready-to-be-scheduled move node groups.
ReadyMoveNodeGroupListBU readyList_
The prioritized ready list.
DataDependenceGraph * ddg_
The data dependence graph built from the basic block.
virtual void initializeReadylist()
Initializes ready list from nodes that are ready.
virtual MoveNodeGroup candidates()
static void queueOperation(ProgramOperation &po, const DataDependenceGraph::NodeSet &nodes, DataDependenceGraph::NodeSet &queue)
virtual void notifyScheduled(MoveNode &node)
virtual void mightBeReady(MoveNode &node)
bool isReadyToBeScheduled(DataDependenceGraph::NodeSet &nodes) const
virtual DataDependenceGraph & dataDependenceGraph()
std::set< GraphNode *, typename GraphNode::Comparator > NodeSet
Definition Graph.hh:53