OpenASIP 2.2
Loading...
Searching...
No Matches
TerminalFUPort.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 TerminalFUPort.hh
26 *
27 * Declaration of TerminalFUPort class.
28 *
29 * @author Ari Metsähalme 2005
30 * @author Pekka Jääskeläinen 2008,2011
31 * @note rating: red
32 */
33
34#ifndef TTA_TERMINAL_FU_PORT_HH
35#define TTA_TERMINAL_FU_PORT_HH
36
37#include "Exception.hh"
38#include "Terminal.hh"
39#include "ProgramOperation.hh"
40
41namespace TTAMachine {
42 class HWOperation;
43 class BaseFUPort;
44 class FUPort;
45}
46
47namespace TTAProgram {
48
49/**
50 * Represents an input or output port of a function unit and (when
51 * applicable) the operation code written into it.
52 *
53 * Notice that, in principle, operation codes can be written into FU output
54 * ports.
55 */
56class TerminalFUPort : public Terminal {
57public:
59 const TTAMachine::FUPort& opcodeSettingPort,
60 const TTAMachine::HWOperation& opcode);
61
64 virtual ~TerminalFUPort();
65
66 virtual bool isOpcodeSetting() const;
67
68 virtual bool isTriggering() const;
69
70 virtual bool isFUPort() const;
71 virtual bool isRA() const;
72
73 virtual const TTAMachine::FunctionUnit& functionUnit() const;
74 virtual Operation& operation() const;
75 virtual Operation& hintOperation() const;
76 // sets the "hint operation" for moves which are not opcode setting
77 // but are known to be part of an operation execution
78 virtual void setOperation(const TTAMachine::HWOperation& hwOp);
79 void setHintOperation(const char* name);
80
81 virtual int operationIndex() const;
82 virtual void setOperationIndex(int index) { opIndex_ = index; }
83 virtual const TTAMachine::Port& port() const;
84 virtual Terminal* copy() const;
85 virtual bool equals(const Terminal& other) const;
86
87 virtual const TTAMachine::HWOperation* hwOperation() const;
88
89 /// these methods are used to group terminals belonging to a single
90 /// program operation invocation
91 bool hasProgramOperation() const {
92 return po_ != NULL && po_.get() != NULL;
93 }
98 return po_;
99 }
100
101 virtual TCEString toString() const;
102
103
104private:
105 // copy constructor used internally by copy();
106 TerminalFUPort(const TerminalFUPort& tfup);
107
108 /// Assignment not allowed.
110 int findNewOperationIndex() const;
111
112 /// Port of the unit.
114 /// Operation code transported to the port.
116 /// The OSAL operation.
118 /// Operation index.
120 /// The ProgramOperation this terminal belongs to, if applicable.
121 /// The instance is shared by all the TerminalFUs belonging to
122 /// the operation.
124};
125
126}
127
128#endif
std::shared_ptr< ProgramOperation > ProgramOperationPtr
Definition MoveNode.hh:53
virtual bool equals(const Terminal &other) const
bool hasProgramOperation() const
these methods are used to group terminals belonging to a single program operation invocation
int opIndex_
Operation index.
const TTAMachine::HWOperation * operation_
Operation code transported to the port.
virtual bool isTriggering() const
virtual const TTAMachine::FunctionUnit & functionUnit() const
virtual Operation & hintOperation() const
ProgramOperationPtr po_
The ProgramOperation this terminal belongs to, if applicable. The instance is shared by all the Termi...
virtual bool isRA() const
virtual Operation & operation() const
virtual void setOperationIndex(int index)
void setProgramOperation(ProgramOperationPtr po)
virtual TCEString toString() const
virtual void setOperation(const TTAMachine::HWOperation &hwOp)
virtual const TTAMachine::Port & port() const
ProgramOperationPtr programOperation() const
const TTAMachine::BaseFUPort & port_
Port of the unit.
virtual bool isOpcodeSetting() const
virtual int operationIndex() const
virtual Terminal * copy() const
virtual const TTAMachine::HWOperation * hwOperation() const
virtual bool isFUPort() const
TerminalFUPort & operator=(const TerminalFUPort &)
Assignment not allowed.
Operation * opcode_
The OSAL operation.
void setHintOperation(const char *name)
virtual int index() const
Definition Terminal.cc:274