OpenASIP  2.0
MoveElement.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 MoveElement.hh
26  *
27  * Declaration of MoveElement class.
28  *
29  * @author Jussi Nykänen 2003 (nykanen-no.spam-cs.tut.fi)
30  * @author Mikael Lepistö 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 #ifndef TTA_MOVE_ELEMENT_HH
37 #define TTA_MOVE_ELEMENT_HH
38 
39 #include "TPEFBaseType.hh"
40 #include "InstructionElement.hh"
41 
42 namespace TPEF {
43 
44 /**
45  * Move instruction.
46  */
48 public:
49  /**
50  * Type of resource that is referred by unit / index pair.
51  */
52  enum FieldType {
53  MF_NULL, ///< Illegal field.
54  MF_RF, ///< Register file.
55  MF_IMM, ///< Immediate.
56  MF_UNIT ///< Function unit.
57  };
58 
59  MoveElement();
60  virtual ~MoveElement();
61 
62  bool isEmpty() const;
63  void setEmpty(bool flag);
64 
65  HalfWord bus() const;
66  void setBus(HalfWord aBus);
67 
68  FieldType sourceType() const;
69  void setSourceType(FieldType aType);
70 
71  HalfWord sourceUnit() const;
72  void setSourceUnit(HalfWord aSourceUnit);
73 
74  HalfWord sourceIndex() const;
75  void setSourceIndex(HalfWord aSourceIndex);
76 
77  FieldType destinationType() const;
78  void setDestinationType(FieldType aType);
79 
80  HalfWord destinationUnit() const;
81  void setDestinationUnit(HalfWord aDestinationUnit);
82 
83  HalfWord destinationIndex() const;
84  void setDestinationIndex(HalfWord aDestinationIndex);
85 
86  FieldType guardType() const;
87  void setGuardType(FieldType gType);
88 
89  HalfWord guardUnit() const;
90  void setGuardUnit(HalfWord aGuardUnit);
91 
92  HalfWord guardIndex() const;
93  void setGuardIndex(HalfWord aGuardIndex);
94 
95  bool isGuarded() const;
96  void setGuarded(bool flag);
97 
98  bool isGuardInverted() const;
99  void setGuardInverted(bool flag);
100 
101 private:
102  /// Empty move bit.
103  bool isEmpty_;
104  /// Move bus identifier.
105  HalfWord bus_;
106  /// The type of Move source.
108  /// The type of move destination.
110  /// Move source unit or register file.
111  HalfWord sourceUnit_;
112  /// Move destination unit or register file identifier.
114  /// Move source register index.
115  HalfWord sourceIndex_;
116  /// Move destination register index.
118  /// Move guard enable bit.
120  /// Move guard inverted bit.
122  /// Guard type.
124  /// Guard register file / unit identifier.
125  HalfWord guardUnit_;
126  /// Guard register index.
127  HalfWord guardIndex_;
128 };
129 }
130 
131 #include "MoveElement.icc"
132 
133 #endif
MoveElement.icc
TPEF::MoveElement::setGuardInverted
void setGuardInverted(bool flag)
TPEF::MoveElement::guardType_
FieldType guardType_
Guard type.
Definition: MoveElement.hh:123
TPEF::MoveElement::bus_
HalfWord bus_
Move bus identifier.
Definition: MoveElement.hh:105
TPEF::MoveElement::isGuarded
bool isGuarded() const
TPEF::InstructionElement
Definition: InstructionElement.hh:77
TPEF::MoveElement::setDestinationUnit
void setDestinationUnit(HalfWord aDestinationUnit)
TPEF::MoveElement::MF_UNIT
@ MF_UNIT
Function unit.
Definition: MoveElement.hh:56
TPEF::MoveElement::sourceUnit_
HalfWord sourceUnit_
Move source unit or register file.
Definition: MoveElement.hh:111
TPEF::MoveElement::FieldType
FieldType
Definition: MoveElement.hh:52
TPEF::MoveElement::isGuardInverted_
bool isGuardInverted_
Move guard inverted bit.
Definition: MoveElement.hh:121
TPEF::MoveElement::setGuarded
void setGuarded(bool flag)
TPEF::MoveElement::MF_IMM
@ MF_IMM
Immediate.
Definition: MoveElement.hh:55
TPEF::MoveElement::MF_NULL
@ MF_NULL
Illegal field.
Definition: MoveElement.hh:53
InstructionElement.hh
TPEF::MoveElement::sourceIndex
HalfWord sourceIndex() const
TPEF::MoveElement::isGuardInverted
bool isGuardInverted() const
TPEF::MoveElement::setDestinationType
void setDestinationType(FieldType aType)
TPEF::MoveElement::MoveElement
MoveElement()
Definition: MoveElement.cc:45
TPEF::MoveElement::setBus
void setBus(HalfWord aBus)
TPEF::MoveElement::bus
HalfWord bus() const
TPEF::MoveElement::MF_RF
@ MF_RF
Register file.
Definition: MoveElement.hh:54
TPEF::MoveElement::sourceUnit
HalfWord sourceUnit() const
TPEF::MoveElement::setGuardIndex
void setGuardIndex(HalfWord aGuardIndex)
TPEF::MoveElement::guardIndex
HalfWord guardIndex() const
TPEF::MoveElement::sourceIndex_
HalfWord sourceIndex_
Move source register index.
Definition: MoveElement.hh:115
TPEF::MoveElement
Definition: MoveElement.hh:47
TPEF::MoveElement::guardUnit_
HalfWord guardUnit_
Guard register file / unit identifier.
Definition: MoveElement.hh:125
TPEF::MoveElement::setEmpty
void setEmpty(bool flag)
TPEF::MoveElement::destinationIndex
HalfWord destinationIndex() const
TPEF::MoveElement::setDestinationIndex
void setDestinationIndex(HalfWord aDestinationIndex)
TPEF::MoveElement::destinationUnit_
HalfWord destinationUnit_
Move destination unit or register file identifier.
Definition: MoveElement.hh:113
TPEF::MoveElement::guardIndex_
HalfWord guardIndex_
Guard register index.
Definition: MoveElement.hh:127
TPEF::MoveElement::isEmpty_
bool isEmpty_
Empty move bit.
Definition: MoveElement.hh:103
TPEF::MoveElement::destinationIndex_
HalfWord destinationIndex_
Move destination register index.
Definition: MoveElement.hh:117
TPEF::MoveElement::destinationType
FieldType destinationType() const
TPEF::MoveElement::setGuardType
void setGuardType(FieldType gType)
TPEF::MoveElement::destinationUnit
HalfWord destinationUnit() const
TPEF::MoveElement::sourceType_
FieldType sourceType_
The type of Move source.
Definition: MoveElement.hh:107
TPEF::MoveElement::guardType
FieldType guardType() const
TPEF::MoveElement::setSourceUnit
void setSourceUnit(HalfWord aSourceUnit)
TPEF::MoveElement::isGuarded_
bool isGuarded_
Move guard enable bit.
Definition: MoveElement.hh:119
TPEF::MoveElement::isEmpty
bool isEmpty() const
TPEF::MoveElement::setSourceIndex
void setSourceIndex(HalfWord aSourceIndex)
TPEF::MoveElement::~MoveElement
virtual ~MoveElement()
Definition: MoveElement.cc:57
TPEF::MoveElement::sourceType
FieldType sourceType() const
TPEFBaseType.hh
TPEF::MoveElement::destinationType_
FieldType destinationType_
The type of move destination.
Definition: MoveElement.hh:109
TPEF::MoveElement::guardUnit
HalfWord guardUnit() const
TPEF::MoveElement::setSourceType
void setSourceType(FieldType aType)
TPEF
Definition: Assembler.hh:43
TPEF::MoveElement::setGuardUnit
void setGuardUnit(HalfWord aGuardUnit)