From 3642c22fc8628b1dc65216f57e0595adc20a7a2a Mon Sep 17 00:00:00 2001 From: Muzi <107630641+Yan-Muzi@users.noreply.github.com> Date: Sun, 5 Jan 2025 16:45:30 +0800 Subject: [PATCH] fix(exception): width of exception type should be explicitly noted (#4124) --- src/main/scala/xiangshan/frontend/FrontendBundle.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/scala/xiangshan/frontend/FrontendBundle.scala b/src/main/scala/xiangshan/frontend/FrontendBundle.scala index eebb8507a48..70e09f15fb2 100644 --- a/src/main/scala/xiangshan/frontend/FrontendBundle.scala +++ b/src/main/scala/xiangshan/frontend/FrontendBundle.scala @@ -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(_ || _)