Skip to content

Commit

Permalink
[rtl] fix index ls offset flush.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjun-li authored and Avimitin committed Nov 8, 2024
1 parent 7b85ef9 commit c8ad572
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions t1/src/lsu/SimpleAccessUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,10 @@ class SimpleAccessUnit(param: MSHRParam) extends Module with LSUPublic {
/** all check is ready, being able to send request to pipeline. */
val stateReady: Bool = stateIsRequest && maskCheck && indexCheck && fofCheck

// state === idle: All the remaining elements are removed by the mask,
// but there is still offset left.
/** signal to request offset in the pipeline, only assert for one cycle. */
requestOffset := stateIsRequest && maskCheck && !indexCheck && fofCheck
requestOffset := stateIsRequest && maskCheck && !indexCheck && fofCheck || state === idle

val s0DequeueFire: Bool = Wire(Bool())

Expand Down Expand Up @@ -954,6 +956,7 @@ class SimpleAccessUnit(param: MSHRParam) extends Module with LSUPublic {
// handle corner case for vl=0
val invalidInstruction: Bool = csrInterface.vl === 0.U && !requestIsWholeRegisterLoadStore && lsuRequest.valid
val invalidInstructionNext: Bool = RegNext(invalidInstruction)
val allElementsMasked: Bool = state === idle && offsetQueueVec.map(_.deq.fire).reduce(_ || _)

// change state to request
when(lsuRequest.valid && !invalidInstruction) {
Expand All @@ -967,7 +970,7 @@ class SimpleAccessUnit(param: MSHRParam) extends Module with LSUPublic {
/** the current state is idle. */
val stateIdle = state === idle
status.idle := stateIdle
status.last := (!RegNext(stateIdle) && stateIdle) || invalidInstructionNext
status.last := (!RegNext(stateIdle) && stateIdle) || invalidInstructionNext || allElementsMasked
status.changeMaskGroup := updateOffsetGroupEnable
// which lane to access
status.targetLane := {
Expand Down

0 comments on commit c8ad572

Please sign in to comment.