Skip to content

Commit

Permalink
[rtl] lastGroupForInstruction was calculated incorrectly.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjun-li authored and Avimitin committed Jan 25, 2024
1 parent dd91512 commit a53a7e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions t1/src/Lane.scala
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,7 @@ class Lane(val parameter: LaneParameter) extends Module with SerializableModule[
// vl is too small, don't need to use this lane.
(((laneIndex ## 0.U(2.W)) >> csrInterface.vSew).asUInt >= csrInterface.vl || maskLogicCompleted) &&
// for 'nr' type instructions, they will need another complete signal.
!laneRequest.bits.decodeResult(Decoder.nr) &&
// complete is notified by LSU.
!laneRequest.bits.loadStore
!laneRequest.bits.decodeResult(Decoder.nr)
// indicate if this is the mask type.
entranceControl.mask.valid := laneRequest.bits.mask
// assign mask from [[V]]
Expand All @@ -886,7 +884,7 @@ class Lane(val parameter: LaneParameter) extends Module with SerializableModule[
entranceControl.vrfWriteMask := 0.U

// calculate last group
val lastElementIndex: UInt = (csrInterface.vl - 1.U)(parameter.vlMaxBits - 2, 0)
val lastElementIndex: UInt = (csrInterface.vl - csrInterface.vl.orR)(parameter.vlMaxBits - 2, 0)
val requestVSew1H: UInt = UIntToOH(csrInterface.vSew)

/** For an instruction, the last group is not executed by all lanes,
Expand Down
3 changes: 2 additions & 1 deletion t1/src/lsu/SimpleAccessUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ class SimpleAccessUnit(param: MSHRParam) extends Module with LSUPublic {
case (offset, index) =>
// offsetReadResult(index).valid: new offset came
// (offset.valid && !usedIndexedInstructionOffsets(index)): old unused offset
offset.valid := offsetReadResult(index).valid || (offset.valid && !usedIndexedInstructionOffsets(index))
offset.valid := offsetReadResult(index).valid ||
(offset.valid && !usedIndexedInstructionOffsets(index) && !status.last)
// select from new and old.
offset.bits := Mux(offsetReadResult(index).valid, offsetReadResult(index).bits, offset.bits)
}
Expand Down

0 comments on commit a53a7e5

Please sign in to comment.