Skip to content

Commit 2ec106b

Browse files
committed
Rebuild opcode map whenever ISA/logging changes
This facilitates caching less info in the opcode cache.
1 parent bac3747 commit 2ec106b

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

riscv/csrs.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ bool misa_csr_t::unlogged_write(const reg_t val) noexcept {
778778
}
779779

780780
proc->get_mmu()->flush_tlb();
781+
proc->build_opcode_map();
781782

782783
return basic_csr_t::unlogged_write(new_misa);
783784
}

riscv/processor.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ void processor_t::enable_log_commits()
146146
{
147147
log_commits_enabled = true;
148148
mmu->flush_tlb(); // the TLB caches this setting
149+
build_opcode_map();
149150
}
150151

151152
void processor_t::reset()

riscv/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ class processor_t : public abstract_device_t
347347
register_insn(insn, true /* is_custom */);
348348
}
349349
void register_extension(extension_t*);
350+
void build_opcode_map();
350351

351352
// MMIO slave interface
352353
bool load(reg_t addr, size_t len, uint8_t* bytes) override;
@@ -429,7 +430,6 @@ class processor_t : public abstract_device_t
429430
friend class extension_t;
430431

431432
void parse_priv_string(const char*);
432-
void build_opcode_map();
433433
void register_base_instructions();
434434
insn_func_t decode_insn(insn_t insn);
435435

0 commit comments

Comments
 (0)