gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
registers.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  * Authors: Korey Sewell
30  */
31 
32 #ifndef __ARCH_MIPS_REGISTERS_HH__
33 #define __ARCH_MIPS_REGISTERS_HH__
34 
36 #include "arch/generic/vec_reg.hh"
37 #include "arch/mips/generated/max_inst_regs.hh"
38 #include "base/logging.hh"
39 #include "base/types.hh"
40 
41 class ThreadContext;
42 
43 namespace MipsISA
44 {
45 
47 using MipsISAInst::MaxInstDestRegs;
49 
50 // Constants Related to the number of registers
51 const int NumIntArchRegs = 32;
52 const int NumIntSpecialRegs = 9;
53 const int NumFloatArchRegs = 32;
54 const int NumFloatSpecialRegs = 5;
55 
56 const int MaxShadowRegSets = 16; // Maximum number of shadow register sets
57 const int NumIntRegs = NumIntArchRegs + NumIntSpecialRegs; //HI & LO Regs
58 const int NumFloatRegs = NumFloatArchRegs + NumFloatSpecialRegs;//
59 const int NumVecRegs = 1; // Not applicable to MIPS
60  // (1 to prevent warnings)
61 const int NumVecPredRegs = 1; // Not applicable to MIPS
62  // (1 to prevent warnings)
63 const int NumCCRegs = 0;
64 
65 const uint32_t MIPS32_QNAN = 0x7fbfffff;
66 const uint64_t MIPS64_QNAN = ULL(0x7ff7ffffffffffff);
67 
74 };
75 
76 enum FCSRBits {
77  Inexact = 1,
83 };
84 
85 enum FCSRFields {
89 };
90 
107 };
108 
109 // semantically meaningful register indices
110 const int ZeroReg = 0;
111 const int AssemblerReg = 1;
112 const int SyscallSuccessReg = 7;
113 const int FirstArgumentReg = 4;
114 const int ReturnValueReg = 2;
115 
116 const int KernelReg0 = 26;
117 const int KernelReg1 = 27;
118 const int GlobalPointerReg = 28;
119 const int StackPointerReg = 29;
120 const int FramePointerReg = 30;
121 const int ReturnAddressReg = 31;
122 
124 
125 // Enumerate names for 'Control' Registers in the CPU
126 // Reference MIPS32 Arch. for Programmers, Vol. III, Ch.8
127 // (Register Number-Register Select) Summary of Register
128 //------------------------------------------------------
129 // The first set of names classify the CP0 names as Register Banks
130 // for easy indexing when using the 'RD + SEL' index combination
131 // in CP0 instructions.
133  MISCREG_INDEX = 0, //Bank 0: 0 - 3
137 
138  MISCREG_CP0_RANDOM = 8, //Bank 1: 8 - 15
146 
147  MISCREG_ENTRYLO0 = 16, //Bank 2: 16 - 23
155 
156  MISCREG_ENTRYLO1 = 24, // Bank 3: 24
157 
158  MISCREG_CONTEXT = 32, // Bank 4: 32 - 33
160 
161  MISCREG_PAGEMASK = 40, //Bank 5: 40 - 41
163 
164  MISCREG_WIRED = 48, //Bank 6:48-55
170 
171  MISCREG_HWRENA = 56, //Bank 7: 56-63
172 
173  MISCREG_BADVADDR = 64, //Bank 8: 64-71
174 
175  MISCREG_COUNT = 72, //Bank 9: 72-79
176 
177  MISCREG_ENTRYHI = 80, //Bank 10: 80-87
178 
179  MISCREG_COMPARE = 88, //Bank 11: 88-95
180 
181  MISCREG_STATUS = 96, //Bank 12: 96-103
185 
186  MISCREG_CAUSE = 104, //Bank 13: 104-111
187 
188  MISCREG_EPC = 112, //Bank 14: 112-119
189 
190  MISCREG_PRID = 120, //Bank 15: 120-127,
192 
193  MISCREG_CONFIG = 128, //Bank 16: 128-135
201 
202 
203  MISCREG_LLADDR = 136, //Bank 17: 136-143
204 
205  MISCREG_WATCHLO0 = 144, //Bank 18: 144-151
213 
214  MISCREG_WATCHHI0 = 152, //Bank 19: 152-159
222 
223  MISCREG_XCCONTEXT64 = 160, //Bank 20: 160-167
224 
225  //Bank 21: 168-175
226 
227  //Bank 22: 176-183
228 
229  MISCREG_DEBUG = 184, //Bank 23: 184-191
234 
235  MISCREG_DEPC = 192, //Bank 24: 192-199
236 
237  MISCREG_PERFCNT0 = 200, //Bank 25: 200-207
245 
246  MISCREG_ERRCTL = 208, //Bank 26: 208-215
247 
248  MISCREG_CACHEERR0 = 216, //Bank 27: 216-223
252 
253  MISCREG_TAGLO0 = 224, //Bank 28: 224-231
261 
262  MISCREG_TAGHI0 = 232, //Bank 29: 232-239
270 
271 
272  MISCREG_ERROR_EPC = 240, //Bank 30: 240-247
273 
274  MISCREG_DESAVE = 248, //Bank 31: 248-256
275 
278 
280 };
281 
283 
284 const int TotalNumRegs = NumIntRegs + NumFloatRegs + NumMiscRegs;
285 
286 // Not applicable to MIPS
293 
294 // Not applicable to MIPS
300 
301 } // namespace MipsISA
302 
303 #endif
constexpr size_t VecPredRegSizeBits
Definition: registers.hh:298
const int NumCCRegs
Definition: registers.hh:63
const int SyscallPseudoReturnReg
Definition: registers.hh:123
const int KernelReg0
Definition: registers.hh:116
const int KernelReg1
Definition: registers.hh:117
const int NumFloatSpecialRegs
Definition: registers.hh:54
const int ReturnValueReg
Definition: registers.hh:114
constexpr unsigned DummyNumVecElemPerVecReg
Definition: vec_reg.hh:664
Vector Register Abstraction This generic class is the model in a particularization of MVC...
Definition: vec_reg.hh:160
::DummyVecElem VecElem
Definition: registers.hh:287
constexpr bool DummyVecPredRegHasPackedRepr
Dummy type aliases and constants for architectures that do not implement vector predicate registers...
const uint32_t MIPS32_QNAN
Definition: registers.hh:65
const int NumIntRegs
Definition: registers.hh:57
VecRegT< DummyVecElem, DummyNumVecElemPerVecReg, true > DummyConstVecReg
Definition: vec_reg.hh:666
const int AssemblerReg
Definition: registers.hh:111
constexpr bool VecPredRegHasPackedRepr
Definition: registers.hh:299
uint32_t DummyVecElem
Dummy type aliases and constants for architectures that do not implement vector registers.
Definition: vec_reg.hh:663
const int MaxInstSrcRegs
Definition: registers.hh:59
const int NumFloatArchRegs
Definition: registers.hh:53
const int GlobalPointerReg
Definition: registers.hh:118
DummyVecPredReg::Container DummyVecPredRegContainer
ThreadContext is the external interface to all thread state for anything outside of the CPU...
constexpr size_t DummyVecPredRegSizeBits
const int NumIntSpecialRegs
Definition: registers.hh:52
const int SyscallSuccessReg
Definition: registers.hh:112
const int MaxMiscDestRegs
Definition: registers.hh:70
Predicate register view.
Definition: vec_pred_reg.hh:70
constexpr size_t VecRegSizeBytes
Definition: registers.hh:292
const int NumIntArchRegs
Definition: registers.hh:51
FPControlRegNums
Definition: registers.hh:68
MiscIntRegNums
Definition: registers.hh:91
VecRegT< DummyVecElem, DummyNumVecElemPerVecReg, false > DummyVecReg
Definition: vec_reg.hh:665
const int NumVecRegs
Definition: registers.hh:59
DummyVecReg::Container DummyVecRegContainer
Definition: vec_reg.hh:667
const int NumVecPredRegs
Definition: registers.hh:61
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
const int FirstArgumentReg
Definition: registers.hh:113
#define ULL(N)
uint64_t constant
Definition: types.hh:50
const int ZeroReg
Definition: registers.hh:110
const int ReturnAddressReg
Definition: registers.hh:121
const int FramePointerReg
Definition: registers.hh:120
VecPredRegT< DummyVecElem, DummyNumVecElemPerVecReg, DummyVecPredRegHasPackedRepr, true > DummyConstVecPredReg
constexpr unsigned NumVecElemPerVecReg
Definition: registers.hh:291
const int TotalNumRegs
Definition: registers.hh:284
Vector Registers layout specification.
Generic predicate register container.
Definition: vec_pred_reg.hh:51
const int StackPointerReg
Definition: registers.hh:119
const int NumFloatRegs
Definition: registers.hh:58
VecPredRegT< DummyVecElem, DummyNumVecElemPerVecReg, DummyVecPredRegHasPackedRepr, false > DummyVecPredReg
Vector Register Abstraction This generic class is a view in a particularization of MVC...
Definition: vec_reg.hh:174
const int NumMiscRegs
Definition: registers.hh:282
const int MaxShadowRegSets
Definition: registers.hh:56
constexpr size_t DummyVecRegSizeBytes
Definition: vec_reg.hh:668
const uint64_t MIPS64_QNAN
Definition: registers.hh:66

Generated on Fri Feb 28 2020 16:26:56 for gem5 by doxygen 1.8.13