Go to the documentation of this file.
43 #include "debug/Checkpoint.hh"
44 #include "debug/RiscvMisc.hh"
45 #include "params/RiscvISA.hh"
52 const std::array<const char *, NumMiscRegs> M5_VAR_USED
MiscRegNames = {{
185 const RiscvISAParams *
213 if (hpmcounter < 0 || hpmcounter > 31)
214 panic(
"Illegal HPM counter %d\n", hpmcounter);
237 panic(
"Illegal CSR index %#x\n", misc_reg);
240 DPRINTF(RiscvMisc,
"Reading MiscReg %s (%d): %#x.\n",
253 DPRINTF(RiscvMisc,
"Cycle counter at: %llu.\n",
257 warn(
"Cycle counter disabled.\n");
262 DPRINTF(RiscvMisc,
"Wall-clock counter at: %llu.\n",
264 return std::time(
nullptr);
266 warn(
"Wall clock disabled.\n");
271 DPRINTF(RiscvMisc,
"Instruction counter at: %llu.\n",
275 warn(
"Instruction counter disabled.\n");
308 DPRINTF(RiscvMisc,
"HPM counter %d: %llu.\n",
325 panic(
"Illegal CSR index %#x\n", misc_reg);
327 DPRINTF(RiscvMisc,
"Setting MiscReg %s (%d) to %#x.\n",
337 warn(
"Ignoring write to %s.\n",
CSRData.at(misc_reg).name);
360 if (new_val.mode != AddrXlateMode::BARE &&
361 new_val.mode != AddrXlateMode::SV39)
362 new_val.mode = cur_val.mode;
402 DPRINTF(Checkpoint,
"Serializing Riscv Misc Registers\n");
409 DPRINTF(Checkpoint,
"Unserializing Riscv Misc Registers\n");
416 RiscvISAParams::create()
RegVal readMiscReg(int misc_reg)
const std::array< const char *, NumMiscRegs > M5_VAR_USED MiscRegNames
#define UNSERIALIZE_CONTAINER(member)
bool hpmCounterEnabled(int counter) const
void unserialize(CheckpointIn &cp)
Unserialize an object.
T mbits(T val, int first, int last)
Mask off the given bits in place like bits() but without shifting.
virtual int threadId() const =0
const Params * params() const
void serialize(CheckpointOut &cp) const
Serialize an object.
const RegVal STATUS_SXL_MASK
const RegVal ISA_EXT_C_MASK
virtual ContextID contextId() const =0
void setMiscReg(int misc_reg, RegVal val)
void setMiscRegNoEffect(int misc_reg, RegVal val)
RegVal readMiscRegNoEffect(int misc_reg) const
virtual TheISA::PCState pcState() const =0
std::vector< RegVal > miscRegFile
const SimObjectParams * _params
Cached copy of the object parameters.
#define SERIALIZE_CONTAINER(member)
std::ostream CheckpointOut
virtual Counter totalInsts() const =0
const std::map< int, CSRMetadata > CSRData
virtual BaseCPU * getCpuPtr()=0
BaseInterrupts * getInterruptController(ThreadID tid)
#define ULL(N)
uint64_t constant
const RegVal STATUS_UXL_MASK
#define panic(...)
This implements a cprintf based panic() function.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Generated on Wed Sep 30 2020 14:01:59 for gem5 by doxygen 1.8.17