Skip to content

Commit

Permalink
fix(exception): width of exception type should be explicitly noted (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Yan-Muzi authored Jan 5, 2025
1 parent 718a93f commit 3642c22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/xiangshan/frontend/FrontendBundle.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ class mmioCommitRead(implicit p: Parameters) extends XSBundle {
}

object ExceptionType {
def none: UInt = "b00".U
def pf: UInt = "b01".U // instruction page fault
def gpf: UInt = "b10".U // instruction guest page fault
def af: UInt = "b11".U // instruction access fault
def width: Int = 2
def none: UInt = "b00".U(width.W)
def pf: UInt = "b01".U(width.W) // instruction page fault
def gpf: UInt = "b10".U(width.W) // instruction guest page fault
def af: UInt = "b11".U(width.W) // instruction access fault

def hasException(e: UInt): Bool = e =/= none
def hasException(e: Vec[UInt]): Bool = e.map(_ =/= none).reduce(_ || _)
Expand Down

0 comments on commit 3642c22

Please sign in to comment.