Skip to content

Commit

Permalink
[rtl] fix reorderQueueAllocate timing.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjun-li committed Dec 30, 2024
1 parent cf9121f commit 0451da1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions t1/src/mask/MaskUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -786,13 +786,15 @@ class MaskUnit(val parameter: T1Parameter)
.tabulate(parameter.laneNumber) { i =>
val tokenSize = log2Ceil(reorderQueueSize + 1)
val counter = RegInit(0.U(tokenSize.W))
val counterWillUpdate = RegInit(0.U(tokenSize.W))
val release = reorderQueueVec(i).deq.fire
val allocate = Mux(readIssueStageEnq, accessCountEnq(i), 0.U)
val counterUpdate = counter + allocate - release
when(release || readIssueStageEnq) {
counter := counter + allocate - release
counter := counterUpdate
// counter if allocate all
counterWillUpdate := counterUpdate + parameter.laneNumber.U(tokenSize.W)
}
// counter if allocate all
val counterWillUpdate = counter + parameter.laneNumber.U(tokenSize.W)
!counterWillUpdate(tokenSize - 1)
}
.reduce(_ && _)
Expand Down

0 comments on commit 0451da1

Please sign in to comment.