Skip to content

Commit

Permalink
satp/vsatp/hgatp.MODE should reset to legal value (off)
Browse files Browse the repository at this point in the history
  • Loading branch information
ingallsj committed Dec 23, 2021
1 parent 0299687 commit 1714680
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/main/scala/rocket/CSR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1436,10 +1436,30 @@ class CSRFile(
}
}

reg_satp.asid := 0
when(reset.asBool) {
reg_satp.mode := 0.U
reg_vsatp.mode := 0.U
reg_hgatp.mode := 0.U
}
if (!usingVM) {
reg_satp.mode := 0
reg_satp.ppn := 0
reg_satp.mode := 0.U
reg_satp.ppn := 0.U
reg_satp.asid := 0.U
}
if (!usingHypervisor) {
reg_vsatp.mode := 0.U
reg_vsatp.ppn := 0.U
reg_vsatp.asid := 0.U
reg_hgatp.mode := 0.U
reg_hgatp.ppn := 0.U
reg_hgatp.asid := 0.U
}
if (!(asIdBits > 0)) {
reg_satp.asid := 0.U
reg_vsatp.asid := 0.U
}
if (!(vmIdBits > 0)) {
reg_hgatp.asid := 0.U
}

if (nBreakpoints <= 1) reg_tselect := 0
Expand Down

0 comments on commit 1714680

Please sign in to comment.