提交 30cf915a 编写于 作者: L Lingrui98

[WIP] ftq: add update logic

上级 b5c101ad
......@@ -66,6 +66,9 @@ class FTBEntry (implicit p: Parameters) extends XSBundle with FTBParams {
// (taken_mask, target)
// }
def getJmpOffset(pc: UInt) = Cat(1.U(1.W), pftAddr(4,1)) - Mux(last_is_rvc, 2.U, 4.U) - pc(4,1)
def isJal = !isJalr
}
class FTBMeta(implicit p: Parameters) extends XSBundle with FTBParams {
......
......@@ -10,6 +10,7 @@ class FetchRequestBundle(implicit p: Parameters) extends XSBundle {
val startAddr = UInt(VAddrBits.W)
val fallThruAddr = UInt(VAddrBits.W)
val ftqIdx = new FtqPtr
val ldReplayOffset = ValidUndirectioned(UInt(log2Ceil(32).W))
val ftqOffset = ValidUndirectioned(UInt(log2Ceil(32).W))
val target = UInt(VAddrBits.W)
......@@ -121,6 +122,8 @@ class BranchPredictionResp(implicit p: Parameters) extends XSBundle with HasBPUC
class BranchPredictionUpdate(implicit p: Parameters) extends BranchPredictionBundle with HasBPUConst {
val mispred_mask = Vec(numBr+1, Bool())
val false_hit = Bool()
val new_br_insert_pos = Vec(numBr, Bool())
// val ghist = new GlobalHistory() This in spec_meta
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册