OpenASIP 2.2
Loading...
Searching...
No Matches
BFUpdateMoveOnBypass.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2020 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 BFUpdateMoveOnBypass.cc
26 *
27 * Definition of scheduler operation which updates move to make a bypass.
28 *
29 * @author Heikki Kultala 2020 (hkultala-no.spam-tuni.fi)
30 * @note rating: red
31 */
32
34#include "ProgramOperation.hh"
35#include "ProgramAnnotation.hh"
36#include "Move.hh"
37#include "Terminal.hh"
38
40
42
43 auto& dm = dst_.move();
44 auto& sm = src_.move();
45
46 // update the move
47 dm.setSource(sm.source().copy());
48
49 if (!src_.isSourceOperation()) {
50 return true;
51 }
52
54 srcOp->addOutputNode(dst_);
56
57 // set fu annotations
58 for (int j = 0; j < sm.annotationCount(); j++) {
59 TTAProgram::ProgramAnnotation anno = sm.annotation(j);
60 if (anno.id() == ProgramAnnotation::ANN_ALLOWED_UNIT_SRC) {
61 dm.addAnnotation(
63 ProgramAnnotation::ANN_ALLOWED_UNIT_SRC,
64 anno.payload()));
65 }
66 if (anno.id() ==
67 ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_SRC) {
68 dm.addAnnotation(
70 ProgramAnnotation::ANN_CONN_CANDIDATE_UNIT_SRC,
71 anno.payload()));
72 }
73 if (anno.id() ==
74 ProgramAnnotation::ANN_REJECTED_UNIT_SRC) {
75 dm.addAnnotation(
77 ProgramAnnotation::ANN_REJECTED_UNIT_SRC,
78 anno.payload()));
79 }
80 }
81 return true;
82}
83
85 // unset programoperation from bypassed
86 if (dst_.isSourceOperation()) {
90
91 // unset fu annotations
98 }
99 // do the actual unmerge by returning source to original register.
101}
std::shared_ptr< ProgramOperation > ProgramOperationPtr
Definition MoveNode.hh:53
void setSourceOperationPtr(ProgramOperationPtr po)
Definition MoveNode.cc:541
ProgramOperationPtr sourceOperationPtr() const
Definition MoveNode.cc:458
void unsetSourceOperation()
Definition MoveNode.cc:760
ProgramOperation & sourceOperation() const
Definition MoveNode.cc:453
TTAProgram::Move & move()
bool isSourceOperation() const
Definition MoveNode.cc:168
void removeOutputNode(MoveNode &node, int outputIndex)
void removeAnnotations(ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID)
void setSource(Terminal *src)
Definition Move.cc:312
Terminal & destination() const
Definition Move.cc:323
const std::vector< Byte > & payload() const
ProgramAnnotation::Id id() const
@ ANN_REJECTED_UNIT_SRC
Src. unit rejected.
@ ANN_CONN_CANDIDATE_UNIT_SRC
Src. unit candidate.
@ ANN_ALLOWED_UNIT_SRC
Candidate units can be passed for resource manager for choosing the source/destination unit of the mo...
virtual Terminal * copy() const =0