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.
29 #ifndef __ARCH_RISCV_PRA_CONSTANTS_HH__
30 #define __ARCH_RISCV_PRA_CONSTANTS_HH__
32 #include "arch/riscv/types.hh"
33 #include "base/bitunion.hh"
40 // Need to figure out how to put in the TLB specific bits here
41 // For now, we assume that the entire length is used by the index
42 // field In reality, Index_HI = N-1, where
43 // N = Ceiling(log2(TLB Entries))
44 Bitfield<30, 0> index;
48 // This has a problem similar to the IndexReg index field. We'll keep
49 // both consistent at 30 for now
50 Bitfield<30, 0> random;
51 EndBitUnion(RandomReg)
53 BitUnion64(EntryLoReg)
54 Bitfield<63, 30> fill;
55 Bitfield<29, 6> pfn; // Page frame number
56 Bitfield<5, 3> c; // Coherency attribute
57 Bitfield<2> d; // Dirty Bit
58 Bitfield<1> v; // Valid Bit
59 Bitfield<0> g; // Global Bit
60 EndBitUnion(EntryLoReg)
62 BitUnion64(ContextReg)
63 Bitfield<63, 23> pteBase;
64 Bitfield<22, 4> badVPN2;
66 EndBitUnion(ContextReg)
68 BitUnion32(PageMaskReg)
70 Bitfield<28, 13> mask;
71 Bitfield<12, 11> maskx;
73 EndBitUnion(PageMaskReg)
75 BitUnion32(PageGrainReg)
76 Bitfield<31, 30> aseUp;
79 // Bits 27-13 are zeros
80 Bitfield<12, 8> aseDn;
82 EndBitUnion(PageGrainReg)
85 // See note on Index register above
86 Bitfield<30, 0> wired;
90 Bitfield<31, 30> impl;
92 EndBitUnion(HWREnaReg)
94 BitUnion64(EntryHiReg)
96 Bitfield<61, 40> fill;
97 Bitfield<39, 13> vpn2;
98 Bitfield<12, 11> vpn2x;
100 EndBitUnion(EntryHiReg)
102 BitUnion32(StatusReg)
103 SubBitUnion(cu, 31, 28)
119 Bitfield<17, 16> impl;
120 Bitfield<15, 10> ipl;
121 SubBitUnion(im, 15, 8)
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;
185 SubBitUnion(ip, 15, 8)
196 Bitfield<6, 2> excCode;
197 // Bits 1-0 are zeros
198 EndBitUnion(CauseReg)
201 Bitfield<31, 24> coOp;
202 Bitfield<23, 16> coId;
203 Bitfield<15, 8> procId;
210 Bitfield<29, 12> exceptionBase;
211 // Bits 11-10 are zeros
212 Bitfield<9, 9> cpuNum;
213 EndBitUnion(EBaseReg)
215 BitUnion32(ConfigReg)
217 Bitfield<30, 28> k23;
219 Bitfield<24, 16> impl;
224 // Bits 6-4 are zeros
227 EndBitUnion(ConfigReg)
229 BitUnion32(Config1Reg)
231 Bitfield<30, 25> mmuSize;
245 EndBitUnion(Config1Reg)
247 BitUnion32(Config2Reg)
257 EndBitUnion(Config2Reg)
259 BitUnion32(Config3Reg)
261 // Bits 30-11 are zeros
263 // Bits 9-8 are zeros
272 EndBitUnion(Config3Reg)
274 BitUnion64(WatchLoReg)
275 Bitfield<63, 3> vaddr;
279 EndBitUnion(WatchLoReg)
281 BitUnion32(WatchHiReg)
284 // Bits 29-24 are zeros
285 Bitfield<23, 16> asid;
286 // Bits 15-12 are zeros
287 Bitfield<11, 3> mask;
291 EndBitUnion(WatchHiReg)
293 BitUnion32(PerfCntCtlReg)
296 // Bits 29-11 are zeros
297 Bitfield<10, 5> event;
303 EndBitUnion(PerfCntCtlReg)
305 BitUnion32(CacheErrReg)
313 Bitfield<24, 22> impl;
314 Bitfield<22, 0> index;
315 EndBitUnion(CacheErrReg)
318 Bitfield<31, 8> pTagLo;
319 Bitfield<7, 6> pState;
322 // Bits 2-1 are zeros
324 EndBitUnion(TagLoReg)
326 } // namespace RiscvISA