提交 dc049c45 编写于 作者: Y Yinan Xu

roq: optimize priorities for validCounter and allEnqueue

上级 6e330dbc
......@@ -408,18 +408,23 @@ class Roq(numWbPorts: Int) extends XSModule with HasCircularQueuePtrHelper {
}
val lastCycleRedirect = RegNext(io.redirect.valid)
val nextValidCounter = Mux(io.redirectOut.valid,
val trueValidCounter = Mux(lastCycleRedirect, distanceBetween(enqPtr, deqPtr), validCounter)
validCounter := Mux(io.redirectOut.valid,
0.U,
Mux(lastCycleRedirect,
distanceBetween(enqPtr, deqPtr),
Mux(state === s_idle,
(validCounter - commitCnt) + firedDispatch,
validCounter
)
Mux(state === s_idle,
(validCounter - commitCnt) + firedDispatch,
trueValidCounter
)
)
allowEnqueue := Mux(io.redirectOut.valid,
true.B,
Mux(state === s_idle,
validCounter + firedDispatch <= (RoqSize - RenameWidth).U,
trueValidCounter <= (RoqSize - RenameWidth).U
)
)
validCounter := nextValidCounter
allowEnqueue := nextValidCounter <= (RoqSize - RenameWidth).U
/**
* States
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册