OpenASIP 2.2
Loading...
Searching...
No Matches
Move.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 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 Move.hh
26 *
27 * Declaration of Move class.
28 *
29 * @author Ari Metsähalme 2005 (ari.metsahalme-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_MOVE_HH
34#define TTA_MOVE_HH
35
36#include <memory>
37#include "Exception.hh"
39
40namespace TTAMachine {
41 class Bus;
42 class Socket;
43}
44
45namespace TTAProgram {
46
47class Terminal;
48class MoveGuard;
49class Instruction;
50
51/**
52 * Represents a data transport through the TTA programmable
53 * interconnection network.
54 */
56public:
57 Move(Terminal* src,
58 Terminal* dst,
59 const TTAMachine::Bus& bus,
61 Move(Terminal* src, Terminal* dst, const TTAMachine::Bus& bus);
62
63 ~Move();
64
65 Instruction& parent() const;
66 void setParent(Instruction& ins);
67 bool isInInstruction() const;
68 bool isUnconditional() const;
69 inline bool isConditional() const { return !isUnconditional(); }
70
71 bool isJump() const;
72 bool isCall() const;
73 bool isControlFlowMove() const;
74 bool isReturn() const;
75 bool isFunctionCall() const;
76
77 bool isTriggering() const;
78
79 Terminal& source() const;
80 void setSource(Terminal* src);
81 Terminal& destination() const;
82 void setDestination(Terminal* dst);
83 MoveGuard& guard() const;
85 const TTAMachine::Bus& bus() const;
86 void setBus(const TTAMachine::Bus& bus);
89 int guardLatency() const;
90 std::shared_ptr<Move> copy() const;
91
92 std::string toString() const;
93
94 bool hasSourceLineNumber() const;
95 int sourceLineNumber() const;
96 bool hasSourceFileName() const;
97 std::string sourceFileName() const;
98
99private:
100 /// Copying not allowed.
101 Move(const Move&);
102 /// Assignment not allowed.
104
105 /// Parent instruction of the move.
107 /// The source of the move.
109 /// The destination of the move.
111 /// The bus where the transport is carried.
113 /// The boolean expression that predicates the move.
115};
116
117}
118
119#endif
void setSource(Terminal *src)
Definition Move.cc:312
bool isConditional() const
Definition Move.hh:69
bool isFunctionCall() const
Definition Move.cc:219
MoveGuard * guard_
The boolean expression that predicates the move.
Definition Move.hh:114
TTAMachine::Socket & destinationSocket() const
Definition Move.cc:388
MoveGuard & guard() const
Definition Move.cc:345
Move & operator=(const Move &)
Assignment not allowed.
TTAMachine::Socket & sourceSocket() const
Definition Move.cc:393
bool isControlFlowMove() const
Definition Move.cc:233
bool isReturn() const
Definition Move.cc:259
bool hasSourceLineNumber() const
Definition Move.cc:445
bool isUnconditional() const
Definition Move.cc:154
const TTAMachine::Bus * bus_
The bus where the transport is carried.
Definition Move.hh:112
std::string toString() const
Definition Move.cc:436
Instruction & parent() const
Definition Move.cc:115
Terminal & source() const
Definition Move.cc:302
int guardLatency() const
Definition Move.cc:503
std::shared_ptr< Move > copy() const
Definition Move.cc:413
int sourceLineNumber() const
Definition Move.cc:459
bool hasSourceFileName() const
Definition Move.cc:478
bool isJump() const
Definition Move.cc:164
Terminal * dst_
The destination of the move.
Definition Move.hh:110
Move(const Move &)
Copying not allowed.
bool isInInstruction() const
Definition Move.cc:144
bool isCall() const
Definition Move.cc:190
void setGuard(MoveGuard *guard)
Definition Move.cc:360
void setParent(Instruction &ins)
Definition Move.cc:130
bool isTriggering() const
Definition Move.cc:284
Terminal * src_
The source of the move.
Definition Move.hh:108
void setBus(const TTAMachine::Bus &bus)
Definition Move.cc:383
Instruction * parent_
Parent instruction of the move.
Definition Move.hh:106
Terminal & destination() const
Definition Move.cc:323
void setDestination(Terminal *dst)
Definition Move.cc:333
std::string sourceFileName() const
Definition Move.cc:488
const TTAMachine::Bus & bus() const
Definition Move.cc:373