OpenASIP  2.0
IndexBound.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2013 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 IndexBound.hh
26  *
27  * Declaration of Index class.
28  *
29  * @author Otto Esko 2013 (otto.esko-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_INDEX_BOUND_HH
34 #define TTA_INDEX_BOUND_HH
35 
36 /**
37  * Class for storing index information needed for fixing instruction addresses
38  * in InstructionBitVector
39  */
40 class IndexBound {
41 public:
42  IndexBound(unsigned int startIndex, unsigned int endIndex);
43 
44  IndexBound(
45  unsigned int startIndex,
46  unsigned int endIndex,
47  int limmWidth,
48  int limmLeftIndex,
49  int limmRightIndex);
50 
51  ~IndexBound();
52 
53  unsigned int slotStartIndex() const;
54 
55  unsigned int slotEndIndex() const;
56 
57  void incrStartIndex(unsigned int increment);
58 
59  void incrEndIndex(unsigned int increment);
60 
61  bool isLimmEncoded() const;
62 
63  int limmWidth() const;
64 
65  int limmLeftIndex() const;
66 
67  int limmRightIndex() const;
68 
69 private:
70 
71  IndexBound();
72 
73  /// Start index of the moveslot in instruction
74  unsigned int slotStartIndex_;
75  /// End index of the moveslot in instruction
76  unsigned int slotEndIndex_;
77  /// Is address encoded in long immediate
78  bool usesLimm_;
79  /// Width of the long immediate chunk in this moveslot
81  /// Index of the left most bit (MSB) of the value to be encoded in
82  /// this slot
84  /// Index of the right most bit (LSB) of the value to be encoded
85  /// in this slot
87 };
88 
89 #endif
IndexBound::IndexBound
IndexBound()
IndexBound::usesLimm_
bool usesLimm_
Is address encoded in long immediate.
Definition: IndexBound.hh:78
IndexBound::isLimmEncoded
bool isLimmEncoded() const
Definition: IndexBound.cc:120
IndexBound::incrEndIndex
void incrEndIndex(unsigned int increment)
Definition: IndexBound.cc:109
IndexBound::~IndexBound
~IndexBound()
Definition: IndexBound.cc:60
IndexBound::limmValueRightBitIndex_
int limmValueRightBitIndex_
Index of the right most bit (LSB) of the value to be encoded in this slot.
Definition: IndexBound.hh:86
IndexBound
Definition: IndexBound.hh:40
IndexBound::limmWidth
int limmWidth() const
Definition: IndexBound.cc:131
IndexBound::limmValueLeftBitIndex_
int limmValueLeftBitIndex_
Index of the left most bit (MSB) of the value to be encoded in this slot.
Definition: IndexBound.hh:83
IndexBound::slotStartIndex_
unsigned int slotStartIndex_
Start index of the moveslot in instruction.
Definition: IndexBound.hh:74
IndexBound::limmLeftIndex
int limmLeftIndex() const
Definition: IndexBound.cc:146
IndexBound::slotEndIndex
unsigned int slotEndIndex() const
Definition: IndexBound.cc:81
IndexBound::limmRightIndex
int limmRightIndex() const
Definition: IndexBound.cc:161
IndexBound::incrStartIndex
void incrStartIndex(unsigned int increment)
Definition: IndexBound.cc:95
IndexBound::slotStartIndex
unsigned int slotStartIndex() const
Definition: IndexBound.cc:70
IndexBound::limmWidth_
int limmWidth_
Width of the long immediate chunk in this moveslot.
Definition: IndexBound.hh:80
IndexBound::slotEndIndex_
unsigned int slotEndIndex_
End index of the moveslot in instruction.
Definition: IndexBound.hh:76