Browse Source

Rebuild opcode map whenever ISA/logging changes

This facilitates caching less info in the opcode cache.
pull/2168/head
Andrew Waterman 6 months ago
parent
commit
2ec106b785
  1. 1
      riscv/csrs.cc
  2. 1
      riscv/processor.cc
  3. 2
      riscv/processor.h

1
riscv/csrs.cc

@ -778,6 +778,7 @@ bool misa_csr_t::unlogged_write(const reg_t val) noexcept {
}
proc->get_mmu()->flush_tlb();
proc->build_opcode_map();
return basic_csr_t::unlogged_write(new_misa);
}

1
riscv/processor.cc

@ -146,6 +146,7 @@ void processor_t::enable_log_commits()
{
log_commits_enabled = true;
mmu->flush_tlb(); // the TLB caches this setting
build_opcode_map();
}
void processor_t::reset()

2
riscv/processor.h

@ -347,6 +347,7 @@ public:
register_insn(insn, true /* is_custom */);
}
void register_extension(extension_t*);
void build_opcode_map();
// MMIO slave interface
bool load(reg_t addr, size_t len, uint8_t* bytes) override;
@ -429,7 +430,6 @@ private:
friend class extension_t;
void parse_priv_string(const char*);
void build_opcode_map();
void register_base_instructions();
insn_func_t decode_insn(insn_t insn);

Loading…
Cancel
Save