Skip to content

Commit

Permalink
aplic: fix: HartIndex subfiled error when groupNumWidth==0
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Oct 31, 2024
1 parent f8dcd34 commit 9d7fe14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/scala/APLIC.scala
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ class Domain(
val (tl, edge) = toIMSIC.out(0)
tl.d.ready := true.B
def getMSIAddr(HartIndex:UInt, guestID:UInt): UInt = {
val groupID = HartIndex(imsic_params.groupsWidth+imsic_params.membersWidth-1, imsic_params.membersWidth)
val groupID = if (imsic_params.groupsWidth == 0) 0.U
else HartIndex(imsic_params.groupsWidth+imsic_params.membersWidth-1, imsic_params.membersWidth)
val memberID = HartIndex(imsic_params.membersWidth-1, 0)
// It is recommended to hardwire *msiaddrcfg* by the manual:
// "For any given system, these addresses are fixed and should be hardwired into the APLIC if possible."
Expand Down

0 comments on commit 9d7fe14

Please sign in to comment.