2 * Copyright (c) 2007 MIPS Technologies, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 * Authors: Jaidev Patwardhan
31 #ifndef __ARCH_MIPS_PRA_CONSTANTS_HH__
32 #define __ARCH_MIPS_PRA_CONSTANTS_HH__
34 #include "arch/mips/types.hh"
35 #include "base/bitunion.hh"
42 // Need to figure out how to put in the TLB specific bits here
43 // For now, we assume that the entire length is used by the index
44 // field In reality, Index_HI = N-1, where
45 // N = Ceiling(log2(TLB Entries))
46 Bitfield<30, 0> index;
50 // This has a problem similar to the IndexReg index field. We'll keep
51 // both consistent at 30 for now
52 Bitfield<30, 0> random;
53 EndBitUnion(RandomReg)
55 BitUnion64(EntryLoReg)
56 Bitfield<63, 30> fill;
57 Bitfield<29, 6> pfn; // Page frame number
58 Bitfield<5, 3> c; // Coherency attribute
59 Bitfield<2> d; // Dirty Bit
60 Bitfield<1> v; // Valid Bit
61 Bitfield<0> g; // Global Bit
62 EndBitUnion(EntryLoReg)
64 BitUnion64(ContextReg)
65 Bitfield<63, 23> pteBase;
66 Bitfield<22, 4> badVPN2;
68 EndBitUnion(ContextReg)
70 BitUnion32(PageMaskReg)
72 Bitfield<28, 13> mask;
73 Bitfield<12, 11> maskx;
75 EndBitUnion(PageMaskReg)
77 BitUnion32(PageGrainReg)
78 Bitfield<31, 30> aseUp;
81 // Bits 27-13 are zeros
82 Bitfield<12, 8> aseDn;
84 EndBitUnion(PageGrainReg)
87 // See note on Index register above
88 Bitfield<30, 0> wired;
92 Bitfield<31, 30> impl;
94 EndBitUnion(HWREnaReg)
96 BitUnion64(EntryHiReg)
98 Bitfield<61, 40> fill;
99 Bitfield<39, 13> vpn2;
100 Bitfield<12, 11> vpn2x;
102 EndBitUnion(EntryHiReg)
104 BitUnion32(StatusReg)
105 SubBitUnion(cu, 31, 28)
121 Bitfield<17, 16> impl;
122 Bitfield<15, 10> ipl;
140 EndBitUnion(StatusReg)
142 BitUnion32(IntCtlReg)
143 Bitfield<31, 29> ipti;
144 Bitfield<28, 26> ippci;
145 // Bits 26-10 are zeros
147 // Bits 4-0 are zeros
148 EndBitUnion(IntCtlReg)
150 BitUnion32(SRSCtlReg)
151 // Bits 31-30 are zeros
152 Bitfield<29, 26> hss;
153 // Bits 25-22 are zeros
154 Bitfield<21, 18> eicss;
155 // Bits 17-16 are zeros
156 Bitfield<15, 12> ess;
157 // Bits 11-10 are zeros
159 // Bits 5-4 are zeros
161 EndBitUnion(SRSCtlReg)
163 BitUnion32(SRSMapReg)
164 Bitfield<31, 28> ssv7;
165 Bitfield<27, 24> ssv6;
166 Bitfield<23, 20> ssv5;
167 Bitfield<19, 16> ssv4;
168 Bitfield<15, 12> ssv3;
169 Bitfield<11, 8> ssv2;
172 EndBitUnion(SRSMapReg)
180 // Bits 25-24 are zeros
183 // Bits 21-16 are zeros
184 Bitfield<15, 10> ripl;
194 Bitfield<6, 2> excCode;
195 // Bits 1-0 are zeros
196 EndBitUnion(CauseReg)
199 Bitfield<31, 24> coOp;
200 Bitfield<23, 16> coId;
201 Bitfield<15, 8> procId;
208 Bitfield<29, 12> exceptionBase;
209 // Bits 11-10 are zeros
210 Bitfield<9, 9> cpuNum;
211 EndBitUnion(EBaseReg)
213 BitUnion32(ConfigReg)
215 Bitfield<30, 28> k23;
217 Bitfield<24, 16> impl;
222 // Bits 6-4 are zeros
225 EndBitUnion(ConfigReg)
227 BitUnion32(Config1Reg)
229 Bitfield<30, 25> mmuSize;
243 EndBitUnion(Config1Reg)
245 BitUnion32(Config2Reg)
255 EndBitUnion(Config2Reg)
257 BitUnion32(Config3Reg)
259 // Bits 30-11 are zeros
261 // Bits 9-8 are zeros
270 EndBitUnion(Config3Reg)
272 BitUnion64(WatchLoReg)
273 Bitfield<63, 3> vaddr;
277 EndBitUnion(WatchLoReg)
279 BitUnion32(WatchHiReg)
282 // Bits 29-24 are zeros
283 Bitfield<23, 16> asid;
284 // Bits 15-12 are zeros
285 Bitfield<11, 3> mask;
289 EndBitUnion(WatchHiReg)
291 BitUnion32(PerfCntCtlReg)
294 // Bits 29-11 are zeros
295 Bitfield<10, 5> event;
301 EndBitUnion(PerfCntCtlReg)
303 BitUnion32(CacheErrReg)
311 Bitfield<24, 22> impl;
312 Bitfield<22, 0> index;
313 EndBitUnion(CacheErrReg)
316 Bitfield<31, 8> pTagLo;
317 Bitfield<7, 6> pState;
320 // Bits 2-1 are zeros
322 EndBitUnion(TagLoReg)
324 } // namespace MipsISA