Skip to content

Commit

Permalink
fix exception handle for misaligned superpage
Browse files Browse the repository at this point in the history
  • Loading branch information
Bohan Hu committed Nov 24, 2020
1 parent ab48048 commit a6fb2ed
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion project/metals.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DO NOT EDIT! This file is auto-generated.
// This file enables sbt-bloop to create bloop config files.

addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.4-13-408f4d80")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.5-6-4768184c")
2 changes: 1 addition & 1 deletion project/project/metals.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DO NOT EDIT! This file is auto-generated.
// This file enables sbt-bloop to create bloop config files.

addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.4-13-408f4d80")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.5-6-4768184c")
2 changes: 1 addition & 1 deletion project/project/project/metals.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DO NOT EDIT! This file is auto-generated.
// This file enables sbt-bloop to create bloop config files.

addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.4-13-408f4d80")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.5-6-4768184c")
11 changes: 5 additions & 6 deletions src/main/scala/mmu/ptw.scala
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,11 @@ class PTW(isDPTW: Boolean) extends Module {
}
// 6. If i > 0 and pa.ppn[i − 1 : 0] != 0, this is a misaligned superpage; stop and raise a page-fault
// exception.
// TODO: Fix it
// when((pteLevelReg === 1.U && Cat(pteConverted.ppn2, pteConverted.ppn1) =/= 0.U) ||
// (pteLevelReg === 2.U && pteConverted.ppn1 =/= 0.U)) {
// io.respValid := false.B
// stateReg := sERROR
// }
when((pteLevelReg === 1.U && Cat(pteConverted.ppn1, pteConverted.ppn0) =/= 0.U) ||
(pteLevelReg === 2.U && pteConverted.ppn0 =/= 0.U)) {
io.respValid := false.B
stateReg := sERROR
}
}.otherwise { // the PTE is a pointer to the next level of the page table
stateReg := sWAIT_PTE_Entry
when(pteLevelReg === 1.U) {
Expand Down

0 comments on commit a6fb2ed

Please sign in to comment.