OpenASIP  2.0
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 
40 namespace TTAMachine {
41  class Bus;
42  class Socket;
43 }
44 
45 namespace TTAProgram {
46 
47 class Terminal;
48 class MoveGuard;
49 class Instruction;
50 
51 /**
52  * Represents a data transport through the TTA programmable
53  * interconnection network.
54  */
56 public:
57  Move(Terminal* src,
58  Terminal* dst,
59  const TTAMachine::Bus& bus,
60  MoveGuard* guard);
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;
84  void setGuard(MoveGuard* guard);
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 
99 private:
100  /// Copying not allowed.
101  Move(const Move&);
102  /// Assignment not allowed.
103  Move& operator=(const Move&);
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
TTAProgram::Move::copy
std::shared_ptr< Move > copy() const
Definition: Move.cc:413
TTAProgram::Move::sourceFileName
std::string sourceFileName() const
Definition: Move.cc:488
TTAProgram::AnnotatedInstructionElement
Definition: AnnotatedInstructionElement.hh:53
TTAProgram::Move::destinationSocket
TTAMachine::Socket & destinationSocket() const
Definition: Move.cc:388
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Move::operator=
Move & operator=(const Move &)
Assignment not allowed.
TTAProgram::Move::isTriggering
bool isTriggering() const
Definition: Move.cc:284
TTAProgram::Move::dst_
Terminal * dst_
The destination of the move.
Definition: Move.hh:110
TTAProgram::Move::guardLatency
int guardLatency() const
Definition: Move.cc:503
TTAProgram::Move::isFunctionCall
bool isFunctionCall() const
Definition: Move.cc:219
Exception.hh
TTAProgram::Move::isReturn
bool isReturn() const
Definition: Move.cc:259
TTAProgram::Instruction
Definition: Instruction.hh:57
TTAProgram::Move::isUnconditional
bool isUnconditional() const
Definition: Move.cc:154
TTAProgram::Move::sourceLineNumber
int sourceLineNumber() const
Definition: Move.cc:459
TTAMachine::Bus
Definition: Bus.hh:53
TTAProgram::Move::destination
Terminal & destination() const
Definition: Move.cc:323
TTAProgram::Move::bus
const TTAMachine::Bus & bus() const
Definition: Move.cc:373
TTAProgram::Move::setGuard
void setGuard(MoveGuard *guard)
Definition: Move.cc:360
TTAProgram::Move::toString
std::string toString() const
Definition: Move.cc:436
TTAProgram::Move::setParent
void setParent(Instruction &ins)
Definition: Move.cc:130
TTAProgram::Move::sourceSocket
TTAMachine::Socket & sourceSocket() const
Definition: Move.cc:393
TTAProgram::Move::setDestination
void setDestination(Terminal *dst)
Definition: Move.cc:333
TTAProgram::Move::isControlFlowMove
bool isControlFlowMove() const
Definition: Move.cc:233
TTAProgram::Move::isCall
bool isCall() const
Definition: Move.cc:190
TTAProgram::Move::guard
MoveGuard & guard() const
Definition: Move.cc:345
TTAProgram::Move::src_
Terminal * src_
The source of the move.
Definition: Move.hh:108
TTAMachine::Socket
Definition: Socket.hh:53
TTAProgram::Move
Definition: Move.hh:55
TTAProgram::Move::bus_
const TTAMachine::Bus * bus_
The bus where the transport is carried.
Definition: Move.hh:112
TTAProgram::Move::Move
Move(Terminal *src, Terminal *dst, const TTAMachine::Bus &bus, MoveGuard *guard)
Definition: Move.cc:73
TTAProgram::Move::isInInstruction
bool isInInstruction() const
Definition: Move.cc:144
TTAProgram::Move::~Move
~Move()
Definition: Move.cc:97
TTAProgram::Move::parent_
Instruction * parent_
Parent instruction of the move.
Definition: Move.hh:106
TTAProgram::Move::hasSourceLineNumber
bool hasSourceLineNumber() const
Definition: Move.cc:445
TTAProgram::Move::parent
Instruction & parent() const
Definition: Move.cc:115
AnnotatedInstructionElement.hh
TTAProgram::Move::isConditional
bool isConditional() const
Definition: Move.hh:69
TTAProgram::Terminal
Definition: Terminal.hh:60
TTAProgram::Move::source
Terminal & source() const
Definition: Move.cc:302
TTAProgram::Move::guard_
MoveGuard * guard_
The boolean expression that predicates the move.
Definition: Move.hh:114
TTAProgram::Move::isJump
bool isJump() const
Definition: Move.cc:164
TTAMachine
Definition: Assembler.hh:48
TTAProgram::MoveGuard
Definition: MoveGuard.hh:47
TTAProgram::Move::setBus
void setBus(const TTAMachine::Bus &bus)
Definition: Move.cc:383
TTAProgram::Move::setSource
void setSource(Terminal *src)
Definition: Move.cc:312
TTAProgram::Move::hasSourceFileName
bool hasSourceFileName() const
Definition: Move.cc:478