Skip to content

Commit

Permalink
[rtl] fix ffo pipe.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjun-li committed Dec 27, 2024
1 parent b1245cc commit b2498c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions t1/src/mask/MaskCompress.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class MaskCompressInterFace(parameter: CompressParam) extends Bundle {
val newInstruction: Bool = Input(Bool())
val ffoInstruction: Bool = Input(Bool())
val writeData: UInt = Output(UInt(parameter.xLen.W))
val stageValid: Bool = Bool()
val om = Output(Property[AnyClassType]())
}

Expand Down Expand Up @@ -239,10 +240,13 @@ class MaskCompress(val parameter: CompressParam)
)
compressMask := Mux(compressTailValid, compressTailMask, (-1.S(out.mask.getWidth.W)).asUInt)

val validInputPipe = initRegEnable(in.bits.validInput, in.fire)
val readFromScalarPipe = initRegEnable(in.bits.readFromScalar, in.fire)

val mvMask = Mux1H(eew1H, Seq(1.U, 3.U, 15.U))
val mvData = in.bits.readFromScalar
val mvData = readFromScalarPipe

val ffoMask: UInt = FillInterleaved(parameter.datapathWidth / 8, in.bits.validInput)
val ffoMask: UInt = FillInterleaved(parameter.datapathWidth / 8, validInputPipe)

outWire.data := Mux1H(
Seq(
Expand Down Expand Up @@ -303,6 +307,8 @@ class MaskCompress(val parameter: CompressParam)
}.elsewhen(mvRd) {
ffoIndex := source1SigExtend
}
outWire.ffoOutput := completedLeftOr | Fill(parameter.laneNumber, ffoValid)
out := RegNext(outWire, 0.U.asTypeOf(outWire))
val ffoOutPipe: UInt = initRegEnable(completedLeftOr | Fill(parameter.laneNumber, ffoValid), in.fire)
outWire.ffoOutput := ffoOutPipe
out := RegNext(outWire, 0.U.asTypeOf(outWire))
io.stageValid := stage2Valid
}
2 changes: 1 addition & 1 deletion t1/src/mask/MaskUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ class MaskUnit(val parameter: T1Parameter)
val executeStageInvalid: Bool = Mux1H(
unitType(3, 1),
Seq(
!compressUnit.io.out.compressValid,
!compressUnit.io.out.compressValid && !compressUnit.io.stageValid,
reduceUnit.io.in.ready,
true.B
)
Expand Down

0 comments on commit b2498c4

Please sign in to comment.