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;
123 SubBitUnion(im, 15, 8)
142 EndBitUnion(StatusReg)
144 BitUnion32(IntCtlReg)
145 Bitfield<31, 29> ipti;
146 Bitfield<28, 26> ippci;
147 // Bits 26-10 are zeros
149 // Bits 4-0 are zeros
150 EndBitUnion(IntCtlReg)
152 BitUnion32(SRSCtlReg)
153 // Bits 31-30 are zeros
154 Bitfield<29, 26> hss;
155 // Bits 25-22 are zeros
156 Bitfield<21, 18> eicss;
157 // Bits 17-16 are zeros
158 Bitfield<15, 12> ess;
159 // Bits 11-10 are zeros
161 // Bits 5-4 are zeros
163 EndBitUnion(SRSCtlReg)
165 BitUnion32(SRSMapReg)
166 Bitfield<31, 28> ssv7;
167 Bitfield<27, 24> ssv6;
168 Bitfield<23, 20> ssv5;
169 Bitfield<19, 16> ssv4;
170 Bitfield<15, 12> ssv3;
171 Bitfield<11, 8> ssv2;
174 EndBitUnion(SRSMapReg)
182 // Bits 25-24 are zeros
185 // Bits 21-16 are zeros
186 Bitfield<15, 10> ripl;
187 SubBitUnion(ip, 15, 8)
198 Bitfield<6, 2> excCode;
199 // Bits 1-0 are zeros
200 EndBitUnion(CauseReg)
203 Bitfield<31, 24> coOp;
204 Bitfield<23, 16> coId;
205 Bitfield<15, 8> procId;
212 Bitfield<29, 12> exceptionBase;
213 // Bits 11-10 are zeros
214 Bitfield<9, 9> cpuNum;
215 EndBitUnion(EBaseReg)
217 BitUnion32(ConfigReg)
219 Bitfield<30, 28> k23;
221 Bitfield<24, 16> impl;
226 // Bits 6-4 are zeros
229 EndBitUnion(ConfigReg)
231 BitUnion32(Config1Reg)
233 Bitfield<30, 25> mmuSize;
247 EndBitUnion(Config1Reg)
249 BitUnion32(Config2Reg)
259 EndBitUnion(Config2Reg)
261 BitUnion32(Config3Reg)
263 // Bits 30-11 are zeros
265 // Bits 9-8 are zeros
274 EndBitUnion(Config3Reg)
276 BitUnion64(WatchLoReg)
277 Bitfield<63, 3> vaddr;
281 EndBitUnion(WatchLoReg)
283 BitUnion32(WatchHiReg)
286 // Bits 29-24 are zeros
287 Bitfield<23, 16> asid;
288 // Bits 15-12 are zeros
289 Bitfield<11, 3> mask;
293 EndBitUnion(WatchHiReg)
295 BitUnion32(PerfCntCtlReg)
298 // Bits 29-11 are zeros
299 Bitfield<10, 5> event;
305 EndBitUnion(PerfCntCtlReg)
307 BitUnion32(CacheErrReg)
315 Bitfield<24, 22> impl;
316 Bitfield<22, 0> index;
317 EndBitUnion(CacheErrReg)
320 Bitfield<31, 8> pTagLo;
321 Bitfield<7, 6> pState;
324 // Bits 2-1 are zeros
326 EndBitUnion(TagLoReg)
328 } // namespace MipsISA