未验证 提交 f21bbcb2 编写于 作者: G Guokai Chen 提交者: GitHub

add input checks for Ftq (#2027)

上级 b0fa7106
......@@ -813,6 +813,8 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
ifuWbPtr_write := ifuWbPtr + 1.U
}
XSError(ifu_wb_valid && isAfter(pdWb.bits.ftqIdx, ifuPtr), "IFU returned a predecode before its req, check IFU")
ftb_entry_mem.io.raddr.head := ifu_wb_idx
val has_false_hit = WireInit(false.B)
when (RegNext(hit_pd_valid)) {
......@@ -1031,6 +1033,8 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
io.toBpu.redirect := Mux(fromBackendRedirect.valid, fromBackendRedirect, ifuRedirectToBpu)
XSError(io.toBpu.redirect.valid && isBefore(io.toBpu.redirect.bits.ftqIdx, commPtr), "Ftq received a redirect after its commit, check backend or replay")
val may_have_stall_from_bpu = Wire(Bool())
val bpu_ftb_update_stall = RegInit(0.U(2.W)) // 2-cycle stall, so we need 3 states
may_have_stall_from_bpu := bpu_ftb_update_stall =/= 0.U
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册