Skip to content

Commit 549e4e9

Browse files
committed
proc: avoid initializing PMP entries at reset with DIFFTEST
1 parent fe255a0 commit 549e4e9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

riscv/processor.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,14 @@ void processor_t::reset()
581581
VU.reset();
582582
in_wfi = false;
583583

584+
#ifndef DIFFTEST
584585
if (n_pmp > 0) {
585586
// For backwards compatibility with software that is unaware of PMP,
586587
// initialize PMP to permit unprivileged access to all of memory.
587588
put_csr(CSR_PMPADDR0, ~reg_t(0));
588589
put_csr(CSR_PMPCFG0, PMP_R | PMP_W | PMP_X | PMP_NAPOT);
589590
}
591+
#endif
590592

591593
for (auto e : custom_extensions) // reset any extensions
592594
e.second->reset();

0 commit comments

Comments
 (0)