OpenASIP  2.0
Terminal.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 Terminal.hh
26  *
27  * Declaration of Terminal class.
28  *
29  * @author Ari Metsähalme 2005 (ari.metsahalme-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_TERMINAL_HH
34 #define TTA_TERMINAL_HH
35 
36 #include "BaseType.hh"
37 #include "SimValue.hh"
38 #include "Address.hh"
39 #include "Exception.hh"
40 #include "TCEString.hh"
41 #include "Application.hh"
42 
43 class Operation;
44 
45 namespace TTAMachine {
46  class RegisterFile;
47  class ImmediateUnit;
48  class FunctionUnit;
49  class Port;
50 }
51 
52 namespace TTAProgram {
53 
54 class BasicBlock;
55 class InstructionReference;
56 
57 /**
58  * Models any possible source or destination of a move.
59  */
60 class Terminal {
61 public:
62  Terminal();
63  virtual ~Terminal();
64 
65  virtual bool isImmediate() const;
66  virtual bool isAddress() const;
67  virtual bool isInstructionAddress() const;
68  virtual bool isImmediateRegister() const;
69  virtual bool isGPR() const;
70  virtual bool isFUPort() const;
71  virtual bool isRA() const;
72  virtual bool isBasicBlockReference() const;
73  virtual bool isProgramOperationReference() const;
74  virtual bool isCodeSymbolReference() const;
75  virtual bool isUniversalMachineRegister() const;
76  virtual SimValue value() const;
77  virtual Address address() const;
78  virtual const InstructionReference& instructionReference() const;
80  virtual const TTAMachine::RegisterFile& registerFile() const;
81  virtual const TTAMachine::ImmediateUnit& immediateUnit() const;
82  virtual const TTAMachine::FunctionUnit& functionUnit() const;
83  virtual const BasicBlock& basicBlock() const;
84  virtual int index() const;
85 
86  virtual bool isOpcodeSetting() const;
87 
88  virtual bool isTriggering() const;
89 
90  virtual Operation& operation() const;
91 
92  virtual Operation& hintOperation() const;
93 
94  virtual int operationIndex() const;
95  virtual const TTAMachine::Port& port() const;
96  virtual void setIndex(int index);
98 
99  virtual Terminal* copy() const = 0;
100 
101  bool operator==(const Terminal& other) const;
102 
103  virtual bool equals(const Terminal& other) const = 0;
104 
105  virtual TCEString toString() const = 0;
106 };
107 
108 }
109 
110 #endif
TTAProgram::Terminal::isFUPort
virtual bool isFUPort() const
Definition: Terminal.cc:118
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Terminal::setIndex
virtual void setIndex(int index)
Definition: Terminal.cc:392
TTAProgram::Terminal::isTriggering
virtual bool isTriggering() const
Definition: Terminal.cc:298
BaseType.hh
TTAProgram::Terminal::index
virtual int index() const
Definition: Terminal.cc:274
TTAProgram::Terminal::isInstructionAddress
virtual bool isInstructionAddress() const
Definition: Terminal.cc:87
TTAProgram::Address
Definition: Address.hh:51
Exception.hh
TTAProgram::Terminal::isAddress
virtual bool isAddress() const
Definition: Terminal.cc:75
TTAProgram::Terminal::registerFile
virtual const TTAMachine::RegisterFile & registerFile() const
Definition: Terminal.cc:225
TTAProgram::Terminal::hintOperation
virtual Operation & hintOperation() const
Definition: Terminal.cc:341
TTAProgram::Terminal::isBasicBlockReference
virtual bool isBasicBlockReference() const
Definition: Terminal.cc:139
TTAProgram::Terminal::instructionReference
virtual const InstructionReference & instructionReference() const
Definition: Terminal.cc:188
TTAProgram::Terminal::address
virtual Address address() const
Definition: Terminal.cc:210
SimValue
Definition: SimValue.hh:96
TTAProgram::Terminal::Terminal
Terminal()
Definition: Terminal.cc:48
TTAProgram::Terminal::operation
virtual Operation & operation() const
Definition: Terminal.cc:319
TCEString.hh
TTAProgram::Terminal::isUniversalMachineRegister
virtual bool isUniversalMachineRegister() const
Definition: Terminal.cc:166
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
TTAProgram::Terminal::isImmediateRegister
virtual bool isImmediateRegister() const
Definition: Terminal.cc:97
TTAProgram::Terminal::operationIndex
virtual int operationIndex() const
Definition: Terminal.cc:364
TTAMachine::Port
Definition: Port.hh:54
TTAProgram::Terminal::isProgramOperationReference
virtual bool isProgramOperationReference() const
Definition: Terminal.cc:144
Application.hh
TTAProgram::Terminal::isGPR
virtual bool isGPR() const
Definition: Terminal.cc:107
TTAProgram::Terminal::value
virtual SimValue value() const
Definition: Terminal.cc:178
TTAProgram::Terminal::immediateUnit
virtual const TTAMachine::ImmediateUnit & immediateUnit() const
Definition: Terminal.cc:240
Operation
Definition: Operation.hh:59
TTAProgram::Terminal::isOpcodeSetting
virtual bool isOpcodeSetting() const
Definition: Terminal.cc:285
TTAProgram::Terminal::functionUnit
virtual const TTAMachine::FunctionUnit & functionUnit() const
Definition: Terminal.cc:251
TTAProgram::BasicBlock
Definition: BasicBlock.hh:85
TTAProgram::Terminal::toString
virtual TCEString toString() const =0
TTAProgram::Terminal::~Terminal
virtual ~Terminal()
Definition: Terminal.cc:54
Address.hh
SimValue.hh
TCEString
Definition: TCEString.hh:53
TTAProgram::Terminal::copy
virtual Terminal * copy() const =0
TTAProgram::Terminal::basicBlock
virtual const BasicBlock & basicBlock() const
Definition: Terminal.cc:261
TTAProgram::Terminal
Definition: Terminal.hh:60
TTAProgram::Terminal::equals
virtual bool equals(const Terminal &other) const =0
TTAProgram::Terminal::port
virtual const TTAMachine::Port & port() const
Definition: Terminal.cc:378
TTAProgram::Terminal::operator==
bool operator==(const Terminal &other) const
Definition: Terminal.cc:417
TTAProgram::Terminal::isCodeSymbolReference
virtual bool isCodeSymbolReference() const
Definition: Terminal.cc:154
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
TTAProgram::Terminal::setInstructionReference
virtual void setInstructionReference(InstructionReference ref)
Definition: Terminal.cc:404
TTAMachine
Definition: Assembler.hh:48
TTAProgram::Terminal::isImmediate
virtual bool isImmediate() const
Definition: Terminal.cc:63
TTAProgram::Terminal::isRA
virtual bool isRA() const
Definition: Terminal.cc:129
TTAProgram::InstructionReference
Definition: InstructionReference.hh:49
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50