Skip to content

Commit

Permalink
top-down: remove 'sc_disagree' signal from redirect SRAM for FPGAPlat…
Browse files Browse the repository at this point in the history
…form (#2435)
  • Loading branch information
ngc7331 authored Oct 27, 2023
1 parent 6412991 commit abdc3a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/xiangshan/frontend/NewFtq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class PrefetchPtrDB(implicit p: Parameters) extends Bundle {
}

class Ftq_Redirect_SRAMEntry(implicit p: Parameters) extends SpeculativeInfo {
val sc_disagree = Vec(numBr, Bool())
val sc_disagree = if (!env.FPGAPlatform) Some(Vec(numBr, Bool())) else None
}

class Ftq_1R_SRAMEntry(implicit p: Parameters) extends XSBundle with HasBPUConst {
Expand Down Expand Up @@ -920,8 +920,9 @@ class Ftq(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHelpe
backendRedirectCfi.br_hit := r_ftb_entry.brIsSaved(r_ftqOffset)
backendRedirectCfi.jr_hit := r_ftb_entry.isJalr && r_ftb_entry.tailSlot.offset === r_ftqOffset
// FIXME: not portable
val sc_disagree = stage3CfiInfo.sc_disagree.getOrElse(VecInit(Seq.fill(numBr)(false.B)))
backendRedirectCfi.sc_hit := backendRedirectCfi.br_hit && Mux(r_ftb_entry.brSlots(0).offset === r_ftqOffset,
stage3CfiInfo.sc_disagree(0), stage3CfiInfo.sc_disagree(1))
sc_disagree(0), sc_disagree(1))

when (entry_hit_status(fromBackendRedirect.bits.ftqIdx.value) === h_hit) {
backendRedirectCfi.shift := PopCount(r_ftb_entry.getBrMaskByOffset(r_ftqOffset)) +&
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/xiangshan/frontend/SC.scala
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ trait HasSC extends HasSCParameter with HasPerfEvents { this: Tage =>
)

val s3_disagree = RegEnable(s2_disagree, io.s2_fire(3))
io.out.last_stage_spec_info.sc_disagree := s3_disagree
io.out.last_stage_spec_info.sc_disagree.map(_ := s3_disagree)

scMeta.tageTakens(w) := RegEnable(s2_tageTakens_dup(3)(w), io.s2_fire(3))
scMeta.scUsed(w) := RegEnable(s2_provideds(w), io.s2_fire(3))
Expand Down

0 comments on commit abdc3a3

Please sign in to comment.