Skip to content

Commit

Permalink
fix(bpu): fix reg increase when removing asTypeOf
Browse files Browse the repository at this point in the history
  • Loading branch information
eastonman committed Dec 11, 2024
1 parent aadcdaf commit 2da0123
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/scala/xiangshan/frontend/ITTAGE.scala
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,16 @@ class ITTage(implicit p: Parameters) extends BaseITTage {
update := RegEnable(io.update.bits, io.update.valid)

// meta is splited by composer
val updateMeta = WireInit(update.meta.asTypeOf(new ITTageMeta))
val updateMeta = Wire(new ITTageMeta)
update.meta := updateMeta.asUInt

// The pc register has been moved outside of predictor, pc field of update bundle and other update data are not in the same stage
// so io.update.bits.pc is used directly here
val update_pc = io.update.bits.pc

// To improve Clock Gating Efficiency
val u_meta = io.update.bits.meta.asTypeOf(new ITTageMeta)
updateMeta := RegEnable(u_meta, io.update.valid)
updateMeta.provider.bits := RegEnable(
u_meta.provider.bits,
io.update.valid && u_meta.provider.valid
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/xiangshan/frontend/Tage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,9 @@ class Tage(implicit p: Parameters) extends BaseTage {
io.update.bits.ftb_entry.brValids(w) && io.update.valid
)) // io.update.bits.ftb_entry.always_taken has timing issues(FTQEntryGen)
val u_meta = io.update.bits.meta.asTypeOf(new TageMeta)
val updateMeta = WireInit(update.meta.asTypeOf(new TageMeta))
val updateMeta = Wire(new TageMeta)
update.meta := updateMeta.asUInt
updateMeta := RegEnable(u_meta, io.update.valid)
for (i <- 0 until numBr) {
updateMeta.providers(i).bits := RegEnable(
u_meta.providers(i).bits,
Expand Down

0 comments on commit 2da0123

Please sign in to comment.