Skip to content

Commit

Permalink
timing(zacas): move isDropAmocasSta logic gen from Scheduler to NewDi…
Browse files Browse the repository at this point in the history
…spatch
  • Loading branch information
NewPaulWalker authored and xiaofeibao-xjtu committed Dec 16, 2024
1 parent 8cfebf3 commit 3d0b6b4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/scala/xiangshan/backend/Bundles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ object Bundles {
val vlsInstr = Bool()
val wfflags = Bool()
val isMove = Bool()
val isDropAmocasSta = Bool()
val uopIdx = UopIdx()
val isVset = Bool()
val firstUop = Bool()
Expand Down
4 changes: 4 additions & 0 deletions src/main/scala/xiangshan/backend/dispatch/NewDispatch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ class NewDispatch(implicit p: Parameters) extends XSModule with HasPerfEvents wi
fromRenameUpdate(i).valid := fromRename(i).valid && allowDispatch(i) && !uopBlockByIQ(i) && thisCanActualOut(i) && lsqCanAccept && !fromRename(i).bits.eliminatedMove
fromRename(i).ready := allowDispatch(i) && !uopBlockByIQ(i) && thisCanActualOut(i) && lsqCanAccept
}
for (i <- 0 until RenameWidth){
// check is drop amocas sta
fromRenameUpdate(i).bits.isDropAmocasSta := fromRename(i).bits.isAMOCAS && fromRename(i).bits.uopIdx(0) === 1.U
}
var temp = 0
allIssueParams.zipWithIndex.map{ case(issue, iqidx) => {
for (i <- 0 until issue.numEnq){
Expand Down
6 changes: 5 additions & 1 deletion src/main/scala/xiangshan/backend/issue/Scheduler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ class SchedulerMemImp(override val wrapper: Scheduler)(implicit params: SchdBloc
staIdx.zipWithIndex.map{ case (sta, i) => {
io.fromDispatch.uops(sta).ready := staReady(i) && stdReady(i)
}}
issueQueues.filter(iq => iq.params.StaCnt > 0).zip(staIdx).zipWithIndex.map{ case ((iq, idx),i) =>
iq.io.enq(i).valid := io.fromDispatch.uops(idx).valid && !io.fromDispatch.uops(idx).bits.isDropAmocasSta
}
val staValidFromDispatch = staIdx.map(idx => io.fromDispatch.uops(idx).valid)
val memAddrIQs = issueQueues.filter(_.params.isMemAddrIQ)
val stAddrIQs = issueQueues.filter(iq => iq.params.StaCnt > 0) // included in memAddrIQs
val ldAddrIQs = issueQueues.filter(iq => iq.params.LduCnt > 0)
Expand Down Expand Up @@ -493,7 +497,7 @@ class SchedulerMemImp(override val wrapper: Scheduler)(implicit params: SchdBloc
}

(stdEnqs ++ hydEnqs).zip(staEnqs ++ hyaEnqs).zipWithIndex.foreach { case ((stdIQEnq, staIQEnq), i) =>
stdIQEnq.valid := staIQEnq.valid && FuType.FuTypeOrR(staIQEnq.bits.fuType, FuType.stu, FuType.mou)
stdIQEnq.valid := staValidFromDispatch(i)
stdIQEnq.bits := staIQEnq.bits
// Store data reuses store addr src(1) in dispatch2iq
// [dispatch2iq] --src*------src*(0)--> [staIQ|hyaIQ]
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/xiangshan/backend/rename/Rename.scala
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class Rename(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHe
uop.useRegCache := DontCare
uop.regCacheIdx := DontCare
uop.traceBlockInPipe := DontCare
uop.isDropAmocasSta := DontCare
})
private val inst = Wire(Vec(RenameWidth, new XSInstBitFields))
private val isCsr = Wire(Vec(RenameWidth, Bool()))
Expand Down

0 comments on commit 3d0b6b4

Please sign in to comment.