Skip to content

Commit

Permalink
NewCSR: fix select condition of candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
sinceforYy committed Aug 1, 2024
1 parent 038af8f commit 1528d63
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/scala/xiangshan/backend/fu/NewCSR/InterruptFilter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class InterruptFilter extends Module {
val sieFields = sie.asTypeOf(new SieBundle)
val hipFields = hip.asTypeOf(new HipBundle)
val hieFields = hie.asTypeOf(new HieBundle)
val vsipFields = vsip.asTypeOf(new VSipBundle)
val vsieFields = vsie.asTypeOf(new VSieBundle)
val hidelegFields = hideleg.asTypeOf(new HidelegBundle)

private val hsip = hip.asUInt | sip.asUInt
Expand Down Expand Up @@ -180,10 +182,10 @@ class InterruptFilter extends Module {
)

// refactor this code & has some problem
val Candidate1: Bool = hidelegFields.VSEI && hipFields.VSEIP && hieFields.VSEIE.asBool && (hstatus.VGEIN.asUInt =/= 0.U) && (vstopei.asUInt =/= 0.U)
val Candidate2: Bool = hidelegFields.VSEI && hipFields.VSEIP && hieFields.VSEIE.asBool && (hstatus.VGEIN.asUInt === 0.U) && (hvictl.IID.asUInt === 9.U) && (hvictl.IPRIO.asUInt =/= 0.U)
val Candidate3: Bool = hidelegFields.VSEI && hipFields.VSEIP && hieFields.VSEIE.asBool && !Candidate1 && !Candidate2
val Candidate4: Bool = hvictl.VTI.asUInt === 0.U
val Candidate1: Bool = vsipFields.VSEIP.asBool && vsieFields.VSEIE.asBool && (hstatus.VGEIN.asUInt =/= 0.U) && (vstopei.asUInt =/= 0.U)
val Candidate2: Bool = vsipFields.VSEIP.asBool && vsieFields.VSEIE.asBool && (hstatus.VGEIN.asUInt === 0.U) && (hvictl.IID.asUInt === 9.U) && (hvictl.IPRIO.asUInt =/= 0.U)
val Candidate3: Bool = vsipFields.VSEIP.asBool && vsieFields.VSEIE.asBool && !Candidate1 && !Candidate2
val Candidate4: Bool = (hvictl.VTI.asUInt === 0.U) && (vsie & vsip & "hfffffffffffffdff".U).orR
val Candidate5: Bool = (hvictl.VTI.asUInt === 1.U) && (hvictl.IID.asUInt =/= 9.U)
val CandidateNoValid: Bool = !Candidate1 && !Candidate2 && !Candidate3 && !Candidate4 && !Candidate5

Expand Down

0 comments on commit 1528d63

Please sign in to comment.