Skip to content

Commit

Permalink
[rtl] Mask type instructions need to wait until the mask unit ends.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjun-li committed May 31, 2024
1 parent 1fa3ace commit 769f1ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions t1/src/Bundles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ class VRFInstructionState extends Bundle {
// execute finish, wait for write queue clear
val wWriteQueueClear: Bool = Bool()
val wLaneLastReport: Bool = Bool()
val wTopLastReport: Bool = Bool()
val wLaneClear: Bool = Bool()
}

Expand Down
1 change: 1 addition & 0 deletions t1/src/Lane.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ class Lane(val parameter: LaneParameter) extends Module with SerializableModule[
// load need wait for write queue clear in lsu write queue
vrf.instructionWriteReport.bits.state.wWriteQueueClear := !(laneRequest.bits.loadStore && !laneRequest.bits.store)
vrf.instructionWriteReport.bits.state.wLaneLastReport := !laneRequest.valid
vrf.instructionWriteReport.bits.state.wTopLastReport := !laneRequest.bits.decodeResult(Decoder.maskUnit)
vrf.instructionWriteReport.bits.state.wLaneClear := false.B

val elementSizeForOneRegister: Int = parameter.vLen / parameter.datapathWidth / parameter.laneNumber
Expand Down
9 changes: 6 additions & 3 deletions t1/src/vrf/VRF.scala
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,16 @@ class VRF(val parameter: VRFParam) extends Module with SerializableModule[VRFPar
val elementUpdate1H: UInt = (writeUpdate1HVec ++ loadUpdate1HVec).reduce(_ | _)
val dataInLaneCheck = ohCheck(dataInLane, record.bits.instIndex, parameter.chainingSize)
val laneLastReport = ohCheck(instructionLastReport, record.bits.instIndex, parameter.chainingSize)
val lsuFinish = ohCheck(lsuLastReport, record.bits.instIndex, parameter.chainingSize)
val topLastReport = ohCheck(lsuLastReport, record.bits.instIndex, parameter.chainingSize)
// only wait lane clear
val waitLaneClear = record.bits.state.stFinish && record.bits.state.wWriteQueueClear && record.bits.state.wLaneLastReport
val waitLaneClear =
record.bits.state.stFinish && record.bits.state.wWriteQueueClear &&
record.bits.state.wLaneLastReport && record.bits.state.wTopLastReport
val stateClear: Bool = waitLaneClear && record.bits.state.wLaneClear

when(lsuFinish) {
when(topLastReport) {
record.bits.state.stFinish := true.B
record.bits.state.wTopLastReport := true.B
}

when(laneLastReport) {
Expand Down

0 comments on commit 769f1ed

Please sign in to comment.