Ignore MPRV in Debug Mode.
authorTim Newsome <tim@sifive.com>
Tue, 10 May 2016 18:36:33 +0000 (11:36 -0700)
committerTim Newsome <tim@sifive.com>
Mon, 23 May 2016 19:12:13 +0000 (12:12 -0700)
riscv/mmu.cc

index b88cade8d8a599665f18b8997df232a103d56218..e44c027b53ab2607dfa3bda746339e51ad64248d 100644 (file)
@@ -37,7 +37,7 @@ reg_t mmu_t::translate(reg_t addr, access_type type)
   reg_t mode = proc->state.prv;
   bool pum = false;
   if (type != FETCH) {
-    if (get_field(proc->state.mstatus, MSTATUS_MPRV))
+    if (!proc->state.dcsr.cause && get_field(proc->state.mstatus, MSTATUS_MPRV))
       mode = get_field(proc->state.mstatus, MSTATUS_MPP);
     pum = (mode == PRV_S && get_field(proc->state.mstatus, MSTATUS_PUM));
   }