OpenASIP  2.0
TerminalProgramOperation.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2011 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 TerminalProgramOperation.hh
26  *
27  * Declaration of TerminalProgramOperation class.
28  *
29  * @author Pekka Jääskeläinen 2011
30  * @note rating: red
31  */
32 
33 #ifndef TTA_TERMINAL_PROGRAM_OPERATION_HH
34 #define TTA_TERMINAL_PROGRAM_OPERATION_HH
35 
37 #include "ProgramOperation.hh"
38 
39 namespace TTAProgram {
40 
41 /**
42  * Represents an inline immediate that refers to a program operation (a
43  * set of moves constituting a single execution of an operation in the
44  * program).
45  *
46  * The returned instruction address is the one of the trigger move of the
47  * tracked ProgramOperation. This class is used to refer to the location of
48  * an another ProgramOperation strictly (not wanting to refer to the
49  * beginning of a BB).
50  */
52 public:
53  TerminalProgramOperation(TCEString instructionLabel);
55  virtual ~TerminalProgramOperation();
56 
58  return po_;
59  }
60 
62  po_ = po;
63  }
64 
65  bool isProgramOperationKnown() const {
66  return po_.get() != NULL;
67  }
68 
69  bool isProgramOperationReference() const { return true; }
70  bool isAddressKnown() const;
71 
72  virtual Address address() const;
73 
74  virtual Terminal* copy() const;
75  virtual bool equals(const Terminal& other) const;
76 
77  TCEString label() const { return label_; }
78 
79 private:
80  /// Assignment not allowed.
82  /// The referred PO. The pointer can be copied, e.g. to DDG.
85 };
86 
87 }
88 
89 #endif
TTAProgram::TerminalProgramOperation::operator=
TerminalProgramOperation & operator=(const TerminalProgramOperation &)
Assignment not allowed.
TTAProgram::TerminalInstructionAddress
Definition: TerminalInstructionAddress.hh:45
TTAProgram
Definition: Estimator.hh:65
TTAProgram::TerminalProgramOperation::label_
TCEString label_
Definition: TerminalProgramOperation.hh:84
TTAProgram::TerminalProgramOperation::po_
ProgramOperationPtr po_
The referred PO. The pointer can be copied, e.g. to DDG.
Definition: TerminalProgramOperation.hh:83
TTAProgram::Address
Definition: Address.hh:51
TTAProgram::TerminalProgramOperation::copy
virtual Terminal * copy() const
Definition: TerminalProgramOperation.cc:99
TTAProgram::TerminalProgramOperation::address
virtual Address address() const
Definition: TerminalProgramOperation.cc:82
TTAProgram::TerminalProgramOperation::isProgramOperationKnown
bool isProgramOperationKnown() const
Definition: TerminalProgramOperation.hh:65
TTAProgram::TerminalProgramOperation::~TerminalProgramOperation
virtual ~TerminalProgramOperation()
Definition: TerminalProgramOperation.cc:71
TTAProgram::TerminalProgramOperation::programOperation
ProgramOperationPtr programOperation() const
Definition: TerminalProgramOperation.hh:57
ProgramOperationPtr
std::shared_ptr< ProgramOperation > ProgramOperationPtr
Definition: MoveNode.hh:52
TTAProgram::TerminalProgramOperation::isAddressKnown
bool isAddressKnown() const
Definition: TerminalProgramOperation.cc:88
TTAProgram::TerminalProgramOperation::equals
virtual bool equals(const Terminal &other) const
Definition: TerminalProgramOperation.cc:109
ProgramOperation.hh
TTAProgram::TerminalProgramOperation::label
TCEString label() const
Definition: TerminalProgramOperation.hh:77
TTAProgram::TerminalProgramOperation::setProgramOperation
void setProgramOperation(ProgramOperationPtr po)
Definition: TerminalProgramOperation.hh:61
TCEString
Definition: TCEString.hh:53
TTAProgram::Terminal
Definition: Terminal.hh:60
TTAProgram::TerminalProgramOperation::TerminalProgramOperation
TerminalProgramOperation(TCEString instructionLabel)
Definition: TerminalProgramOperation.cc:62
TTAProgram::TerminalProgramOperation::isProgramOperationReference
bool isProgramOperationReference() const
Definition: TerminalProgramOperation.hh:69
TerminalInstructionAddress.hh
TTAProgram::TerminalProgramOperation
Definition: TerminalProgramOperation.hh:51