OpenASIP  2.0
BFRescheduleMove.cc
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 BFRescheduleMove.cc
27  *
28  * Definition of BFReschduleMove class
29  *
30  * Base class for rescheduling moves.
31  *
32  * @author Heikki Kultala 2014-2020(heikki.kultala-no.spam-tuni.fi)
33  * @note rating: red
34  */
35 
36 #include "BFRescheduleMove.hh"
37 #include "Move.hh"
38 #include "DataDependenceGraph.hh"
39 #include "Bus.hh"
40 #include "UniversalMachine.hh"
41 
43 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
44  for (int i = 0; i < recurseCounter_*2; i++)
45  std::cerr << "\t";
46 
47  std::cerr << "\t\tUndoing rechedule: " << mn_.toString()
48  << " setting bus to: " << oldBus_->name()
49  << std::endl;
50 #endif
51  if (!mn_.isScheduled()) {
52  for (int i = 0; i < recurseCounter_*2; i++)
53  std::cerr << "\t";
54 
55  std::cerr << "\t\tCannot unschedule on undo of reschedule,"
56  << " mn not sched: " << mn_.toString() << std::endl;
57  for (int i = 0; i < recurseCounter_*2; i++)
58  std::cerr << "\t";
59 
60  std::cerr << "\t\tShould return it to cycle" << oldCycle_ << std::endl;
61  assert(false);
62  }
63  unassign(mn_, false);
64 
66 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
68  std::cerr << "\t\t\tWARNING: bus not universalbus: "
69  << mn_.move().bus().name() << std::endl;
70  std::cerr << "\tOld bus: " << oldBus_->name() << std::endl;
71  }
72 #endif
74 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
75  std::cerr << "\t\tundid reschedule, move now: " << mn_.move().toString()
76  << std::endl;
77 #endif
78 }
BFOptimization::unassign
virtual void unassign(MoveNode &mn, bool disposePrologCopy=true)
Definition: BFOptimization.cc:196
BFRescheduleMove.hh
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
MoveNode::toString
std::string toString() const
Definition: MoveNode.cc:576
BFUnscheduleMove::oldBus_
const TTAMachine::Bus * oldBus_
Definition: BFUnscheduleMove.hh:63
Reversible::undoAndRemoveChildren
void undoAndRemoveChildren(std::stack< Reversible * > &children)
Definition: Reversible.cc:55
UniversalMachine::universalBus
TTAMachine::Bus & universalBus() const
Definition: UniversalMachine.cc:306
BFUnscheduleMove::returnOriginal
void returnOriginal()
Definition: BFUnscheduleMove.cc:107
UniversalMachine::instance
static UniversalMachine & instance()
Definition: UniversalMachine.cc:73
TTAProgram::Move::bus
const TTAMachine::Bus & bus() const
Definition: Move.cc:373
DataDependenceGraph.hh
TTAProgram::Move::toString
std::string toString() const
Definition: Move.cc:436
BFUnscheduleMove::oldCycle_
int oldCycle_
Definition: BFUnscheduleMove.hh:62
BFUnscheduleMove::mn_
MoveNode & mn_
Definition: BFUnscheduleMove.hh:61
BFRescheduleMove::undoOnlyMe
void undoOnlyMe()
Definition: BFRescheduleMove.cc:42
assert
#define assert(condition)
Definition: Application.hh:86
UniversalMachine.hh
BFUnscheduleMove::recurseCounter_
static int recurseCounter_
Definition: BFUnscheduleMove.hh:71
BFRescheduleMove::midChildren_
std::stack< Reversible * > midChildren_
Definition: BFRescheduleMove.hh:55
Bus.hh
MoveNode::move
TTAProgram::Move & move()
MoveNode::isScheduled
bool isScheduled() const
Definition: MoveNode.cc:409
Move.hh