Skip to content

Commit

Permalink
fix(FTB): Turn off FTB updates when FTB is closed.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleep-zzz committed Sep 11, 2024
1 parent 69652e6 commit f3984f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/scala/xiangshan/frontend/FTB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ class FTB(implicit p: Parameters) extends BasePredictor with FTBParams with BPUU
val update = io.update.bits

val u_meta = update.meta.asTypeOf(new FTBMeta)
val u_valid = io.update.valid && !io.update.bits.old_entry
val u_valid = io.update.valid && !io.update.bits.old_entry && !s2_close_ftb_req

val (_, delay2_pc) = DelayNWithValid(update.pc, u_valid, 2)
val (_, delay2_entry) = DelayNWithValid(update.ftb_entry, u_valid, 2)
Expand Down Expand Up @@ -807,6 +807,7 @@ class FTB(implicit p: Parameters) extends BasePredictor with FTBParams with BPUU
XSPerfAccumulate("ftb_update_req", io.update.valid)
XSPerfAccumulate("ftb_update_ignored", io.update.valid && io.update.bits.old_entry)
XSPerfAccumulate("ftb_updated", u_valid)
XSPerfAccumulate("ftb_closing_update_counter", s2_close_ftb_req && u_valid)

override val perfEvents = Seq(
("ftb_commit_hits ", io.update.valid && u_meta.hit),
Expand Down

0 comments on commit f3984f3

Please sign in to comment.