gem5  v20.1.0.0
isa.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 RISC-V Foundation
3  * Copyright (c) 2016 The University of Virginia
4  * Copyright (c) 2020 Barkhausen Institut
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met: redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer;
11  * redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution;
14  * neither the name of the copyright holders nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #include "arch/riscv/isa.hh"
32 
33 #include <ctime>
34 #include <set>
35 #include <sstream>
36 
37 #include "arch/riscv/interrupts.hh"
38 #include "arch/riscv/pagetable.hh"
39 #include "arch/riscv/registers.hh"
40 #include "base/bitfield.hh"
41 #include "base/compiler.hh"
42 #include "cpu/base.hh"
43 #include "debug/Checkpoint.hh"
44 #include "debug/RiscvMisc.hh"
45 #include "params/RiscvISA.hh"
46 #include "sim/core.hh"
47 #include "sim/pseudo_inst.hh"
48 
49 namespace RiscvISA
50 {
51 
52 const std::array<const char *, NumMiscRegs> M5_VAR_USED MiscRegNames = {{
53  [MISCREG_PRV] = "PRV",
54  [MISCREG_ISA] = "ISA",
55  [MISCREG_VENDORID] = "VENDORID",
56  [MISCREG_ARCHID] = "ARCHID",
57  [MISCREG_IMPID] = "IMPID",
58  [MISCREG_HARTID] = "HARTID",
59  [MISCREG_STATUS] = "STATUS",
60  [MISCREG_IP] = "IP",
61  [MISCREG_IE] = "IE",
62  [MISCREG_CYCLE] = "CYCLE",
63  [MISCREG_TIME] = "TIME",
64  [MISCREG_INSTRET] = "INSTRET",
65  [MISCREG_HPMCOUNTER03] = "HPMCOUNTER03",
66  [MISCREG_HPMCOUNTER04] = "HPMCOUNTER04",
67  [MISCREG_HPMCOUNTER05] = "HPMCOUNTER05",
68  [MISCREG_HPMCOUNTER06] = "HPMCOUNTER06",
69  [MISCREG_HPMCOUNTER07] = "HPMCOUNTER07",
70  [MISCREG_HPMCOUNTER08] = "HPMCOUNTER08",
71  [MISCREG_HPMCOUNTER09] = "HPMCOUNTER09",
72  [MISCREG_HPMCOUNTER10] = "HPMCOUNTER10",
73  [MISCREG_HPMCOUNTER11] = "HPMCOUNTER11",
74  [MISCREG_HPMCOUNTER12] = "HPMCOUNTER12",
75  [MISCREG_HPMCOUNTER13] = "HPMCOUNTER13",
76  [MISCREG_HPMCOUNTER14] = "HPMCOUNTER14",
77  [MISCREG_HPMCOUNTER15] = "HPMCOUNTER15",
78  [MISCREG_HPMCOUNTER16] = "HPMCOUNTER16",
79  [MISCREG_HPMCOUNTER17] = "HPMCOUNTER17",
80  [MISCREG_HPMCOUNTER18] = "HPMCOUNTER18",
81  [MISCREG_HPMCOUNTER19] = "HPMCOUNTER19",
82  [MISCREG_HPMCOUNTER20] = "HPMCOUNTER20",
83  [MISCREG_HPMCOUNTER21] = "HPMCOUNTER21",
84  [MISCREG_HPMCOUNTER22] = "HPMCOUNTER22",
85  [MISCREG_HPMCOUNTER23] = "HPMCOUNTER23",
86  [MISCREG_HPMCOUNTER24] = "HPMCOUNTER24",
87  [MISCREG_HPMCOUNTER25] = "HPMCOUNTER25",
88  [MISCREG_HPMCOUNTER26] = "HPMCOUNTER26",
89  [MISCREG_HPMCOUNTER27] = "HPMCOUNTER27",
90  [MISCREG_HPMCOUNTER28] = "HPMCOUNTER28",
91  [MISCREG_HPMCOUNTER29] = "HPMCOUNTER29",
92  [MISCREG_HPMCOUNTER30] = "HPMCOUNTER30",
93  [MISCREG_HPMCOUNTER31] = "HPMCOUNTER31",
94  [MISCREG_HPMEVENT03] = "HPMEVENT03",
95  [MISCREG_HPMEVENT04] = "HPMEVENT04",
96  [MISCREG_HPMEVENT05] = "HPMEVENT05",
97  [MISCREG_HPMEVENT06] = "HPMEVENT06",
98  [MISCREG_HPMEVENT07] = "HPMEVENT07",
99  [MISCREG_HPMEVENT08] = "HPMEVENT08",
100  [MISCREG_HPMEVENT09] = "HPMEVENT09",
101  [MISCREG_HPMEVENT10] = "HPMEVENT10",
102  [MISCREG_HPMEVENT11] = "HPMEVENT11",
103  [MISCREG_HPMEVENT12] = "HPMEVENT12",
104  [MISCREG_HPMEVENT13] = "HPMEVENT13",
105  [MISCREG_HPMEVENT14] = "HPMEVENT14",
106  [MISCREG_HPMEVENT15] = "HPMEVENT15",
107  [MISCREG_HPMEVENT16] = "HPMEVENT16",
108  [MISCREG_HPMEVENT17] = "HPMEVENT17",
109  [MISCREG_HPMEVENT18] = "HPMEVENT18",
110  [MISCREG_HPMEVENT19] = "HPMEVENT19",
111  [MISCREG_HPMEVENT20] = "HPMEVENT20",
112  [MISCREG_HPMEVENT21] = "HPMEVENT21",
113  [MISCREG_HPMEVENT22] = "HPMEVENT22",
114  [MISCREG_HPMEVENT23] = "HPMEVENT23",
115  [MISCREG_HPMEVENT24] = "HPMEVENT24",
116  [MISCREG_HPMEVENT25] = "HPMEVENT25",
117  [MISCREG_HPMEVENT26] = "HPMEVENT26",
118  [MISCREG_HPMEVENT27] = "HPMEVENT27",
119  [MISCREG_HPMEVENT28] = "HPMEVENT28",
120  [MISCREG_HPMEVENT29] = "HPMEVENT29",
121  [MISCREG_HPMEVENT30] = "HPMEVENT30",
122  [MISCREG_HPMEVENT31] = "HPMEVENT31",
123  [MISCREG_TSELECT] = "TSELECT",
124  [MISCREG_TDATA1] = "TDATA1",
125  [MISCREG_TDATA2] = "TDATA2",
126  [MISCREG_TDATA3] = "TDATA3",
127  [MISCREG_DCSR] = "DCSR",
128  [MISCREG_DPC] = "DPC",
129  [MISCREG_DSCRATCH] = "DSCRATCH",
130 
131  [MISCREG_MEDELEG] = "MEDELEG",
132  [MISCREG_MIDELEG] = "MIDELEG",
133  [MISCREG_MTVEC] = "MTVEC",
134  [MISCREG_MCOUNTEREN] = "MCOUNTEREN",
135  [MISCREG_MSCRATCH] = "MSCRATCH",
136  [MISCREG_MEPC] = "MEPC",
137  [MISCREG_MCAUSE] = "MCAUSE",
138  [MISCREG_MTVAL] = "MTVAL",
139  [MISCREG_PMPCFG0] = "PMPCFG0",
140  // pmpcfg1 rv32 only
141  [MISCREG_PMPCFG2] = "PMPCFG2",
142  // pmpcfg3 rv32 only
143  [MISCREG_PMPADDR00] = "PMPADDR00",
144  [MISCREG_PMPADDR01] = "PMPADDR01",
145  [MISCREG_PMPADDR02] = "PMPADDR02",
146  [MISCREG_PMPADDR03] = "PMPADDR03",
147  [MISCREG_PMPADDR04] = "PMPADDR04",
148  [MISCREG_PMPADDR05] = "PMPADDR05",
149  [MISCREG_PMPADDR06] = "PMPADDR06",
150  [MISCREG_PMPADDR07] = "PMPADDR07",
151  [MISCREG_PMPADDR08] = "PMPADDR08",
152  [MISCREG_PMPADDR09] = "PMPADDR09",
153  [MISCREG_PMPADDR10] = "PMPADDR10",
154  [MISCREG_PMPADDR11] = "PMPADDR11",
155  [MISCREG_PMPADDR12] = "PMPADDR12",
156  [MISCREG_PMPADDR13] = "PMPADDR13",
157  [MISCREG_PMPADDR14] = "PMPADDR14",
158  [MISCREG_PMPADDR15] = "PMPADDR15",
159 
160  [MISCREG_SEDELEG] = "SEDELEG",
161  [MISCREG_SIDELEG] = "SIDELEG",
162  [MISCREG_STVEC] = "STVEC",
163  [MISCREG_SCOUNTEREN] = "SCOUNTEREN",
164  [MISCREG_SSCRATCH] = "SSCRATCH",
165  [MISCREG_SEPC] = "SEPC",
166  [MISCREG_SCAUSE] = "SCAUSE",
167  [MISCREG_STVAL] = "STVAL",
168  [MISCREG_SATP] = "SATP",
169 
170  [MISCREG_UTVEC] = "UTVEC",
171  [MISCREG_USCRATCH] = "USCRATCH",
172  [MISCREG_UEPC] = "UEPC",
173  [MISCREG_UCAUSE] = "UCAUSE",
174  [MISCREG_UTVAL] = "UTVAL",
175  [MISCREG_FFLAGS] = "FFLAGS",
176  [MISCREG_FRM] = "FRM",
177 }};
178 
180 {
181  miscRegFile.resize(NumMiscRegs);
182  clear();
183 }
184 
185 const RiscvISAParams *
186 ISA::params() const
187 {
188  return dynamic_cast<const Params *>(_params);
189 }
190 
192 {
193  std::fill(miscRegFile.begin(), miscRegFile.end(), 0);
194 
196  miscRegFile[MISCREG_ISA] = (2ULL << MXL_OFFSET) | 0x14112D;
201  (1ULL << FS_OFFSET);
204  // don't set it to zero; software may try to determine the supported
205  // triggers, starting at zero. simply set a different value here.
207 }
208 
209 bool
210 ISA::hpmCounterEnabled(int misc_reg) const
211 {
212  int hpmcounter = misc_reg - MISCREG_CYCLE;
213  if (hpmcounter < 0 || hpmcounter > 31)
214  panic("Illegal HPM counter %d\n", hpmcounter);
215  int counteren;
216  switch (readMiscRegNoEffect(MISCREG_PRV)) {
217  case PRV_M:
218  return true;
219  case PRV_S:
220  counteren = MISCREG_MCOUNTEREN;
221  break;
222  case PRV_U:
223  counteren = MISCREG_SCOUNTEREN;
224  break;
225  default:
226  panic("Unknown privilege level %d\n", miscRegFile[MISCREG_PRV]);
227  return false;
228  }
229  return (miscRegFile[counteren] & (1ULL << (hpmcounter))) > 0;
230 }
231 
232 RegVal
233 ISA::readMiscRegNoEffect(int misc_reg) const
234 {
235  if (misc_reg > NumMiscRegs || misc_reg < 0) {
236  // Illegal CSR
237  panic("Illegal CSR index %#x\n", misc_reg);
238  return -1;
239  }
240  DPRINTF(RiscvMisc, "Reading MiscReg %s (%d): %#x.\n",
241  MiscRegNames[misc_reg], misc_reg, miscRegFile[misc_reg]);
242  return miscRegFile[misc_reg];
243 }
244 
245 RegVal
246 ISA::readMiscReg(int misc_reg)
247 {
248  switch (misc_reg) {
249  case MISCREG_HARTID:
250  return tc->contextId();
251  case MISCREG_CYCLE:
253  DPRINTF(RiscvMisc, "Cycle counter at: %llu.\n",
254  tc->getCpuPtr()->curCycle());
255  return tc->getCpuPtr()->curCycle();
256  } else {
257  warn("Cycle counter disabled.\n");
258  return 0;
259  }
260  case MISCREG_TIME:
262  DPRINTF(RiscvMisc, "Wall-clock counter at: %llu.\n",
263  std::time(nullptr));
264  return std::time(nullptr);
265  } else {
266  warn("Wall clock disabled.\n");
267  return 0;
268  }
269  case MISCREG_INSTRET:
271  DPRINTF(RiscvMisc, "Instruction counter at: %llu.\n",
272  tc->getCpuPtr()->totalInsts());
273  return tc->getCpuPtr()->totalInsts();
274  } else {
275  warn("Instruction counter disabled.\n");
276  return 0;
277  }
278  case MISCREG_IP:
279  {
280  auto ic = dynamic_cast<RiscvISA::Interrupts *>(
282  return ic->readIP();
283  }
284  case MISCREG_IE:
285  {
286  auto ic = dynamic_cast<RiscvISA::Interrupts *>(
288  return ic->readIE();
289  }
290  case MISCREG_SEPC:
291  case MISCREG_MEPC:
292  {
293  auto misa = readMiscRegNoEffect(MISCREG_ISA);
294  auto val = readMiscRegNoEffect(misc_reg);
295  // if compressed instructions are disabled, epc[1] is set to 0
296  if ((misa & ISA_EXT_C_MASK) == 0)
297  return mbits(val, 63, 2);
298  // epc[0] is always 0
299  else
300  return mbits(val, 63, 1);
301  }
302  default:
303  // Try reading HPM counters
304  // As a placeholder, all HPM counters are just cycle counters
305  if (misc_reg >= MISCREG_HPMCOUNTER03 &&
306  misc_reg <= MISCREG_HPMCOUNTER31) {
307  if (hpmCounterEnabled(misc_reg)) {
308  DPRINTF(RiscvMisc, "HPM counter %d: %llu.\n",
309  misc_reg - MISCREG_CYCLE, tc->getCpuPtr()->curCycle());
310  return tc->getCpuPtr()->curCycle();
311  } else {
312  warn("HPM counter %d disabled.\n", misc_reg - MISCREG_CYCLE);
313  return 0;
314  }
315  }
316  return readMiscRegNoEffect(misc_reg);
317  }
318 }
319 
320 void
322 {
323  if (misc_reg > NumMiscRegs || misc_reg < 0) {
324  // Illegal CSR
325  panic("Illegal CSR index %#x\n", misc_reg);
326  }
327  DPRINTF(RiscvMisc, "Setting MiscReg %s (%d) to %#x.\n",
328  MiscRegNames[misc_reg], misc_reg, val);
329  miscRegFile[misc_reg] = val;
330 }
331 
332 void
333 ISA::setMiscReg(int misc_reg, RegVal val)
334 {
335  if (misc_reg >= MISCREG_CYCLE && misc_reg <= MISCREG_HPMCOUNTER31) {
336  // Ignore writes to HPM counters for now
337  warn("Ignoring write to %s.\n", CSRData.at(misc_reg).name);
338  } else {
339  switch (misc_reg) {
340  case MISCREG_IP:
341  {
342  auto ic = dynamic_cast<RiscvISA::Interrupts *>(
344  ic->setIP(val);
345  }
346  break;
347  case MISCREG_IE:
348  {
349  auto ic = dynamic_cast<RiscvISA::Interrupts *>(
351  ic->setIE(val);
352  }
353  break;
354  case MISCREG_SATP:
355  {
356  // we only support bare and Sv39 mode; setting a different mode
357  // shall have no effect (see 4.1.12 in priv ISA manual)
358  SATP cur_val = readMiscRegNoEffect(misc_reg);
359  SATP new_val = val;
360  if (new_val.mode != AddrXlateMode::BARE &&
361  new_val.mode != AddrXlateMode::SV39)
362  new_val.mode = cur_val.mode;
363  setMiscRegNoEffect(misc_reg, new_val);
364  }
365  break;
366  case MISCREG_TSELECT:
367  {
368  // we don't support debugging, so always set a different value
369  // than written
370  setMiscRegNoEffect(misc_reg, val + 1);
371  }
372  break;
373  case MISCREG_ISA:
374  {
375  auto cur_val = readMiscRegNoEffect(misc_reg);
376  // only allow to disable compressed instructions
377  // if the following instruction is 4-byte aligned
378  if ((val & ISA_EXT_C_MASK) == 0 &&
379  bits(tc->pcState().npc(), 2, 0) != 0)
380  val |= cur_val & ISA_EXT_C_MASK;
381  setMiscRegNoEffect(misc_reg, val);
382  }
383  break;
384  case MISCREG_STATUS:
385  {
386  // SXL and UXL are hard-wired to 64 bit
387  auto cur = readMiscRegNoEffect(misc_reg);
389  val |= cur & (STATUS_SXL_MASK | STATUS_UXL_MASK);
390  setMiscRegNoEffect(misc_reg, val);
391  }
392  break;
393  default:
394  setMiscRegNoEffect(misc_reg, val);
395  }
396  }
397 }
398 
399 void
401 {
402  DPRINTF(Checkpoint, "Serializing Riscv Misc Registers\n");
404 }
405 
406 void
408 {
409  DPRINTF(Checkpoint, "Unserializing Riscv Misc Registers\n");
411 }
412 
413 }
414 
416 RiscvISAParams::create()
417 {
418  return new RiscvISA::ISA(this);
419 }
RiscvISA::MISCREG_PRV
@ MISCREG_PRV
Definition: registers.hh:129
RiscvISA::MISCREG_HPMCOUNTER30
@ MISCREG_HPMCOUNTER30
Definition: registers.hh:168
RiscvISA::MISCREG_HPMEVENT06
@ MISCREG_HPMEVENT06
Definition: registers.hh:173
RiscvISA::MISCREG_HPMEVENT07
@ MISCREG_HPMEVENT07
Definition: registers.hh:174
RiscvISA::MISCREG_MCOUNTEREN
@ MISCREG_MCOUNTEREN
Definition: registers.hh:210
RiscvISA::MISCREG_HPMCOUNTER07
@ MISCREG_HPMCOUNTER07
Definition: registers.hh:145
RiscvISA::MISCREG_HPMCOUNTER10
@ MISCREG_HPMCOUNTER10
Definition: registers.hh:148
warn
#define warn(...)
Definition: logging.hh:239
RiscvISA::MISCREG_PMPADDR07
@ MISCREG_PMPADDR07
Definition: registers.hh:226
RiscvISA::ISA::readMiscReg
RegVal readMiscReg(int misc_reg)
Definition: isa.cc:246
RiscvISA::MISCREG_HPMCOUNTER28
@ MISCREG_HPMCOUNTER28
Definition: registers.hh:166
RiscvISA::MISCREG_INSTRET
@ MISCREG_INSTRET
Definition: registers.hh:140
RiscvISA::MISCREG_HPMCOUNTER19
@ MISCREG_HPMCOUNTER19
Definition: registers.hh:157
RiscvISA::MISCREG_HPMCOUNTER18
@ MISCREG_HPMCOUNTER18
Definition: registers.hh:156
RiscvISA::MISCREG_UEPC
@ MISCREG_UEPC
Definition: registers.hh:248
RiscvISA::MISCREG_CYCLE
@ MISCREG_CYCLE
Definition: registers.hh:138
RiscvISA::MISCREG_HPMEVENT05
@ MISCREG_HPMEVENT05
Definition: registers.hh:172
RiscvISA::MISCREG_TDATA3
@ MISCREG_TDATA3
Definition: registers.hh:202
RiscvISA::MISCREG_HPMCOUNTER05
@ MISCREG_HPMCOUNTER05
Definition: registers.hh:143
RiscvISA::MISCREG_HPMCOUNTER03
@ MISCREG_HPMCOUNTER03
Definition: registers.hh:141
RiscvISA::MISCREG_HPMEVENT13
@ MISCREG_HPMEVENT13
Definition: registers.hh:180
RiscvISA::MiscRegNames
const std::array< const char *, NumMiscRegs > M5_VAR_USED MiscRegNames
Definition: isa.cc:52
RiscvISA::MISCREG_HPMCOUNTER06
@ MISCREG_HPMCOUNTER06
Definition: registers.hh:144
UNSERIALIZE_CONTAINER
#define UNSERIALIZE_CONTAINER(member)
Definition: serialize.hh:856
RiscvISA::MISCREG_HPMEVENT24
@ MISCREG_HPMEVENT24
Definition: registers.hh:191
RiscvISA::MISCREG_MCAUSE
@ MISCREG_MCAUSE
Definition: registers.hh:213
RiscvISA::MISCREG_HPMEVENT15
@ MISCREG_HPMEVENT15
Definition: registers.hh:182
RiscvISA::MISCREG_DPC
@ MISCREG_DPC
Definition: registers.hh:204
RiscvISA::MISCREG_MTVEC
@ MISCREG_MTVEC
Definition: registers.hh:209
RiscvISA::MISCREG_HPMCOUNTER11
@ MISCREG_HPMCOUNTER11
Definition: registers.hh:149
RiscvISA::MISCREG_PMPADDR03
@ MISCREG_PMPADDR03
Definition: registers.hh:222
RiscvISA::MISCREG_HPMEVENT23
@ MISCREG_HPMEVENT23
Definition: registers.hh:190
RiscvISA::MISCREG_HPMEVENT29
@ MISCREG_HPMEVENT29
Definition: registers.hh:196
RiscvISA::MISCREG_HPMEVENT10
@ MISCREG_HPMEVENT10
Definition: registers.hh:177
RiscvISA::MISCREG_MEPC
@ MISCREG_MEPC
Definition: registers.hh:212
RiscvISA::MISCREG_PMPADDR01
@ MISCREG_PMPADDR01
Definition: registers.hh:220
RiscvISA::MISCREG_SEDELEG
@ MISCREG_SEDELEG
Definition: registers.hh:236
RiscvISA::MISCREG_HPMEVENT11
@ MISCREG_HPMEVENT11
Definition: registers.hh:178
RiscvISA::MISCREG_STVAL
@ MISCREG_STVAL
Definition: registers.hh:243
RiscvISA::PRV_S
@ PRV_S
Definition: isa.hh:59
RiscvISA::MISCREG_PMPADDR10
@ MISCREG_PMPADDR10
Definition: registers.hh:229
RiscvISA::MISCREG_PMPADDR12
@ MISCREG_PMPADDR12
Definition: registers.hh:231
RiscvISA::MISCREG_HPMEVENT30
@ MISCREG_HPMEVENT30
Definition: registers.hh:197
RiscvISA::ISA::Params
RiscvISAParams Params
Definition: isa.hh:79
RiscvISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
RiscvISA::MISCREG_USCRATCH
@ MISCREG_USCRATCH
Definition: registers.hh:247
interrupts.hh
RiscvISA::ISA::clear
void clear()
Definition: isa.cc:191
RiscvISA::MISCREG_UTVAL
@ MISCREG_UTVAL
Definition: registers.hh:250
RiscvISA::ISA::hpmCounterEnabled
bool hpmCounterEnabled(int counter) const
Definition: isa.cc:210
RiscvISA::MISCREG_HPMEVENT03
@ MISCREG_HPMEVENT03
Definition: registers.hh:170
RiscvISA::MISCREG_PMPADDR00
@ MISCREG_PMPADDR00
Definition: registers.hh:219
RiscvISA::MISCREG_SIDELEG
@ MISCREG_SIDELEG
Definition: registers.hh:237
RiscvISA::ISA::unserialize
void unserialize(CheckpointIn &cp)
Unserialize an object.
Definition: isa.cc:407
mbits
T mbits(T val, int first, int last)
Mask off the given bits in place like bits() but without shifting.
Definition: bitfield.hh:104
RiscvISA::MISCREG_HPMEVENT25
@ MISCREG_HPMEVENT25
Definition: registers.hh:192
RiscvISA::MISCREG_HPMEVENT08
@ MISCREG_HPMEVENT08
Definition: registers.hh:175
RiscvISA::MISCREG_HPMEVENT22
@ MISCREG_HPMEVENT22
Definition: registers.hh:189
RiscvISA::MISCREG_STATUS
@ MISCREG_STATUS
Definition: registers.hh:135
RiscvISA::MISCREG_HPMEVENT09
@ MISCREG_HPMEVENT09
Definition: registers.hh:176
RiscvISA::MISCREG_HPMCOUNTER16
@ MISCREG_HPMCOUNTER16
Definition: registers.hh:154
RiscvISA::MISCREG_HPMEVENT14
@ MISCREG_HPMEVENT14
Definition: registers.hh:181
isa.hh
RiscvISA::MISCREG_HPMCOUNTER08
@ MISCREG_HPMCOUNTER08
Definition: registers.hh:146
RiscvISA::MISCREG_TDATA1
@ MISCREG_TDATA1
Definition: registers.hh:200
RiscvISA::ISA::ISA
ISA(Params *p)
Definition: isa.cc:179
RiscvISA::MISCREG_PMPADDR15
@ MISCREG_PMPADDR15
Definition: registers.hh:234
ThreadContext::threadId
virtual int threadId() const =0
RiscvISA::ISA::params
const Params * params() const
Definition: isa.cc:186
RiscvISA::ISA::serialize
void serialize(CheckpointOut &cp) const
Serialize an object.
Definition: isa.cc:400
RiscvISA::MISCREG_PMPADDR13
@ MISCREG_PMPADDR13
Definition: registers.hh:232
RiscvISA
Definition: fs_workload.cc:36
iGbReg::TxdOp::ic
bool ic(TxDesc *d)
Definition: i8254xGBe_defs.hh:250
RiscvISA::UXL_OFFSET
const off_t UXL_OFFSET
Definition: registers.hh:643
RiscvISA::MISCREG_HPMCOUNTER04
@ MISCREG_HPMCOUNTER04
Definition: registers.hh:142
RiscvISA::MISCREG_PMPADDR09
@ MISCREG_PMPADDR09
Definition: registers.hh:228
RiscvISA::MISCREG_HPMEVENT20
@ MISCREG_HPMEVENT20
Definition: registers.hh:187
RiscvISA::MISCREG_HPMCOUNTER14
@ MISCREG_HPMCOUNTER14
Definition: registers.hh:152
pseudo_inst.hh
RiscvISA::MISCREG_SCAUSE
@ MISCREG_SCAUSE
Definition: registers.hh:242
cp
Definition: cprintf.cc:40
RiscvISA::MISCREG_FFLAGS
@ MISCREG_FFLAGS
Definition: registers.hh:251
RiscvISA::NumMiscRegs
const int NumMiscRegs
Definition: registers.hh:256
RiscvISA::MISCREG_HPMCOUNTER31
@ MISCREG_HPMCOUNTER31
Definition: registers.hh:169
RiscvISA::MISCREG_IP
@ MISCREG_IP
Definition: registers.hh:136
bitfield.hh
RiscvISA::MISCREG_ARCHID
@ MISCREG_ARCHID
Definition: registers.hh:132
RiscvISA::MISCREG_HPMCOUNTER27
@ MISCREG_HPMCOUNTER27
Definition: registers.hh:165
RiscvISA::MISCREG_PMPADDR06
@ MISCREG_PMPADDR06
Definition: registers.hh:225
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:234
RiscvISA::MISCREG_SCOUNTEREN
@ MISCREG_SCOUNTEREN
Definition: registers.hh:239
RiscvISA::MISCREG_HPMCOUNTER09
@ MISCREG_HPMCOUNTER09
Definition: registers.hh:147
RiscvISA::MISCREG_HPMCOUNTER13
@ MISCREG_HPMCOUNTER13
Definition: registers.hh:151
RiscvISA::MISCREG_HPMEVENT27
@ MISCREG_HPMEVENT27
Definition: registers.hh:194
RiscvISA::MISCREG_DSCRATCH
@ MISCREG_DSCRATCH
Definition: registers.hh:205
RiscvISA::MISCREG_HPMCOUNTER20
@ MISCREG_HPMCOUNTER20
Definition: registers.hh:158
RiscvISA::MISCREG_HPMCOUNTER24
@ MISCREG_HPMCOUNTER24
Definition: registers.hh:162
BaseISA::tc
ThreadContext * tc
Definition: isa.hh:52
RiscvISA::MISCREG_UTVEC
@ MISCREG_UTVEC
Definition: registers.hh:246
RiscvISA::MISCREG_MSCRATCH
@ MISCREG_MSCRATCH
Definition: registers.hh:211
RiscvISA::MISCREG_PMPCFG2
@ MISCREG_PMPCFG2
Definition: registers.hh:217
RiscvISA::STATUS_SXL_MASK
const RegVal STATUS_SXL_MASK
Definition: registers.hh:653
RiscvISA::MISCREG_HPMEVENT04
@ MISCREG_HPMEVENT04
Definition: registers.hh:171
RiscvISA::MISCREG_HPMEVENT26
@ MISCREG_HPMEVENT26
Definition: registers.hh:193
RiscvISA::MISCREG_UCAUSE
@ MISCREG_UCAUSE
Definition: registers.hh:249
RiscvISA::MISCREG_DCSR
@ MISCREG_DCSR
Definition: registers.hh:203
RiscvISA::ISA_EXT_C_MASK
const RegVal ISA_EXT_C_MASK
Definition: registers.hh:649
ThreadContext::contextId
virtual ContextID contextId() const =0
RiscvISA::ISA::setMiscReg
void setMiscReg(int misc_reg, RegVal val)
Definition: isa.cc:333
compiler.hh
RiscvISA::PRV_U
@ PRV_U
Definition: isa.hh:58
RiscvISA::ISA::setMiscRegNoEffect
void setMiscRegNoEffect(int misc_reg, RegVal val)
Definition: isa.cc:321
RiscvISA::MISCREG_TIME
@ MISCREG_TIME
Definition: registers.hh:139
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
RiscvISA::MISCREG_PMPADDR08
@ MISCREG_PMPADDR08
Definition: registers.hh:227
core.hh
RiscvISA::MISCREG_FRM
@ MISCREG_FRM
Definition: registers.hh:252
RiscvISA::MISCREG_HPMEVENT19
@ MISCREG_HPMEVENT19
Definition: registers.hh:186
RiscvISA::MISCREG_HPMEVENT16
@ MISCREG_HPMEVENT16
Definition: registers.hh:183
RiscvISA::ISA::readMiscRegNoEffect
RegVal readMiscRegNoEffect(int misc_reg) const
Definition: isa.cc:233
RiscvISA::MISCREG_HPMEVENT21
@ MISCREG_HPMEVENT21
Definition: registers.hh:188
RiscvISA::MISCREG_HARTID
@ MISCREG_HARTID
Definition: registers.hh:134
registers.hh
RiscvISA::MISCREG_IMPID
@ MISCREG_IMPID
Definition: registers.hh:133
ThreadContext::pcState
virtual TheISA::PCState pcState() const =0
RiscvISA::MISCREG_TDATA2
@ MISCREG_TDATA2
Definition: registers.hh:201
MipsISA::fill
fill
Definition: pra_constants.hh:54
RiscvISA::MISCREG_IE
@ MISCREG_IE
Definition: registers.hh:137
RiscvISA::ISA::miscRegFile
std::vector< RegVal > miscRegFile
Definition: isa.hh:74
RiscvISA::MISCREG_HPMEVENT31
@ MISCREG_HPMEVENT31
Definition: registers.hh:198
RiscvISA::MISCREG_HPMEVENT18
@ MISCREG_HPMEVENT18
Definition: registers.hh:185
base.hh
RiscvISA::MISCREG_HPMCOUNTER12
@ MISCREG_HPMCOUNTER12
Definition: registers.hh:150
RiscvISA::ISA
Definition: isa.hh:71
RiscvISA::MISCREG_PMPADDR04
@ MISCREG_PMPADDR04
Definition: registers.hh:223
SimObject::_params
const SimObjectParams * _params
Cached copy of the object parameters.
Definition: sim_object.hh:110
RiscvISA::MISCREG_SSCRATCH
@ MISCREG_SSCRATCH
Definition: registers.hh:240
SERIALIZE_CONTAINER
#define SERIALIZE_CONTAINER(member)
Definition: serialize.hh:848
RiscvISA::MISCREG_HPMCOUNTER29
@ MISCREG_HPMCOUNTER29
Definition: registers.hh:167
RiscvISA::MISCREG_PMPADDR02
@ MISCREG_PMPADDR02
Definition: registers.hh:221
RiscvISA::MISCREG_HPMCOUNTER26
@ MISCREG_HPMCOUNTER26
Definition: registers.hh:164
RiscvISA::MISCREG_PMPCFG0
@ MISCREG_PMPCFG0
Definition: registers.hh:215
RiscvISA::SXL_OFFSET
const off_t SXL_OFFSET
Definition: registers.hh:642
RiscvISA::MISCREG_PMPADDR11
@ MISCREG_PMPADDR11
Definition: registers.hh:230
RiscvISA::MISCREG_TSELECT
@ MISCREG_TSELECT
Definition: registers.hh:199
RiscvISA::MISCREG_MEDELEG
@ MISCREG_MEDELEG
Definition: registers.hh:207
RiscvISA::MISCREG_HPMEVENT17
@ MISCREG_HPMEVENT17
Definition: registers.hh:184
RiscvISA::MISCREG_HPMCOUNTER17
@ MISCREG_HPMCOUNTER17
Definition: registers.hh:155
RiscvISA::MISCREG_PMPADDR05
@ MISCREG_PMPADDR05
Definition: registers.hh:224
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
RiscvISA::MISCREG_SATP
@ MISCREG_SATP
Definition: registers.hh:244
RiscvISA::MISCREG_HPMEVENT28
@ MISCREG_HPMEVENT28
Definition: registers.hh:195
BaseCPU::totalInsts
virtual Counter totalInsts() const =0
RiscvISA::Interrupts
Definition: interrupts.hh:53
RiscvISA::MISCREG_MTVAL
@ MISCREG_MTVAL
Definition: registers.hh:214
RiscvISA::CSRData
const std::map< int, CSRMetadata > CSRData
Definition: registers.hh:430
CheckpointIn
Definition: serialize.hh:67
RiscvISA::PRV_M
@ PRV_M
Definition: isa.hh:60
RiscvISA::MISCREG_STVEC
@ MISCREG_STVEC
Definition: registers.hh:238
ThreadContext::getCpuPtr
virtual BaseCPU * getCpuPtr()=0
RiscvISA::MISCREG_HPMCOUNTER22
@ MISCREG_HPMCOUNTER22
Definition: registers.hh:160
BaseISA
Definition: isa.hh:47
BaseCPU::getInterruptController
BaseInterrupts * getInterruptController(ThreadID tid)
Definition: base.hh:219
RiscvISA::FS_OFFSET
const off_t FS_OFFSET
Definition: registers.hh:644
RiscvISA::MISCREG_HPMCOUNTER25
@ MISCREG_HPMCOUNTER25
Definition: registers.hh:163
pagetable.hh
RiscvISA::MISCREG_HPMEVENT12
@ MISCREG_HPMEVENT12
Definition: registers.hh:179
RiscvISA::MISCREG_PMPADDR14
@ MISCREG_PMPADDR14
Definition: registers.hh:233
RiscvISA::MISCREG_ISA
@ MISCREG_ISA
Definition: registers.hh:130
RiscvISA::MISCREG_SEPC
@ MISCREG_SEPC
Definition: registers.hh:241
ULL
#define ULL(N)
uint64_t constant
Definition: types.hh:50
RegVal
uint64_t RegVal
Definition: types.hh:168
RiscvISA::STATUS_UXL_MASK
const RegVal STATUS_UXL_MASK
Definition: registers.hh:654
RiscvISA::MISCREG_HPMCOUNTER15
@ MISCREG_HPMCOUNTER15
Definition: registers.hh:153
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
RiscvISA::MISCREG_VENDORID
@ MISCREG_VENDORID
Definition: registers.hh:131
RiscvISA::MISCREG_HPMCOUNTER23
@ MISCREG_HPMCOUNTER23
Definition: registers.hh:161
bits
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:75
RiscvISA::MISCREG_MIDELEG
@ MISCREG_MIDELEG
Definition: registers.hh:208
RiscvISA::MISCREG_HPMCOUNTER21
@ MISCREG_HPMCOUNTER21
Definition: registers.hh:159

Generated on Wed Sep 30 2020 14:01:59 for gem5 by doxygen 1.8.17