OpenASIP  2.0
MoveElement.icc
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 MoveElement.icc
26  *
27  * Inline definitions of MoveElement class.
28  *
29  * @author Jussi Nykänen 2003 (nykanen-no.spam-cs.tut.fi)
30  * @author Mikael Lepistö 18.12.2003 (tmlepist-no.spam-cs.tut.fi)
31  * @note reviewed 21 October 2003 by ml, jn, rm, pj
32  *
33  * @note rating: yellow
34  */
35 
36 namespace TPEF {
37 
38 /**
39  * Returns true if move is emptyed.
40  *
41  * @return True if move is empty.
42  */
43 inline bool
44 MoveElement::isEmpty() const {
45  return isEmpty_;
46 }
47 
48 
49 /**
50  * Sets emptiness status of move.
51  *
52  * @param flag Status to set.
53  */
54 inline void
55 MoveElement::setEmpty(bool flag) {
56  isEmpty_ = flag;
57 }
58 
59 /**
60  * Returns bus id.
61  *
62  * @return The bus id.
63  */
64 inline HalfWord
65 MoveElement::bus() const {
66  return bus_;
67 }
68 
69 /**
70  * Sets the bus identification code.
71  *
72  * @param aBus The bus identification code to set.
73  */
74 inline void
75 MoveElement::setBus(HalfWord aBus) {
76  bus_ = aBus;
77 }
78 
79 /**
80  * Returns source type.
81  *
82  * If source type is MVS_IMM it means that source refers to immediate
83  * element inside current instruction. Immediate element, which is
84  * may be determined by value of sourceUnit() and sourceIndex(). Referred
85  * Corresponding ImmediateElement, which has same values in destinationUnit()
86  * and destinationIndex() fields.
87  *
88  * @return The source type.
89  */
90 inline MoveElement::FieldType
91 MoveElement::sourceType() const {
92  return sourceType_;
93 }
94 
95 /**
96  * Returns destination type.
97  *
98  * @return The destination type.
99  */
100 inline MoveElement::FieldType
101 MoveElement::destinationType() const {
102  return destinationType_;
103 }
104 
105 /**
106  * Sets the type of the move source.
107  *
108  * @param aType The type of the source.
109  */
110 inline void
111 MoveElement::setSourceType(FieldType aType) {
112  sourceType_ = aType;
113 }
114 
115 /**
116  * Sets the type of the move destination.
117  *
118  * @param aType The type of the destination.
119  */
120 inline void
121 MoveElement::setDestinationType(FieldType aType) {
122  destinationType_ = aType;
123 }
124 
125 /**
126  * Returns the source register file or unit.
127  *
128  * See sourceType().
129  *
130  * @return The source register file or unit.
131  */
132 inline HalfWord
133 MoveElement::sourceUnit() const {
134  return sourceUnit_;
135 }
136 
137 /**
138  * Sets source register file or unit.
139  *
140  * See sourceType().
141  *
142  * @param aSourceUnit The source register file or unit.
143  */
144 inline void
145 MoveElement::setSourceUnit(HalfWord aSourceUnit) {
146  sourceUnit_ = aSourceUnit;
147 }
148 
149 /**
150  * Returns source register index.
151  *
152  * See sourceType().
153  *
154  * @return The source register index.
155  */
156 inline HalfWord
157 MoveElement::sourceIndex() const {
158  return sourceIndex_;
159 }
160 
161 /**
162  * Sets source register index.
163  *
164  * See sourceType().
165  *
166  * @param aSourceIndex The source register index.
167  */
168 inline void
169 MoveElement::setSourceIndex(HalfWord aSourceIndex) {
170  sourceIndex_ = aSourceIndex;
171 }
172 
173 /**
174  * Returns destination register file or unit.
175  *
176  * @return The destination register file or unit.
177  */
178 inline HalfWord
179 MoveElement::destinationUnit() const {
180  return destinationUnit_;
181 }
182 
183 /**
184  * Sets destination register file or unit.
185  *
186  * @param aDestinationUnit The destination register file or unit.
187  */
188 inline void
189 MoveElement::setDestinationUnit(HalfWord aDestinationUnit) {
190  destinationUnit_ = aDestinationUnit;
191 }
192 
193 /**
194  * Returns destination register index.
195  *
196  * @return The destination register index.
197  */
198 inline HalfWord
199 MoveElement::destinationIndex() const {
200  return destinationIndex_;
201 }
202 
203 /**
204  * Sets destination register index.
205  *
206  * @param aDestinationIndex The destination register index.
207  */
208 inline void
209 MoveElement::setDestinationIndex(HalfWord aDestinationIndex) {
210  destinationIndex_ = aDestinationIndex;
211 }
212 
213 /**
214  * Returns true if guard of instruction is enabled.
215  *
216  * @return True if guard is enabled.
217  */
218 inline bool
219 MoveElement::isGuarded() const {
220  return isGuarded_;
221 }
222 
223 
224 /**
225  * Sets guard enabled status of move.
226  *
227  * @param flag Status to set.
228  */
229 inline void
230 MoveElement::setGuarded(bool flag) {
231  isGuarded_ = flag;
232 }
233 
234 /**
235  * Returns true if guard of move is inverted.
236  *
237  * @return True if guard is inverted.
238  */
239 inline bool
240 MoveElement::isGuardInverted() const {
241  return isGuardInverted_;
242 }
243 
244 /**
245  * Sets inversion of guard register.
246  *
247  * @param flag Status to set.
248  */
249 inline void
250 MoveElement::setGuardInverted(bool flag) {
251  isGuardInverted_ = flag;
252 }
253 
254 /**
255  * Returns type of referred guard register or port.
256  *
257  * @return Type of guard.
258  */
259 inline MoveElement::FieldType
260 MoveElement::guardType() const {
261  return guardType_;
262 }
263 
264 /**
265  * Sets type of referred guard register or port.
266  *
267  * @param gType Type of guard.
268  */
269 inline void
270 MoveElement::setGuardType(FieldType gType) {
271  guardType_ = gType;
272 }
273 
274 /**
275  * Returns the guard register file id
276  *
277  * @return The guard register file id.
278  */
279 inline HalfWord
280 MoveElement::guardUnit() const {
281  return guardUnit_;
282 }
283 
284 /**
285  * Sets guard register file id.
286  *
287  * @param aGuard The guard register file id.
288  */
289 inline void
290 MoveElement::setGuardUnit(HalfWord aGuardUnit) {
291  guardUnit_ = aGuardUnit;
292 }
293 
294 /**
295  * Returns guard register index.
296  *
297  * @return The guard register index.
298  */
299 inline HalfWord
300 MoveElement::guardIndex() const {
301  return guardIndex_;
302 }
303 
304 /**
305  * Sets guard register index.
306  *
307  * @param aGuardIndex The guard register index.
308  */
309 inline void
310 MoveElement::setGuardIndex(HalfWord aGuardIndex) {
311  guardIndex_ = aGuardIndex;
312 }
313 
314 }