gem5  v21.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 M5_VAR_USED const std::array<const char *, NumMiscRegs> 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 
186 {
187  std::fill(miscRegFile.begin(), miscRegFile.end(), 0);
188 
190  miscRegFile[MISCREG_ISA] = (2ULL << MXL_OFFSET) | 0x14112D;
195  (1ULL << FS_OFFSET);
198  // don't set it to zero; software may try to determine the supported
199  // triggers, starting at zero. simply set a different value here.
201 }
202 
203 bool
204 ISA::hpmCounterEnabled(int misc_reg) const
205 {
206  int hpmcounter = misc_reg - MISCREG_CYCLE;
207  if (hpmcounter < 0 || hpmcounter > 31)
208  panic("Illegal HPM counter %d\n", hpmcounter);
209  int counteren;
210  switch (readMiscRegNoEffect(MISCREG_PRV)) {
211  case PRV_M:
212  return true;
213  case PRV_S:
214  counteren = MISCREG_MCOUNTEREN;
215  break;
216  case PRV_U:
217  counteren = MISCREG_SCOUNTEREN;
218  break;
219  default:
220  panic("Unknown privilege level %d\n", miscRegFile[MISCREG_PRV]);
221  return false;
222  }
223  return (miscRegFile[counteren] & (1ULL << (hpmcounter))) > 0;
224 }
225 
226 RegVal
227 ISA::readMiscRegNoEffect(int misc_reg) const
228 {
229  if (misc_reg > NumMiscRegs || misc_reg < 0) {
230  // Illegal CSR
231  panic("Illegal CSR index %#x\n", misc_reg);
232  return -1;
233  }
234  DPRINTF(RiscvMisc, "Reading MiscReg %s (%d): %#x.\n",
235  MiscRegNames[misc_reg], misc_reg, miscRegFile[misc_reg]);
236  return miscRegFile[misc_reg];
237 }
238 
239 RegVal
240 ISA::readMiscReg(int misc_reg)
241 {
242  switch (misc_reg) {
243  case MISCREG_HARTID:
244  return tc->contextId();
245  case MISCREG_CYCLE:
247  DPRINTF(RiscvMisc, "Cycle counter at: %llu.\n",
248  tc->getCpuPtr()->curCycle());
249  return tc->getCpuPtr()->curCycle();
250  } else {
251  warn("Cycle counter disabled.\n");
252  return 0;
253  }
254  case MISCREG_TIME:
256  DPRINTF(RiscvMisc, "Wall-clock counter at: %llu.\n",
257  std::time(nullptr));
259  } else {
260  warn("Wall clock disabled.\n");
261  return 0;
262  }
263  case MISCREG_INSTRET:
265  DPRINTF(RiscvMisc, "Instruction counter at: %llu.\n",
266  tc->getCpuPtr()->totalInsts());
267  return tc->getCpuPtr()->totalInsts();
268  } else {
269  warn("Instruction counter disabled.\n");
270  return 0;
271  }
272  case MISCREG_IP:
273  {
274  auto ic = dynamic_cast<RiscvISA::Interrupts *>(
276  return ic->readIP();
277  }
278  case MISCREG_IE:
279  {
280  auto ic = dynamic_cast<RiscvISA::Interrupts *>(
282  return ic->readIE();
283  }
284  case MISCREG_SEPC:
285  case MISCREG_MEPC:
286  {
287  auto misa = readMiscRegNoEffect(MISCREG_ISA);
288  auto val = readMiscRegNoEffect(misc_reg);
289  // if compressed instructions are disabled, epc[1] is set to 0
290  if ((misa & ISA_EXT_C_MASK) == 0)
291  return mbits(val, 63, 2);
292  // epc[0] is always 0
293  else
294  return mbits(val, 63, 1);
295  }
296  default:
297  // Try reading HPM counters
298  // As a placeholder, all HPM counters are just cycle counters
299  if (misc_reg >= MISCREG_HPMCOUNTER03 &&
300  misc_reg <= MISCREG_HPMCOUNTER31) {
301  if (hpmCounterEnabled(misc_reg)) {
302  DPRINTF(RiscvMisc, "HPM counter %d: %llu.\n",
303  misc_reg - MISCREG_CYCLE, tc->getCpuPtr()->curCycle());
304  return tc->getCpuPtr()->curCycle();
305  } else {
306  warn("HPM counter %d disabled.\n", misc_reg - MISCREG_CYCLE);
307  return 0;
308  }
309  }
310  return readMiscRegNoEffect(misc_reg);
311  }
312 }
313 
314 void
316 {
317  if (misc_reg > NumMiscRegs || misc_reg < 0) {
318  // Illegal CSR
319  panic("Illegal CSR index %#x\n", misc_reg);
320  }
321  DPRINTF(RiscvMisc, "Setting MiscReg %s (%d) to %#x.\n",
322  MiscRegNames[misc_reg], misc_reg, val);
323  miscRegFile[misc_reg] = val;
324 }
325 
326 void
327 ISA::setMiscReg(int misc_reg, RegVal val)
328 {
329  if (misc_reg >= MISCREG_CYCLE && misc_reg <= MISCREG_HPMCOUNTER31) {
330  // Ignore writes to HPM counters for now
331  warn("Ignoring write to %s.\n", CSRData.at(misc_reg).name);
332  } else {
333  switch (misc_reg) {
334  case MISCREG_IP:
335  {
336  auto ic = dynamic_cast<RiscvISA::Interrupts *>(
338  ic->setIP(val);
339  }
340  break;
341  case MISCREG_IE:
342  {
343  auto ic = dynamic_cast<RiscvISA::Interrupts *>(
345  ic->setIE(val);
346  }
347  break;
348  case MISCREG_SATP:
349  {
350  // we only support bare and Sv39 mode; setting a different mode
351  // shall have no effect (see 4.1.12 in priv ISA manual)
352  SATP cur_val = readMiscRegNoEffect(misc_reg);
353  SATP new_val = val;
354  if (new_val.mode != AddrXlateMode::BARE &&
355  new_val.mode != AddrXlateMode::SV39)
356  new_val.mode = cur_val.mode;
357  setMiscRegNoEffect(misc_reg, new_val);
358  }
359  break;
360  case MISCREG_TSELECT:
361  {
362  // we don't support debugging, so always set a different value
363  // than written
364  setMiscRegNoEffect(misc_reg, val + 1);
365  }
366  break;
367  case MISCREG_ISA:
368  {
369  auto cur_val = readMiscRegNoEffect(misc_reg);
370  // only allow to disable compressed instructions
371  // if the following instruction is 4-byte aligned
372  if ((val & ISA_EXT_C_MASK) == 0 &&
373  bits(tc->pcState().npc(), 2, 0) != 0)
374  val |= cur_val & ISA_EXT_C_MASK;
375  setMiscRegNoEffect(misc_reg, val);
376  }
377  break;
378  case MISCREG_STATUS:
379  {
380  // SXL and UXL are hard-wired to 64 bit
381  auto cur = readMiscRegNoEffect(misc_reg);
383  val |= cur & (STATUS_SXL_MASK | STATUS_UXL_MASK);
384  setMiscRegNoEffect(misc_reg, val);
385  }
386  break;
387  default:
388  setMiscRegNoEffect(misc_reg, val);
389  }
390  }
391 }
392 
393 void
395 {
396  DPRINTF(Checkpoint, "Serializing Riscv Misc Registers\n");
398 }
399 
400 void
402 {
403  DPRINTF(Checkpoint, "Unserializing Riscv Misc Registers\n");
405 }
406 
407 }
RiscvISA::MISCREG_PRV
@ MISCREG_PRV
Definition: registers.hh:154
RiscvISA::MISCREG_HPMCOUNTER30
@ MISCREG_HPMCOUNTER30
Definition: registers.hh:193
RiscvISA::MISCREG_HPMEVENT06
@ MISCREG_HPMEVENT06
Definition: registers.hh:198
RiscvISA::MISCREG_HPMEVENT07
@ MISCREG_HPMEVENT07
Definition: registers.hh:199
RiscvISA::MISCREG_MCOUNTEREN
@ MISCREG_MCOUNTEREN
Definition: registers.hh:235
RiscvISA::MISCREG_HPMCOUNTER07
@ MISCREG_HPMCOUNTER07
Definition: registers.hh:170
RiscvISA::MISCREG_HPMCOUNTER10
@ MISCREG_HPMCOUNTER10
Definition: registers.hh:173
warn
#define warn(...)
Definition: logging.hh:239
RiscvISA::MISCREG_PMPADDR07
@ MISCREG_PMPADDR07
Definition: registers.hh:251
RiscvISA::ISA::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: isa.cc:394
RiscvISA::ISA::readMiscReg
RegVal readMiscReg(int misc_reg)
Definition: isa.cc:240
RiscvISA::MISCREG_HPMCOUNTER28
@ MISCREG_HPMCOUNTER28
Definition: registers.hh:191
RiscvISA::MISCREG_INSTRET
@ MISCREG_INSTRET
Definition: registers.hh:165
RiscvISA::MISCREG_HPMCOUNTER19
@ MISCREG_HPMCOUNTER19
Definition: registers.hh:182
RiscvISA::MISCREG_HPMCOUNTER18
@ MISCREG_HPMCOUNTER18
Definition: registers.hh:181
RiscvISA::MISCREG_UEPC
@ MISCREG_UEPC
Definition: registers.hh:273
RiscvISA::MISCREG_CYCLE
@ MISCREG_CYCLE
Definition: registers.hh:163
RiscvISA::MISCREG_HPMEVENT05
@ MISCREG_HPMEVENT05
Definition: registers.hh:197
RiscvISA::MISCREG_TDATA3
@ MISCREG_TDATA3
Definition: registers.hh:227
RiscvISA::MISCREG_HPMCOUNTER05
@ MISCREG_HPMCOUNTER05
Definition: registers.hh:168
RiscvISA::MISCREG_HPMCOUNTER03
@ MISCREG_HPMCOUNTER03
Definition: registers.hh:166
RiscvISA::MISCREG_HPMEVENT13
@ MISCREG_HPMEVENT13
Definition: registers.hh:205
RiscvISA::MISCREG_HPMCOUNTER06
@ MISCREG_HPMCOUNTER06
Definition: registers.hh:169
UNSERIALIZE_CONTAINER
#define UNSERIALIZE_CONTAINER(member)
Definition: serialize.hh:650
RiscvISA::MISCREG_HPMEVENT24
@ MISCREG_HPMEVENT24
Definition: registers.hh:216
pseudo_inst.hh
RiscvISA::MISCREG_MCAUSE
@ MISCREG_MCAUSE
Definition: registers.hh:238
RiscvISA::MISCREG_HPMEVENT15
@ MISCREG_HPMEVENT15
Definition: registers.hh:207
RiscvISA::MISCREG_DPC
@ MISCREG_DPC
Definition: registers.hh:229
RiscvISA::MISCREG_MTVEC
@ MISCREG_MTVEC
Definition: registers.hh:234
RiscvISA::MISCREG_HPMCOUNTER11
@ MISCREG_HPMCOUNTER11
Definition: registers.hh:174
RiscvISA::MISCREG_PMPADDR03
@ MISCREG_PMPADDR03
Definition: registers.hh:247
RiscvISA::MISCREG_HPMEVENT23
@ MISCREG_HPMEVENT23
Definition: registers.hh:215
RiscvISA::MISCREG_HPMEVENT29
@ MISCREG_HPMEVENT29
Definition: registers.hh:221
RiscvISA::MISCREG_HPMEVENT10
@ MISCREG_HPMEVENT10
Definition: registers.hh:202
RiscvISA::MISCREG_MEPC
@ MISCREG_MEPC
Definition: registers.hh:237
RiscvISA::MISCREG_PMPADDR01
@ MISCREG_PMPADDR01
Definition: registers.hh:245
RiscvISA::MISCREG_SEDELEG
@ MISCREG_SEDELEG
Definition: registers.hh:261
RiscvISA::MISCREG_HPMEVENT11
@ MISCREG_HPMEVENT11
Definition: registers.hh:203
RiscvISA::MISCREG_STVAL
@ MISCREG_STVAL
Definition: registers.hh:268
RiscvISA::PRV_S
@ PRV_S
Definition: isa.hh:59
RiscvISA::MISCREG_PMPADDR10
@ MISCREG_PMPADDR10
Definition: registers.hh:254
RiscvISA::MISCREG_PMPADDR12
@ MISCREG_PMPADDR12
Definition: registers.hh:256
RiscvISA::MISCREG_HPMEVENT30
@ MISCREG_HPMEVENT30
Definition: registers.hh:222
RiscvISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
RiscvISA::MISCREG_USCRATCH
@ MISCREG_USCRATCH
Definition: registers.hh:272
interrupts.hh
RiscvISA::ISA::clear
void clear()
Definition: isa.cc:185
RiscvISA::MISCREG_UTVAL
@ MISCREG_UTVAL
Definition: registers.hh:275
RiscvISA::ISA::hpmCounterEnabled
bool hpmCounterEnabled(int counter) const
Definition: isa.cc:204
RiscvISA::MISCREG_HPMEVENT03
@ MISCREG_HPMEVENT03
Definition: registers.hh:195
RiscvISA::MISCREG_PMPADDR00
@ MISCREG_PMPADDR00
Definition: registers.hh:244
RiscvISA::MISCREG_SIDELEG
@ MISCREG_SIDELEG
Definition: registers.hh:262
RiscvISA::MISCREG_HPMEVENT25
@ MISCREG_HPMEVENT25
Definition: registers.hh:217
RiscvISA::MISCREG_HPMEVENT08
@ MISCREG_HPMEVENT08
Definition: registers.hh:200
RiscvISA::MISCREG_HPMEVENT22
@ MISCREG_HPMEVENT22
Definition: registers.hh:214
RiscvISA::MISCREG_STATUS
@ MISCREG_STATUS
Definition: registers.hh:160
RiscvISA::MISCREG_HPMEVENT09
@ MISCREG_HPMEVENT09
Definition: registers.hh:201
RiscvISA::MISCREG_HPMCOUNTER16
@ MISCREG_HPMCOUNTER16
Definition: registers.hh:179
RiscvISA::MISCREG_HPMEVENT14
@ MISCREG_HPMEVENT14
Definition: registers.hh:206
isa.hh
RiscvISA::MISCREG_HPMCOUNTER08
@ MISCREG_HPMCOUNTER08
Definition: registers.hh:171
RiscvISA::MISCREG_TDATA1
@ MISCREG_TDATA1
Definition: registers.hh:225
RiscvISA::MISCREG_PMPADDR15
@ MISCREG_PMPADDR15
Definition: registers.hh:259
ThreadContext::threadId
virtual int threadId() const =0
RiscvISA::MISCREG_PMPADDR13
@ MISCREG_PMPADDR13
Definition: registers.hh:257
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:668
RiscvISA::MISCREG_HPMCOUNTER04
@ MISCREG_HPMCOUNTER04
Definition: registers.hh:167
RiscvISA::MISCREG_PMPADDR09
@ MISCREG_PMPADDR09
Definition: registers.hh:253
RiscvISA::MISCREG_HPMEVENT20
@ MISCREG_HPMEVENT20
Definition: registers.hh:212
RiscvISA::MISCREG_HPMCOUNTER14
@ MISCREG_HPMCOUNTER14
Definition: registers.hh:177
RiscvISA::MISCREG_SCAUSE
@ MISCREG_SCAUSE
Definition: registers.hh:267
cp
Definition: cprintf.cc:37
RiscvISA::MISCREG_FFLAGS
@ MISCREG_FFLAGS
Definition: registers.hh:276
RiscvISA::NumMiscRegs
const int NumMiscRegs
Definition: registers.hh:281
RiscvISA::MISCREG_HPMCOUNTER31
@ MISCREG_HPMCOUNTER31
Definition: registers.hh:194
RiscvISA::MISCREG_IP
@ MISCREG_IP
Definition: registers.hh:161
bitfield.hh
RiscvISA::MISCREG_ARCHID
@ MISCREG_ARCHID
Definition: registers.hh:157
RiscvISA::MISCREG_HPMCOUNTER27
@ MISCREG_HPMCOUNTER27
Definition: registers.hh:190
RiscvISA::MISCREG_PMPADDR06
@ MISCREG_PMPADDR06
Definition: registers.hh:250
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:237
RiscvISA::MISCREG_SCOUNTEREN
@ MISCREG_SCOUNTEREN
Definition: registers.hh:264
RiscvISA::MISCREG_HPMCOUNTER09
@ MISCREG_HPMCOUNTER09
Definition: registers.hh:172
RiscvISA::MISCREG_HPMCOUNTER13
@ MISCREG_HPMCOUNTER13
Definition: registers.hh:176
RiscvISA::MISCREG_HPMEVENT27
@ MISCREG_HPMEVENT27
Definition: registers.hh:219
RiscvISA::MISCREG_DSCRATCH
@ MISCREG_DSCRATCH
Definition: registers.hh:230
RiscvISA::MISCREG_HPMCOUNTER20
@ MISCREG_HPMCOUNTER20
Definition: registers.hh:183
RiscvISA::MISCREG_HPMCOUNTER24
@ MISCREG_HPMCOUNTER24
Definition: registers.hh:187
BaseISA::tc
ThreadContext * tc
Definition: isa.hh:52
RiscvISA::ISA::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: isa.cc:401
RiscvISA::MISCREG_UTVEC
@ MISCREG_UTVEC
Definition: registers.hh:271
RiscvISA::MISCREG_MSCRATCH
@ MISCREG_MSCRATCH
Definition: registers.hh:236
RiscvISA::MISCREG_PMPCFG2
@ MISCREG_PMPCFG2
Definition: registers.hh:242
RiscvISA::STATUS_SXL_MASK
const RegVal STATUS_SXL_MASK
Definition: registers.hh:678
RiscvISA::MISCREG_HPMEVENT04
@ MISCREG_HPMEVENT04
Definition: registers.hh:196
Clocked::curCycle
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
Definition: clocked_object.hh:192
RiscvISA::MISCREG_HPMEVENT26
@ MISCREG_HPMEVENT26
Definition: registers.hh:218
RiscvISA::MISCREG_UCAUSE
@ MISCREG_UCAUSE
Definition: registers.hh:274
RiscvISA::MISCREG_DCSR
@ MISCREG_DCSR
Definition: registers.hh:228
RiscvISA::ISA_EXT_C_MASK
const RegVal ISA_EXT_C_MASK
Definition: registers.hh:674
ThreadContext::contextId
virtual ContextID contextId() const =0
RiscvISA::ISA::setMiscReg
void setMiscReg(int misc_reg, RegVal val)
Definition: isa.cc:327
compiler.hh
mbits
constexpr T mbits(T val, unsigned first, unsigned last)
Mask off the given bits in place like bits() but without shifting.
Definition: bitfield.hh:100
RiscvISA::PRV_U
@ PRV_U
Definition: isa.hh:58
RiscvISA::ISA::setMiscRegNoEffect
void setMiscRegNoEffect(int misc_reg, RegVal val)
Definition: isa.cc:315
RiscvISA::ISA::Params
RiscvISAParams Params
Definition: isa.hh:79
RiscvISA::MISCREG_TIME
@ MISCREG_TIME
Definition: registers.hh:164
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
RiscvISA::MISCREG_PMPADDR08
@ MISCREG_PMPADDR08
Definition: registers.hh:252
core.hh
RiscvISA::MISCREG_FRM
@ MISCREG_FRM
Definition: registers.hh:277
RiscvISA::MISCREG_HPMEVENT19
@ MISCREG_HPMEVENT19
Definition: registers.hh:211
RiscvISA::MISCREG_HPMEVENT16
@ MISCREG_HPMEVENT16
Definition: registers.hh:208
RiscvISA::ISA::readMiscRegNoEffect
RegVal readMiscRegNoEffect(int misc_reg) const
Definition: isa.cc:227
RiscvISA::MISCREG_HPMEVENT21
@ MISCREG_HPMEVENT21
Definition: registers.hh:213
RiscvISA::MISCREG_HARTID
@ MISCREG_HARTID
Definition: registers.hh:159
registers.hh
RiscvISA::MISCREG_IMPID
@ MISCREG_IMPID
Definition: registers.hh:158
ThreadContext::pcState
virtual TheISA::PCState pcState() const =0
RiscvISA::MISCREG_TDATA2
@ MISCREG_TDATA2
Definition: registers.hh:226
MipsISA::fill
fill
Definition: pra_constants.hh:54
RiscvISA::MISCREG_IE
@ MISCREG_IE
Definition: registers.hh:162
RiscvISA::ISA::miscRegFile
std::vector< RegVal > miscRegFile
Definition: isa.hh:74
RiscvISA::MISCREG_HPMEVENT31
@ MISCREG_HPMEVENT31
Definition: registers.hh:223
RiscvISA::MISCREG_HPMEVENT18
@ MISCREG_HPMEVENT18
Definition: registers.hh:210
base.hh
RiscvISA::MISCREG_HPMCOUNTER12
@ MISCREG_HPMCOUNTER12
Definition: registers.hh:175
RiscvISA::MISCREG_PMPADDR04
@ MISCREG_PMPADDR04
Definition: registers.hh:248
RiscvISA::MISCREG_SSCRATCH
@ MISCREG_SSCRATCH
Definition: registers.hh:265
SERIALIZE_CONTAINER
#define SERIALIZE_CONTAINER(member)
Definition: serialize.hh:642
RiscvISA::MISCREG_HPMCOUNTER29
@ MISCREG_HPMCOUNTER29
Definition: registers.hh:192
RiscvISA::MISCREG_PMPADDR02
@ MISCREG_PMPADDR02
Definition: registers.hh:246
RiscvISA::MISCREG_HPMCOUNTER26
@ MISCREG_HPMCOUNTER26
Definition: registers.hh:189
RiscvISA::MISCREG_PMPCFG0
@ MISCREG_PMPCFG0
Definition: registers.hh:240
RiscvISA::SXL_OFFSET
const off_t SXL_OFFSET
Definition: registers.hh:667
RiscvISA::MISCREG_PMPADDR11
@ MISCREG_PMPADDR11
Definition: registers.hh:255
RiscvISA::MISCREG_TSELECT
@ MISCREG_TSELECT
Definition: registers.hh:224
RiscvISA::MISCREG_MEDELEG
@ MISCREG_MEDELEG
Definition: registers.hh:232
RiscvISA::MISCREG_HPMEVENT17
@ MISCREG_HPMEVENT17
Definition: registers.hh:209
RiscvISA::MISCREG_HPMCOUNTER17
@ MISCREG_HPMCOUNTER17
Definition: registers.hh:180
RiscvISA::MISCREG_PMPADDR05
@ MISCREG_PMPADDR05
Definition: registers.hh:249
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:64
bits
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:73
RiscvISA::MiscRegNames
const M5_VAR_USED std::array< const char *, NumMiscRegs > MiscRegNames
Definition: isa.cc:52
RiscvISA::MISCREG_SATP
@ MISCREG_SATP
Definition: registers.hh:269
RiscvISA::MISCREG_HPMEVENT28
@ MISCREG_HPMEVENT28
Definition: registers.hh:220
BaseCPU::totalInsts
virtual Counter totalInsts() const =0
RiscvISA::Interrupts
Definition: interrupts.hh:53
RiscvISA::MISCREG_MTVAL
@ MISCREG_MTVAL
Definition: registers.hh:239
RiscvISA::CSRData
const std::map< int, CSRMetadata > CSRData
Definition: registers.hh:455
CheckpointIn
Definition: serialize.hh:68
RiscvISA::PRV_M
@ PRV_M
Definition: isa.hh:60
RiscvISA::MISCREG_STVEC
@ MISCREG_STVEC
Definition: registers.hh:263
ThreadContext::getCpuPtr
virtual BaseCPU * getCpuPtr()=0
RiscvISA::MISCREG_HPMCOUNTER22
@ MISCREG_HPMCOUNTER22
Definition: registers.hh:185
BaseISA
Definition: isa.hh:47
BaseCPU::getInterruptController
BaseInterrupts * getInterruptController(ThreadID tid)
Definition: base.hh:236
RiscvISA::FS_OFFSET
const off_t FS_OFFSET
Definition: registers.hh:669
RiscvISA::MISCREG_HPMCOUNTER25
@ MISCREG_HPMCOUNTER25
Definition: registers.hh:188
pagetable.hh
RiscvISA::MISCREG_HPMEVENT12
@ MISCREG_HPMEVENT12
Definition: registers.hh:204
RiscvISA::MISCREG_PMPADDR14
@ MISCREG_PMPADDR14
Definition: registers.hh:258
RiscvISA::MISCREG_ISA
@ MISCREG_ISA
Definition: registers.hh:155
RiscvISA::MISCREG_SEPC
@ MISCREG_SEPC
Definition: registers.hh:266
ULL
#define ULL(N)
uint64_t constant
Definition: types.hh:46
RegVal
uint64_t RegVal
Definition: types.hh:174
RiscvISA::STATUS_UXL_MASK
const RegVal STATUS_UXL_MASK
Definition: registers.hh:679
RiscvISA::ISA::ISA
ISA(const Params &p)
Definition: isa.cc:179
RiscvISA::MISCREG_HPMCOUNTER15
@ MISCREG_HPMCOUNTER15
Definition: registers.hh:178
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
RiscvISA::MISCREG_VENDORID
@ MISCREG_VENDORID
Definition: registers.hh:156
RiscvISA::MISCREG_HPMCOUNTER23
@ MISCREG_HPMCOUNTER23
Definition: registers.hh:186
RiscvISA::MISCREG_MIDELEG
@ MISCREG_MIDELEG
Definition: registers.hh:233
RiscvISA::MISCREG_HPMCOUNTER21
@ MISCREG_HPMCOUNTER21
Definition: registers.hh:184

Generated on Tue Mar 23 2021 19:41:18 for gem5 by doxygen 1.8.17