xref: /XiangShan/src/main/scala/xiangshan/frontend/FrontendBundle.scala (revision 7295133529ec07672490a4dcfc4832daadb8bb4b)
1/***************************************************************************************
2* Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences
3* Copyright (c) 2020-2021 Peng Cheng Laboratory
4*
5* XiangShan is licensed under Mulan PSL v2.
6* You can use this software according to the terms and conditions of the Mulan PSL v2.
7* You may obtain a copy of Mulan PSL v2 at:
8*          http://license.coscl.org.cn/MulanPSL2
9*
10* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13*
14* See the Mulan PSL v2 for more details.
15***************************************************************************************/
16package xiangshan.frontend
17
18import chipsalliance.rocketchip.config.Parameters
19import chisel3._
20import chisel3.util._
21import chisel3.experimental.chiselName
22import xiangshan._
23import utils._
24import scala.math._
25
26@chiselName
27class FetchRequestBundle(implicit p: Parameters) extends XSBundle {
28  val startAddr       = UInt(VAddrBits.W)
29  val fallThruAddr    = UInt(VAddrBits.W)
30  val fallThruError   = Bool()
31  val ftqIdx          = new FtqPtr
32  val ftqOffset       = ValidUndirectioned(UInt(log2Ceil(PredictWidth).W))
33  val target          = UInt(VAddrBits.W)
34  val oversize        = Bool()
35
36  def fallThroughError() = {
37    def carryPos = instOffsetBits+log2Ceil(PredictWidth)+1
38    def getLower(pc: UInt) = pc(instOffsetBits+log2Ceil(PredictWidth), instOffsetBits)
39    val carry = (startAddr(carryPos) =/= fallThruAddr(carryPos)).asUInt
40    val startLower        = Cat(0.U(1.W), getLower(startAddr))
41    val endLowerwithCarry = Cat(carry,    getLower(fallThruAddr))
42    require(startLower.getWidth == log2Ceil(PredictWidth)+2)
43    require(endLowerwithCarry.getWidth == log2Ceil(PredictWidth)+2)
44    startLower >= endLowerwithCarry || (endLowerwithCarry - startLower) > (PredictWidth+1).U
45  }
46  def fromFtqPcBundle(b: Ftq_RF_Components) = {
47    this.startAddr := b.startAddr
48    this.fallThruAddr := b.getFallThrough()
49    this.oversize := b.oversize
50    this
51  }
52  def fromBpuResp(resp: BranchPredictionBundle) = {
53    // only used to bypass, so some fields remains unchanged
54    this.startAddr := resp.pc
55    this.target := resp.target
56    this.ftqOffset := resp.genCfiIndex
57    this.fallThruAddr := resp.fallThroughAddr
58    this.oversize := resp.ftb_entry.oversize
59    this
60  }
61  override def toPrintable: Printable = {
62    p"[start] ${Hexadecimal(startAddr)} [pft] ${Hexadecimal(fallThruAddr)}" +
63      p"[tgt] ${Hexadecimal(target)} [ftqIdx] $ftqIdx [jmp] v:${ftqOffset.valid}" +
64      p" offset: ${ftqOffset.bits}\n"
65  }
66}
67
68class PredecodeWritebackBundle(implicit p:Parameters) extends XSBundle {
69  val pc           = Vec(PredictWidth, UInt(VAddrBits.W))
70  val pd           = Vec(PredictWidth, new PreDecodeInfo) // TODO: redefine Predecode
71  val ftqIdx       = new FtqPtr
72  val ftqOffset    = UInt(log2Ceil(PredictWidth).W)
73  val misOffset    = ValidUndirectioned(UInt(log2Ceil(PredictWidth).W))
74  val cfiOffset    = ValidUndirectioned(UInt(log2Ceil(PredictWidth).W))
75  val target       = UInt(VAddrBits.W)
76  val jalTarget    = UInt(VAddrBits.W)
77  val instrRange   = Vec(PredictWidth, Bool())
78}
79
80class Exception(implicit p: Parameters) extends XSBundle {
81
82}
83
84class FetchToIBuffer(implicit p: Parameters) extends XSBundle {
85  val instrs    = Vec(PredictWidth, UInt(32.W))
86  val valid     = UInt(PredictWidth.W)
87  val pd        = Vec(PredictWidth, new PreDecodeInfo)
88  val pc        = Vec(PredictWidth, UInt(VAddrBits.W))
89  val foldpc    = Vec(PredictWidth, UInt(MemPredPCWidth.W))
90  //val exception = new Exception
91  val ftqPtr       = new FtqPtr
92  val ftqOffset    = Vec(PredictWidth, ValidUndirectioned(UInt(log2Ceil(PredictWidth).W)))
93  val ipf          = Vec(PredictWidth, Bool())
94  val acf          = Vec(PredictWidth, Bool())
95  val crossPageIPFFix = Vec(PredictWidth, Bool())
96  val triggered    = Vec(PredictWidth, new TriggerCf)
97}
98
99// class BitWiseUInt(val width: Int, val init: UInt) extends Module {
100//   val io = IO(new Bundle {
101//     val set
102//   })
103// }
104// Move from BPU
105abstract class GlobalHistory(implicit p: Parameters) extends XSBundle with HasBPUConst {
106  def update(br_valids: Vec[Bool], real_taken_mask: Vec[Bool]): GlobalHistory
107}
108
109class ShiftingGlobalHistory(implicit p: Parameters) extends GlobalHistory {
110  val predHist = UInt(HistoryLength.W)
111
112  def update(shift: UInt, taken: Bool, hist: UInt = this.predHist): ShiftingGlobalHistory = {
113    val g = Wire(new ShiftingGlobalHistory)
114    g.predHist := (hist << shift) | taken
115    g
116  }
117
118  def update(br_valids: Vec[Bool], real_taken_mask: Vec[Bool]): ShiftingGlobalHistory = {
119    require(br_valids.length == numBr)
120    require(real_taken_mask.length == numBr)
121    val last_valid_idx = PriorityMux(
122      br_valids.reverse :+ true.B,
123      (numBr to 0 by -1).map(_.U(log2Ceil(numBr+1).W))
124    )
125    val first_taken_idx = PriorityEncoder(false.B +: real_taken_mask)
126    val smaller = Mux(last_valid_idx < first_taken_idx,
127      last_valid_idx,
128      first_taken_idx
129    )
130    val shift = smaller
131    val taken = real_taken_mask.reduce(_||_)
132    update(shift, taken, this.predHist)
133  }
134
135  // static read
136  def read(n: Int): Bool = predHist.asBools()(n)
137
138  final def === (that: ShiftingGlobalHistory): Bool = {
139    predHist === that.predHist
140  }
141
142  final def =/= (that: ShiftingGlobalHistory): Bool = !(this === that)
143}
144
145// circular global history pointer
146class CGHPtr(implicit p: Parameters) extends CircularQueuePtr[CGHPtr](
147  p => p(XSCoreParamsKey).HistoryLength
148){
149  override def cloneType = (new CGHPtr).asInstanceOf[this.type]
150}
151class CircularGlobalHistory(implicit p: Parameters) extends GlobalHistory {
152  val buffer = Vec(HistoryLength, Bool())
153  type HistPtr = UInt
154  def update(br_valids: Vec[Bool], real_taken_mask: Vec[Bool]): CircularGlobalHistory = {
155    this
156  }
157}
158
159class FoldedHistory(val len: Int, val compLen: Int, val max_update_num: Int)(implicit p: Parameters)
160  extends XSBundle with HasBPUConst {
161  require(compLen >= 1)
162  require(len > 0)
163  // require(folded_len <= len)
164  require(compLen >= max_update_num)
165  val folded_hist = UInt(compLen.W)
166
167  def info = (len, compLen)
168  def oldest_bit_to_get_from_ghr = (0 until max_update_num).map(len - _ - 1)
169  def oldest_bit_pos_in_folded = oldest_bit_to_get_from_ghr map (_ % compLen)
170  def oldest_bit_wrap_around = oldest_bit_to_get_from_ghr map (_ / compLen > 0)
171  def oldest_bit_start = oldest_bit_pos_in_folded.head
172
173  def get_oldest_bits_from_ghr(ghr: Vec[Bool], histPtr: CGHPtr) = {
174    // TODO: wrap inc for histPtr value
175    oldest_bit_to_get_from_ghr.map(i => ghr((histPtr + (i+1).U).value))
176  }
177
178  def circular_shift_left(max_shift_value: Int)(src: UInt, shamt: UInt) = {
179    val srcLen = src.getWidth
180    require(max_shift_value <= srcLen)
181    val src_doubled = Cat(src, src)
182    val shifted_vec = (0 to max_shift_value).map(i => src_doubled(srcLen*2-1-i, srcLen-i))
183    val sel_vec = (0 to max_shift_value).map(_.U === shamt)
184    Mux1H(sel_vec, shifted_vec)
185  }
186
187
188  def update(ghr: Vec[Bool], histPtr: CGHPtr, num: UInt, taken: Bool): FoldedHistory = {
189    // do xors for several bitsets at specified bits
190    def bitsets_xor(len: Int, bitsets: Seq[Seq[Tuple2[Int, Bool]]]) = {
191      val res = Wire(Vec(len, Bool()))
192      // println(f"num bitsets: ${bitsets.length}")
193      // println(f"bitsets $bitsets")
194      val resArr = Array.fill(len)(List[Bool]())
195      for (bs <- bitsets) {
196        for ((n, b) <- bs) {
197          resArr(n) = b :: resArr(n)
198        }
199      }
200      // println(f"${resArr.mkString}")
201      // println(f"histLen: ${this.len}, foldedLen: $folded_len")
202      for (i <- 0 until len) {
203        // println(f"bit[$i], ${resArr(i).mkString}")
204        if (resArr(i).length > 2) {
205          println(f"[warning] update logic of foldest history has two or more levels of xor gates! " +
206            f"histlen:${this.len}, compLen:$compLen")
207        }
208        if (resArr(i).length == 0) {
209          println(f"[error] bits $i is not assigned in folded hist update logic! histlen:${this.len}, compLen:$compLen")
210        }
211        res(i) := resArr(i).foldLeft(false.B)(_^_)
212      }
213      res.asUInt
214    }
215    val oldest_bits = get_oldest_bits_from_ghr(ghr, histPtr)
216
217    // mask off bits that do not update
218    val oldest_bits_masked = oldest_bits.zipWithIndex.map{
219      case (ob, i) => ob && (i.U < num)
220    }
221    // if a bit does not wrap around, it should not be xored when it exits
222    val oldest_bits_set = (0 until max_update_num).filter(oldest_bit_wrap_around).map(i => (oldest_bit_pos_in_folded(i), oldest_bits_masked(i)))
223
224    // println(f"old bits pos ${oldest_bits_set.map(_._1)}")
225
226    // only the last bit could be 1, as we have at most one taken branch at a time
227    val newest_bits_masked = VecInit((0 until max_update_num).map(i => taken && (i+1).U === num)).asUInt
228    // if a bit does not wrap around, newest bits should not be xored onto it either
229    val newest_bits_set = (0 until max_update_num).map(i => (compLen-1-i, newest_bits_masked(i)))
230
231    // println(f"new bits set ${newest_bits_set.map(_._1)}")
232    //
233    val original_bits_masked = VecInit(folded_hist.asBools.zipWithIndex.map{
234      case (fb, i) => fb && !(num >= (len-i).U)
235    })
236    val original_bits_set = (0 until compLen).map(i => (i, original_bits_masked(i)))
237
238
239    // histLen too short to wrap around
240    val new_folded_hist =
241      if (len <= compLen) {
242        ((folded_hist << num) | taken)(compLen-1,0)
243        // circular_shift_left(max_update_num)(Cat(Reverse(newest_bits_masked), folded_hist(compLen-max_update_num-1,0)), num)
244      } else {
245        // do xor then shift
246        val xored = bitsets_xor(compLen, Seq(original_bits_set, oldest_bits_set, newest_bits_set))
247        circular_shift_left(max_update_num)(xored, num)
248      }
249    val fh = WireInit(this)
250    fh.folded_hist := new_folded_hist
251    fh
252  }
253
254  // def update(ghr: Vec[Bool], histPtr: CGHPtr, valids: Vec[Bool], takens: Vec[Bool]): FoldedHistory = {
255  //   val fh = WireInit(this)
256  //   require(valids.length == max_update_num)
257  //   require(takens.length == max_update_num)
258  //   val last_valid_idx = PriorityMux(
259  //     valids.reverse :+ true.B,
260  //     (max_update_num to 0 by -1).map(_.U(log2Ceil(max_update_num+1).W))
261  //     )
262  //   val first_taken_idx = PriorityEncoder(false.B +: takens)
263  //   val smaller = Mux(last_valid_idx < first_taken_idx,
264  //     last_valid_idx,
265  //     first_taken_idx
266  //   )
267  //   // update folded_hist
268  //   fh.update(ghr, histPtr, smaller, takens.reduce(_||_))
269  // }
270  // println(f"folded hist original length: ${len}, folded len: ${folded_len} " +
271  //   f"oldest bits' pos in folded: ${oldest_bit_pos_in_folded}")
272
273
274}
275
276class TableAddr(val idxBits: Int, val banks: Int)(implicit p: Parameters) extends XSBundle{
277  def tagBits = VAddrBits - idxBits - instOffsetBits
278
279  val tag = UInt(tagBits.W)
280  val idx = UInt(idxBits.W)
281  val offset = UInt(instOffsetBits.W)
282
283  def fromUInt(x: UInt) = x.asTypeOf(UInt(VAddrBits.W)).asTypeOf(this)
284  def getTag(x: UInt) = fromUInt(x).tag
285  def getIdx(x: UInt) = fromUInt(x).idx
286  def getBank(x: UInt) = if (banks > 1) getIdx(x)(log2Up(banks) - 1, 0) else 0.U
287  def getBankIdx(x: UInt) = if (banks > 1) getIdx(x)(idxBits - 1, log2Up(banks)) else getIdx(x)
288}
289
290@chiselName
291class BranchPrediction(implicit p: Parameters) extends XSBundle with HasBPUConst {
292  val br_taken_mask = Vec(numBr, Bool())
293
294  val slot_valids = Vec(totalSlot, Bool())
295
296  val targets = Vec(totalSlot, UInt(VAddrBits.W))
297
298  val is_jal = Bool()
299  val is_jalr = Bool()
300  val is_call = Bool()
301  val is_ret = Bool()
302  val is_br_sharing = Bool()
303
304  // val call_is_rvc = Bool()
305  val hit = Bool()
306
307  def br_slot_valids = slot_valids.init
308  def tail_slot_valid = slot_valids.last
309
310  def br_valids = {
311    VecInit(
312      if (shareTailSlot)
313        br_slot_valids :+ (tail_slot_valid && is_br_sharing)
314      else
315        br_slot_valids
316    )
317  }
318
319  def taken_mask_on_slot = {
320    VecInit(
321      if (shareTailSlot)
322        (br_slot_valids zip br_taken_mask.init).map{ case (t, v) => t && v } :+ (
323          (br_taken_mask.last && tail_slot_valid && is_br_sharing) ||
324          tail_slot_valid && !is_br_sharing
325        )
326      else
327        (br_slot_valids zip br_taken_mask).map{ case (v, t) => v && t } :+
328        tail_slot_valid
329    )
330  }
331
332  def taken = br_taken_mask.reduce(_||_) || slot_valids.last // || (is_jal || is_jalr)
333
334  def fromFtbEntry(entry: FTBEntry, pc: UInt) = {
335    slot_valids := entry.brSlots.map(_.valid) :+ entry.tailSlot.valid
336    targets := entry.getTargetVec(pc)
337    is_jal := entry.tailSlot.valid && entry.isJal
338    is_jalr := entry.tailSlot.valid && entry.isJalr
339    is_call := entry.tailSlot.valid && entry.isCall
340    is_ret := entry.tailSlot.valid && entry.isRet
341    is_br_sharing := entry.tailSlot.valid && entry.tailSlot.sharing
342  }
343  // override def toPrintable: Printable = {
344  //   p"-----------BranchPrediction----------- " +
345  //     p"[taken_mask] ${Binary(taken_mask.asUInt)} " +
346  //     p"[is_br] ${Binary(is_br.asUInt)}, [is_jal] ${Binary(is_jal.asUInt)} " +
347  //     p"[is_jalr] ${Binary(is_jalr.asUInt)}, [is_call] ${Binary(is_call.asUInt)}, [is_ret] ${Binary(is_ret.asUInt)} " +
348  //     p"[target] ${Hexadecimal(target)}}, [hit] $hit "
349  // }
350
351  def display(cond: Bool): Unit = {
352    XSDebug(cond, p"[taken_mask] ${Binary(br_taken_mask.asUInt)} [hit] $hit\n")
353  }
354}
355
356@chiselName
357class BranchPredictionBundle(implicit p: Parameters) extends XSBundle with HasBPUConst with BPUUtils{
358  val pc = UInt(VAddrBits.W)
359
360  val valid = Bool()
361
362  val hasRedirect = Bool()
363  val ftq_idx = new FtqPtr
364  // val hit = Bool()
365  val preds = new BranchPrediction
366
367  val folded_hist = new AllFoldedHistories(foldedGHistInfos)
368  val histPtr = new CGHPtr
369  val phist = UInt(PathHistoryLength.W)
370  val rasSp = UInt(log2Ceil(RasSize).W)
371  val rasTop = new RASEntry
372  val specCnt = Vec(numBr, UInt(10.W))
373  // val meta = UInt(MaxMetaLength.W)
374
375  val ftb_entry = new FTBEntry() // TODO: Send this entry to ftq
376
377  def real_slot_taken_mask(): Vec[Bool] = {
378    VecInit(preds.taken_mask_on_slot.map(_ && preds.hit))
379  }
380
381  // len numBr
382  def real_br_taken_mask(): Vec[Bool] = {
383    if (shareTailSlot)
384      VecInit(
385        preds.taken_mask_on_slot.map(_ && preds.hit).init :+
386        (preds.br_taken_mask.last && preds.tail_slot_valid && preds.is_br_sharing && preds.hit)
387      )
388    else
389      VecInit(real_slot_taken_mask().init)
390  }
391
392  def br_count(): UInt = {
393    val last_valid_idx = PriorityMux(
394      preds.br_valids.reverse :+ true.B,
395      (numBr to 0 by -1).map(_.U(log2Ceil(numBr+1).W))
396      )
397    val first_taken_idx = PriorityEncoder(false.B +: real_br_taken_mask)
398    Mux(last_valid_idx < first_taken_idx,
399      last_valid_idx,
400      first_taken_idx
401    )
402  }
403
404  def hit_taken_on_jmp =
405    !real_slot_taken_mask().init.reduce(_||_) &&
406    real_slot_taken_mask().last && !preds.is_br_sharing
407  def hit_taken_on_call = hit_taken_on_jmp && preds.is_call
408  def hit_taken_on_ret  = hit_taken_on_jmp && preds.is_ret
409  def hit_taken_on_jalr = hit_taken_on_jmp && preds.is_jalr
410
411  def fallThroughAddr = getFallThroughAddr(pc, ftb_entry.carry, ftb_entry.pftAddr)
412
413  def target(): UInt = {
414    val targetVec = preds.targets :+ fallThroughAddr :+ (pc + (FetchWidth*4).U)
415    val selVec = real_slot_taken_mask() :+ (preds.hit && !real_slot_taken_mask().asUInt.orR) :+ true.B
416    PriorityMux(selVec zip targetVec)
417  }
418  def genCfiIndex = {
419    val cfiIndex = Wire(ValidUndirectioned(UInt(log2Ceil(PredictWidth).W)))
420    cfiIndex.valid := real_slot_taken_mask().asUInt.orR
421    // when no takens, set cfiIndex to PredictWidth-1
422    cfiIndex.bits :=
423      ParallelPriorityMux(real_slot_taken_mask(), ftb_entry.getOffsetVec) |
424      Fill(log2Ceil(PredictWidth), (!real_slot_taken_mask().asUInt.orR).asUInt)
425    cfiIndex
426  }
427
428  def display(cond: Bool): Unit = {
429    XSDebug(cond, p"[pc] ${Hexadecimal(pc)}\n")
430    folded_hist.display(cond)
431    preds.display(cond)
432    ftb_entry.display(cond)
433  }
434}
435
436@chiselName
437class BranchPredictionResp(implicit p: Parameters) extends XSBundle with HasBPUConst {
438  // val valids = Vec(3, Bool())
439  val s1 = new BranchPredictionBundle()
440  val s2 = new BranchPredictionBundle()
441  val s3 = new BranchPredictionBundle()
442
443  def selectedResp =
444    PriorityMux(Seq(
445      ((s3.valid && s3.hasRedirect) -> s3),
446      ((s2.valid && s2.hasRedirect) -> s2),
447      (s1.valid -> s1)
448    ))
449  def selectedRespIdx =
450    PriorityMux(Seq(
451      ((s3.valid && s3.hasRedirect) -> BP_S3),
452      ((s2.valid && s2.hasRedirect) -> BP_S2),
453      (s1.valid -> BP_S1)
454    ))
455  def lastStage = s3
456}
457
458class BpuToFtqBundle(implicit p: Parameters) extends BranchPredictionResp with HasBPUConst {
459  val meta = UInt(MaxMetaLength.W)
460}
461
462object BpuToFtqBundle {
463  def apply(resp: BranchPredictionResp)(implicit p: Parameters): BpuToFtqBundle = {
464    val e = Wire(new BpuToFtqBundle())
465    e.s1 := resp.s1
466    e.s2 := resp.s2
467    e.s3 := resp.s3
468
469    e.meta := DontCare
470    e
471  }
472}
473
474class BranchPredictionUpdate(implicit p: Parameters) extends BranchPredictionBundle with HasBPUConst {
475  val mispred_mask = Vec(numBr+1, Bool())
476  val false_hit = Bool()
477  val new_br_insert_pos = Vec(numBr, Bool())
478  val old_entry = Bool()
479  val meta = UInt(MaxMetaLength.W)
480  val full_target = UInt(VAddrBits.W)
481
482  def fromFtqRedirectSram(entry: Ftq_Redirect_SRAMEntry) = {
483    folded_hist := entry.folded_hist
484    histPtr := entry.histPtr
485    phist := entry.phist
486    rasSp := entry.rasSp
487    rasTop := entry.rasEntry
488    specCnt := entry.specCnt
489    this
490  }
491
492  override def display(cond: Bool) = {
493    XSDebug(cond, p"-----------BranchPredictionUpdate-----------\n")
494    XSDebug(cond, p"[mispred_mask] ${Binary(mispred_mask.asUInt)} [false_hit] $false_hit\n")
495    XSDebug(cond, p"[new_br_insert_pos] ${Binary(new_br_insert_pos.asUInt)}\n")
496    super.display(cond)
497    XSDebug(cond, p"--------------------------------------------\n")
498  }
499}
500
501class BranchPredictionRedirect(implicit p: Parameters) extends Redirect with HasBPUConst {
502  // override def toPrintable: Printable = {
503  //   p"-----------BranchPredictionRedirect----------- " +
504  //     p"-----------cfiUpdate----------- " +
505  //     p"[pc] ${Hexadecimal(cfiUpdate.pc)} " +
506  //     p"[predTaken] ${cfiUpdate.predTaken}, [taken] ${cfiUpdate.taken}, [isMisPred] ${cfiUpdate.isMisPred} " +
507  //     p"[target] ${Hexadecimal(cfiUpdate.target)} " +
508  //     p"------------------------------- " +
509  //     p"[robPtr] f=${robIdx.flag} v=${robIdx.value} " +
510  //     p"[ftqPtr] f=${ftqIdx.flag} v=${ftqIdx.value} " +
511  //     p"[ftqOffset] ${ftqOffset} " +
512  //     p"[level] ${level}, [interrupt] ${interrupt} " +
513  //     p"[stFtqIdx] f=${stFtqIdx.flag} v=${stFtqIdx.value} " +
514  //     p"[stFtqOffset] ${stFtqOffset} " +
515  //     p"\n"
516
517  // }
518
519  def display(cond: Bool): Unit = {
520    XSDebug(cond, p"-----------BranchPredictionRedirect----------- \n")
521    XSDebug(cond, p"-----------cfiUpdate----------- \n")
522    XSDebug(cond, p"[pc] ${Hexadecimal(cfiUpdate.pc)}\n")
523    // XSDebug(cond, p"[hist] ${Binary(cfiUpdate.hist.predHist)}\n")
524    XSDebug(cond, p"[br_hit] ${cfiUpdate.br_hit} [isMisPred] ${cfiUpdate.isMisPred}\n")
525    XSDebug(cond, p"[pred_taken] ${cfiUpdate.predTaken} [taken] ${cfiUpdate.taken} [isMisPred] ${cfiUpdate.isMisPred}\n")
526    XSDebug(cond, p"[target] ${Hexadecimal(cfiUpdate.target)} \n")
527    XSDebug(cond, p"[shift] ${cfiUpdate.shift}\n")
528    XSDebug(cond, p"------------------------------- \n")
529    XSDebug(cond, p"[robPtr] f=${robIdx.flag} v=${robIdx.value}\n")
530    XSDebug(cond, p"[ftqPtr] f=${ftqIdx.flag} v=${ftqIdx.value} \n")
531    XSDebug(cond, p"[ftqOffset] ${ftqOffset} \n")
532    XSDebug(cond, p"[stFtqIdx] f=${stFtqIdx.flag} v=${stFtqIdx.value}\n")
533    XSDebug(cond, p"[stFtqOffset] ${stFtqOffset}\n")
534    XSDebug(cond, p"---------------------------------------------- \n")
535  }
536}
537