138 #include "arch/riscv/gdb-xml/gdb_xml_riscv_cpu.hh"
139 #include "arch/riscv/gdb-xml/gdb_xml_riscv_csr.hh"
140 #include "arch/riscv/gdb-xml/gdb_xml_riscv_fpu.hh"
141 #include "arch/riscv/gdb-xml/gdb_xml_riscv_target.hh"
149 #include "debug/GDBAcc.hh"
156 using namespace RiscvISA;
159 : BaseRemoteGDB(_system, _port), regCache(this)
168 MMU *mmu =
static_cast<MMU *
>(context()->getMMUPtr());
172 PrivilegeMode pmode = mmu->getMemPriv(context(), BaseMMU::Read);
175 satp.mode != AddrXlateMode::BARE) {
176 Walker *walker = mmu->getDataWalker();
177 Fault fault = walker->startFunctional(
178 context(), paddr, logBytes, BaseMMU::Read);
185 return context()->getProcessPtr()->pTable->lookup(
va) !=
nullptr;
191 DPRINTF(GDBAcc,
"getregs in remotegdb, size %lu\n", size());
304 DPRINTF(GDBAcc,
"setregs in remotegdb \n");
316 newVal = (oldVal & ~
mask) | (
r.fflags &
mask);
323 newVal = (oldVal & ~
mask) | (
r.frm &
mask);
330 newVal = (oldVal & ~
mask) | (
r.fcsr &
mask);
344 newVal = (oldVal & ~
mask) | (
r.ustatus &
mask);
350 newVal = (oldVal & ~
mask) | (
r.uie &
mask);
366 newVal = (oldVal & ~
mask) | (
r.uip &
mask);
374 newVal = (oldVal & ~
mask) | (
r.sstatus &
mask);
384 newVal = (oldVal & ~
mask) | (
r.sie &
mask);
402 newVal = (oldVal & ~
mask) | (
r.sip &
mask);
420 newVal = (oldVal & ~
mask) | (
r.mstatus &
mask);
426 newVal = (oldVal & ~
mask) | (
r.misa &
mask);
436 newVal = (oldVal & ~
mask) | (
r.mie &
mask);
454 newVal = (oldVal & ~
mask) | (
r.mip &
mask);
462 RemoteGDB::getXferFeaturesRead(
const std::string &annex, std::string &
output)
470 #define GDB_XML(x, s) \
472 x, std::string(reinterpret_cast<const char *>(Blobs::s), \
475 static const std::map<std::string, std::string> annexMap{
476 GDB_XML(
"target.xml", gdb_xml_riscv_target),
477 GDB_XML(
"riscv-64bit-cpu.xml", gdb_xml_riscv_cpu),
478 GDB_XML(
"riscv-64bit-fpu.xml", gdb_xml_riscv_fpu),
479 GDB_XML(
"riscv-64bit-csr.xml", gdb_xml_riscv_csr)};
481 auto it = annexMap.find(annex);
482 if (it == annexMap.end())
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
RemoteGDB(System *_system, int _port)
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal readMiscReg(RegIndex misc_reg)=0
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
virtual RegVal getReg(const RegId ®) const
virtual void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
virtual const PCStateBase & pcState() const =0
virtual void setReg(const RegId ®, RegVal val)
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
constexpr RegClass intRegClass
const std::unordered_map< int, CSRMetadata > CSRData
const std::unordered_map< int, RegVal > CSRMasks
constexpr RegClass floatRegClass
std::ostream & output()
Get the ostream from the current global logger.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::shared_ptr< FaultBase > Fault
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
constexpr decltype(nullptr) NoFault
Declarations of a non-full system Page Table.