Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(LoadQueueReplay): fix enq mask generate when redirect #3884

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/main/scala/xiangshan/mem/lsqueue/LoadQueueReplay.scala
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ class LoadQueueReplay(implicit p: Parameters) extends XSModule
val needEnqueue = VecInit((0 until LoadPipelineWidth).map(w => {
canEnqueue(w) && !cancelEnq(w) && needReplay(w) && !hasExceptions(w)
}))
val newEnqueue = Wire(Vec(LoadPipelineWidth, Bool()))
val canFreeVec = VecInit((0 until LoadPipelineWidth).map(w => {
canEnqueue(w) && loadReplay(w) && (!needReplay(w) || hasExceptions(w))
}))
Expand Down Expand Up @@ -381,7 +382,7 @@ class LoadQueueReplay(implicit p: Parameters) extends XSModule
val needCancel = Wire(Vec(LoadQueueReplaySize, Bool()))
// generate enq mask
val enqIndexOH = Wire(Vec(LoadPipelineWidth, UInt(LoadQueueReplaySize.W)))
val s0_loadEnqFireMask = io.enq.map(x => x.fire && !x.bits.isLoadReplay && x.bits.rep_info.need_rep).zip(enqIndexOH).map(x => Mux(x._1, x._2, 0.U))
val s0_loadEnqFireMask = newEnqueue.zip(enqIndexOH).map(x => Mux(x._1, x._2, 0.U))
val s0_remLoadEnqFireVec = s0_loadEnqFireMask.map(x => VecInit((0 until LoadPipelineWidth).map(rem => getRemBits(x)(rem))))
val s0_remEnqSelVec = Seq.tabulate(LoadPipelineWidth)(w => VecInit(s0_remLoadEnqFireVec.map(x => x(w))))

Expand Down Expand Up @@ -603,9 +604,10 @@ class LoadQueueReplay(implicit p: Parameters) extends XSModule
assert(freeList.io.canAllocate.reduce(_ || _) || !io.enq.map(_.valid).reduce(_ || _), s"LoadQueueReplay Overflow")

// Allocate logic
val newEnqueue = (0 until LoadPipelineWidth).map(i => {
needEnqueue(i) && !io.enq(i).bits.isLoadReplay
})
needEnqueue.zip(newEnqueue).zip(io.enq).map {
case ((needEnq, newEnq), enq) =>
newEnq := needEnq && !enq.bits.isLoadReplay
}

for ((enq, w) <- io.enq.zipWithIndex) {
vaddrModule.io.wen(w) := false.B
Expand Down
Loading