Skip to content

Commit

Permalink
chore(TL2CHICoupledL2): add assertion in case of loss of PCredit
Browse files Browse the repository at this point in the history
  • Loading branch information
linjuanZ committed Sep 10, 2024
1 parent 08b8d61 commit 7ad3e9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/scala/coupledL2/tl2chi/TL2CHICoupledL2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ class TL2CHICoupledL2(implicit p: Parameters) extends CoupledL2Base {
})
grants(i) := pCrdMatchEntryOH(i)
}
val pCrdGrantCnt = RegInit(0.U(64.W))
val grantCnt = RegInit(0.U(64.W))
grantCnt := grantCnt + PopCount(grants)
when (isPCrdGrant) { pCrdGrantCnt := pCrdGrantCnt + 1.U }
assert(RegNext(pCrdGrantCnt, init = 0.U(64.W)) === PopCount(pCrdValids) + grantCnt)
dontTouch(grantCnt)

val rxrspSliceID = getSliceID(rxrsp.bits.txnID)
Expand Down

0 comments on commit 7ad3e9d

Please sign in to comment.