gem5  v22.1.0.0
int.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006 The Regents of The University of Michigan
3  * Copyright (c) 2007 MIPS Technologies, Inc.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met: redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer;
10  * redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution;
13  * neither the name of the copyright holders nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef __ARCH_MIPS_REGS_INT_HH__
31 #define __ARCH_MIPS_REGS_INT_HH__
32 
33 #include "cpu/reg_class.hh"
34 #include "debug/IntRegs.hh"
35 
36 namespace gem5
37 {
38 namespace MipsISA
39 {
40 
41 // Constants Related to the number of registers
42 
43 const int MaxShadowRegSets = 16; // Maximum number of shadow register sets
44 
45 namespace int_reg
46 {
47 
48 enum : RegIndex
49 {
50  _ZeroIdx = 0,
51 
52  _AtIdx = 1,
53 
54  _V0Idx = 2,
55  _V1Idx = 3,
56 
57  _A0Idx = 4,
58  _A1Idx = 5,
59  _A2Idx = 6,
60  _A3Idx = 7,
61 
62  _T0Idx = 8,
63  _T1Idx = 9,
64  _T2Idx = 10,
65  _T3Idx = 11,
66  _T4Idx = 12,
67  _T5Idx = 13,
68  _T6Idx = 14,
69  _T7Idx = 15,
70 
71  _S0Idx = 16,
72  _S1Idx = 17,
73  _S2Idx = 18,
74  _S3Idx = 19,
75  _S4Idx = 20,
76  _S5Idx = 21,
77  _S6Idx = 22,
78  _S7Idx = 23,
79 
80  _T8Idx = 24,
81  _T9Idx = 25,
82 
83  _K0Idx = 26,
84  _K1Idx = 27,
85 
86  _GpIdx = 28,
87 
88  _SpIdx = 29,
89 
90  _S8Idx = 30,
92 
93  _RaIdx = 31,
94 
96 
102 
106 
110 
114 
116 
117  NumRegs
118 };
119 
120 } // namespace int_reg
121 
123  int_reg::NumRegs, debug::IntRegs);
124 
125 namespace int_reg
126 {
127 
128 inline constexpr RegId
129  // Zero register.
131 
132  // Assembly temporary.
134 
135  // Value returned by subroutine.
138 
139  // Arguments for subroutine.
144 
145  // Temporaries.
156 
157  // Subroutine registers.
166 
167  // For use in an interrupt/trap handler.
170 
171  // Global pointer.
173 
174  // Stack pointer.
176 
177  // Frame pointer.
179 
180  // Return address.
182 
186 
190 
194 
198 
200 
201 // Register aliases.
202 inline constexpr auto
203  &S8 = Fp,
204 
205  &Lo = DspLo0,
206  &Hi = DspHi0,
207 
209 
210 } // namespace int_reg
211 } // namespace MipsISA
212 } // namespace gem5
213 
214 #endif
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:91
constexpr RegId A1
Definition: int.hh:141
constexpr RegId V1
Definition: int.hh:137
constexpr RegId T1
Definition: int.hh:147
constexpr RegId DspHi1
Definition: int.hh:188
constexpr auto & Lo
Definition: int.hh:205
constexpr RegId DspHi0
Definition: int.hh:184
constexpr RegId Zero
Definition: int.hh:130
constexpr RegId DspAcx2
Definition: int.hh:193
constexpr RegId T5
Definition: int.hh:151
constexpr auto & SyscallSuccess
Definition: int.hh:208
constexpr RegId T3
Definition: int.hh:149
constexpr RegId T4
Definition: int.hh:150
constexpr RegId T9
Definition: int.hh:155
constexpr RegId DspAcx0
Definition: int.hh:185
constexpr RegId Gp
Definition: int.hh:172
constexpr RegId S0
Definition: int.hh:158
constexpr RegId K0
Definition: int.hh:168
constexpr RegId A0
Definition: int.hh:140
constexpr RegId DspHi3
Definition: int.hh:196
constexpr RegId Ra
Definition: int.hh:181
constexpr RegId DspHi2
Definition: int.hh:192
constexpr auto & S8
Definition: int.hh:203
constexpr RegId S2
Definition: int.hh:160
constexpr RegId DspLo0
Definition: int.hh:183
constexpr auto & Hi
Definition: int.hh:206
constexpr RegId S7
Definition: int.hh:165
constexpr RegId DspLo3
Definition: int.hh:195
constexpr RegId T7
Definition: int.hh:153
constexpr RegId T0
Definition: int.hh:146
constexpr RegId V0
Definition: int.hh:136
constexpr RegId DspAcx3
Definition: int.hh:197
constexpr RegId At
Definition: int.hh:133
constexpr RegId A2
Definition: int.hh:142
constexpr RegId DspControl
Definition: int.hh:199
constexpr RegId Sp
Definition: int.hh:175
constexpr RegId DspLo2
Definition: int.hh:191
constexpr RegId S6
Definition: int.hh:164
constexpr RegId A3
Definition: int.hh:143
constexpr RegId T6
Definition: int.hh:152
constexpr RegId S1
Definition: int.hh:159
constexpr RegId S5
Definition: int.hh:163
constexpr RegId DspLo1
Definition: int.hh:187
constexpr RegId S3
Definition: int.hh:161
constexpr RegId T2
Definition: int.hh:148
constexpr RegId S4
Definition: int.hh:162
constexpr RegId K1
Definition: int.hh:169
constexpr RegId T8
Definition: int.hh:154
constexpr RegId Fp
Definition: int.hh:178
constexpr RegId DspAcx1
Definition: int.hh:189
constexpr RegClass intRegClass(IntRegClass, IntRegClassName, int_reg::NumRegs, debug::IntRegs)
const int MaxShadowRegSets
Definition: int.hh:43
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint16_t RegIndex
Definition: types.hh:176
constexpr char IntRegClassName[]
Definition: reg_class.hh:73
@ IntRegClass
Integer register.
Definition: reg_class.hh:60

Generated on Wed Dec 21 2022 10:22:26 for gem5 by doxygen 1.9.1