OpenASIP 2.2
Loading...
Searching...
No Matches
SequentialMoveNodeSelector.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2010 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 SequentialMoveNodeSelector.cc
27 *
28 * Implementation of SequentialModeNodeSelector class.
29 *
30 * @author Heikki Kultala 2008 (hkultala-no.spam-cs.tut.fi)
31 * @author Pekka Jääskeläinen 2010 (pjaaskel)
32 * @note rating: red
33 */
34
36#include "Instruction.hh"
37#include "Move.hh"
39#include "TerminalFUPort.hh"
40#include "ProgramOperation.hh"
41#include "FunctionUnit.hh"
42#include "TCEString.hh"
44#include "MoveNode.hh"
45
46namespace TTAProgram {
47}
48
49namespace TTAMachine {
50 class SpecialRegisterPort;
51}
52
53/**
54 * Constructor.
55 *
56 * @param bb Basic block containing moves to be selected.
57 */
64
66 while(!mngs_->empty()) {
67 std::list<MoveNodeGroup*>::iterator iter = mngs_->begin();
68 MoveNodeGroup* mng = *iter;
69 for (int i = 0; i < mng->nodeCount(); i++) {
70 delete &mng->node(i);
71 }
72 delete mng;
73 mngs_->erase(iter);
74 }
75 delete mngs_;
76}
77
78/**
79 * Gives a group of unselected movenodes to schedules.
80 *
81 * This always returns them in order; and every one just once.
82 * Returns an empty MNG when there's no more MNGS to return.
83 */
86 // are there any unselected movenodegroups left?
87 if (mngIter_ != mngs_->end()) {
88 return **mngIter_++;
89 } else {
90 // return empty mng
91 return MoveNodeGroup();
92 }
93}
94
95void
98
99void
102
MoveNodeGroupList * build(TTAProgram::BasicBlock &bb)
int nodeCount() const
MoveNode & node(int index) const
SequentialMoveNodeSelector(TTAProgram::BasicBlock &bb)
virtual void notifyScheduled(MoveNode &node)