OpenASIP 2.2
Loading...
Searching...
No Matches
BFShareOperandWithScheduled.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 BFShareOperandWithScheduled.cc
27 *
28 * Definition of BFShareOperandWithScheduled class
29 *
30 * Performs an operands sharing between two (or more) operations,
31 * between scheudling these operations.
32 *
33 * @author Heikki Kultala 2014-2020(heikki.kultala-no.spam-tuni.fi)
34 * @note rating: red
35 */
36
37
39#include "MoveNode.hh"
40#include "Move.hh"
41#include "Terminal.hh"
43#include "BF2Scheduler.hh"
44#include "Bus.hh"
45#include "MoveNodeDuplicator.hh"
47
51#ifdef DEBUG_BUBBLEFISH_SCHEDULER
52 std::cerr << "\t\t\t\t\tDestination operand index mismatch"
53 << std::endl;
54#endif
55 return false;
56 }
57
60
65 }
66
67 MoveNode* removedPrologMN = ii() ?
69 NULL;
70 if (removedPrologMN != NULL) {
71 prologBus_ = &removedPrologMN->move().bus();
72
73 if (removedPrologMN->move().source().isImmediateRegister()) {
75 prologRM()->immediateWriteCycle(*removedPrologMN);
76 }
77
78#ifdef DEBUG_BUBBLEFISH_SCHEDULER
79 std::cerr << "\t\t\t\tShareOpWithSched Saving prolog bus: "
80 << prologBus_->name() << std::endl;
81 std::cerr << "\t\t\t\t\tProlog move: " << removedPrologMN->toString()
82 << std::endl;
83#endif
84 }
85
86 unassign(removed_, false);
87 if (BFShareOperand::operator()()) {
90#ifdef DEBUG_BUBBLEFISH_SCHEDULER
91 std::cerr << "\t\t\t\t\tShared operand ok!" << std::endl;
92#endif
93 return true;
94 } else {
98#ifdef DEBUG_BUBBLEFISH_SCHEDULER
99 std::cerr << "\t\t\t\t\tShare operand failed!" << std::endl;
100#endif
101 return false;
102 }
103}
104
106#ifdef DEBUG_BUBBLEFISH_SCHEDULER
107 std::cerr << "\t\t\t\t\tUndoing operandshare: " << shared_.toString()
108 << std::endl;
109#endif
116}
void nodeResurrected(MoveNode &mn)
void nodeAndCopyKilled(MoveNode &mn)
unsigned int ii() const
BF2Scheduler & sched_
SimpleResourceManager * prologRM() const
DataDependenceGraph & ddg()
virtual void unassign(MoveNode &mn, bool disposePrologCopy=true)
MoveNodeDuplicator & duplicator() const
SimpleResourceManager & rm() const
virtual bool assign(int cycle, MoveNode &, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU_=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1, bool ignoreGuardWriteCycle=false)
const TTAMachine::Bus * originalRemovedBus_
const TTAMachine::ImmediateUnit * immu_
MoveNode & removed_
MoveNode & shared_
virtual void undoOnlyMe()
void restoreNodeFromParent(GraphNode &node)
virtual void dropNode(Node &node)
MoveNode * getMoveNode(MoveNode &mn)
int cycle() const
Definition MoveNode.cc:421
std::string toString() const
Definition MoveNode.cc:576
TTAProgram::Move & move()
virtual int immediateWriteCycle(const MoveNode &) const
virtual TCEString name() const
Terminal & source() const
Definition Move.cc:302
Terminal & destination() const
Definition Move.cc:323
const TTAMachine::Bus & bus() const
Definition Move.cc:373
virtual int index() const
Definition Terminal.cc:274
virtual int operationIndex() const
Definition Terminal.cc:364
virtual bool isImmediateRegister() const
Definition Terminal.cc:97
virtual const TTAMachine::ImmediateUnit & immediateUnit() const
Definition Terminal.cc:240