Skip to content

Commit

Permalink
[rtl] Remove write bubbles.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjun-li committed May 28, 2024
1 parent fc1b4be commit 07ab4de
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions t1/src/Lane.scala
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ class Lane(val parameter: LaneParameter) extends Module with SerializableModule[
}
val afterCheckValid: Seq[Bool] = Seq.tabulate(parameter.chainingSize + 3) { _ => RegInit(false.B)}
val afterCheckDequeueReady: Vec[Bool] = Wire(Vec(parameter.chainingSize + 3, Bool()))
val afterCheckDequeueFire: Seq[Bool] = afterCheckValid.zip(afterCheckDequeueReady).map {case (v, r) => v && r}

/** for each slot, assert when it is asking [[T1]] to change mask */
val slotMaskRequestVec: Vec[ValidIO[UInt]] = Wire(
Expand Down Expand Up @@ -877,6 +878,7 @@ class Lane(val parameter: LaneParameter) extends Module with SerializableModule[
0.U
)
val writeSelect: UInt = Wire(UInt((parameter.chainingSize + 3).W))
val writeCavitation: UInt = VecInit(allVrfWriteAfterCheck.map(_.mask === 0.U)).asUInt

// 处理 rf
{
Expand Down Expand Up @@ -924,7 +926,7 @@ class Lane(val parameter: LaneParameter) extends Module with SerializableModule[
when(enqFire) {
req := allVrfWrite(i).bits
}
val deqFire = afterCheckDequeueReady(i) && afterCheckValid(i)
val deqFire = afterCheckDequeueFire(i)
when(deqFire ^ enqFire) {
afterCheckValid(i) := enqFire
}
Expand All @@ -936,9 +938,9 @@ class Lane(val parameter: LaneParameter) extends Module with SerializableModule[
}.reduce(_ | _)

// Arbiter
writeSelect := ffo(VecInit(afterCheckValid).asUInt)
writeSelect := ffo(VecInit(afterCheckValid).asUInt & (~writeCavitation).asUInt)
afterCheckDequeueReady.zipWithIndex.foreach { case (p, i) =>
p := writeSelect(i) && queueBeforeMaskWrite.io.enq.ready
p := (writeSelect(i) && queueBeforeMaskWrite.io.enq.ready) || writeCavitation(i)
}

maskedWriteUnit.enqueue <> queueBeforeMaskWrite.io.deq
Expand Down

0 comments on commit 07ab4de

Please sign in to comment.