Browse Source

Implement processor_t::paddr_bits correctly

It wasn't being called anywhere, so the 50- vs. 56-bit discrepancy
never manifested.
pull/2037/head
Andrew Waterman 10 months ago
parent
commit
72e8cad123
  1. 7
      riscv/processor.cc
  2. 2
      riscv/processor.h

7
riscv/processor.cc

@ -626,13 +626,6 @@ void processor_t::disasm(insn_t insn)
}
}
int processor_t::paddr_bits()
{
unsigned max_xlen = isa.get_max_xlen();
assert(xlen == max_xlen);
return max_xlen == 64 ? 50 : 34;
}
void processor_t::put_csr(int which, reg_t val)
{
val = zext_xlen(val);

2
riscv/processor.h

@ -273,6 +273,7 @@ public:
mmu_t* get_mmu() { return mmu; }
state_t* get_state() { return &state; }
unsigned get_xlen() const { return xlen; }
unsigned paddr_bits() { return isa.get_max_xlen() == 64 ? 56 : 34; }
unsigned get_const_xlen() const {
// Any code that assumes a const xlen should use this method to
// document that assumption. If Spike ever changes to allow
@ -422,7 +423,6 @@ private:
void take_trigger_action(triggers::action_t action, reg_t breakpoint_tval, reg_t epc, bool virt);
void disasm(insn_t insn); // disassemble and print an instruction
void register_insn(insn_desc_t, bool);
int paddr_bits();
void enter_debug_mode(uint8_t cause, uint8_t ext_cause);

Loading…
Cancel
Save