OpenASIP 2.2
Loading...
Searching...
No Matches
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
42namespace TPEF {
43
44/**
45 * Move instruction.
46 */
48public:
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
60 virtual ~MoveElement();
61
62 bool isEmpty() const;
63 void setEmpty(bool flag);
64
65 HalfWord bus() const;
66 void setBus(HalfWord aBus);
67
70
71 HalfWord sourceUnit() const;
72 void setSourceUnit(HalfWord aSourceUnit);
73
74 HalfWord sourceIndex() const;
75 void setSourceIndex(HalfWord aSourceIndex);
76
79
80 HalfWord destinationUnit() const;
81 void setDestinationUnit(HalfWord aDestinationUnit);
82
83 HalfWord destinationIndex() const;
84 void setDestinationIndex(HalfWord aDestinationIndex);
85
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
101private:
102 /// Empty move bit.
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
HalfWord bus_
Move bus identifier.
HalfWord sourceUnit_
Move source unit or register file.
void setGuardIndex(HalfWord aGuardIndex)
bool isGuarded() const
HalfWord destinationIndex_
Move destination register index.
FieldType destinationType() const
HalfWord destinationIndex() const
HalfWord sourceIndex_
Move source register index.
void setSourceType(FieldType aType)
HalfWord guardUnit_
Guard register file / unit identifier.
void setGuardInverted(bool flag)
HalfWord destinationUnit() const
bool isEmpty() const
bool isGuarded_
Move guard enable bit.
HalfWord bus() const
HalfWord guardUnit() const
void setSourceIndex(HalfWord aSourceIndex)
FieldType destinationType_
The type of move destination.
HalfWord guardIndex_
Guard register index.
void setBus(HalfWord aBus)
FieldType sourceType_
The type of Move source.
void setDestinationUnit(HalfWord aDestinationUnit)
HalfWord sourceUnit() const
FieldType guardType() const
void setGuarded(bool flag)
void setSourceUnit(HalfWord aSourceUnit)
HalfWord guardIndex() const
bool isGuardInverted() const
HalfWord destinationUnit_
Move destination unit or register file identifier.
void setGuardUnit(HalfWord aGuardUnit)
HalfWord sourceIndex() const
void setDestinationIndex(HalfWord aDestinationIndex)
bool isEmpty_
Empty move bit.
virtual ~MoveElement()
void setEmpty(bool flag)
bool isGuardInverted_
Move guard inverted bit.
FieldType sourceType() const
FieldType guardType_
Guard type.
void setDestinationType(FieldType aType)
void setGuardType(FieldType gType)
@ MF_RF
Register file.
@ MF_NULL
Illegal field.
@ MF_IMM
Immediate.
@ MF_UNIT
Function unit.