Skip to content

Commit

Permalink
[lsu] Fix speculative load wakeups
Browse files Browse the repository at this point in the history
Loads to zero register should not speculatively wakeup other uops,
  • Loading branch information
jerryz123 authored and abejgonzalez committed Jan 23, 2019
1 parent 643ea19 commit 977590c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/scala/exu/core.scala
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,15 @@ class BoomCore(implicit p: Parameters, edge: freechips.rocketchip.tilelink.TLEdg

// Load/Store Unit & ExeUnits
exe_units.memory_unit.io.lsu_io <> lsu.io

// TODO: Generate this in lsu
val sxt_ldMiss = Wire(Bool())






//-------------------------------------------------------------
// Uarch Hardware Performance Events (HPEs)

Expand Down Expand Up @@ -679,6 +682,7 @@ class BoomCore(implicit p: Parameters, edge: freechips.rocketchip.tilelink.TLEdg
mem_iq.io.iss_valids(0) &&
mem_iq.io.iss_uops(0).is_load &&
!mem_iq.io.iss_uops(0).fp_val &&
mem_iq.io.iss_uops(0).pdst =/= 0.U &&
!(sxt_ldMiss && (mem_iq.io.iss_uops(0).iw_p1_poisoned || mem_iq.io.iss_uops(0).iw_p2_poisoned))
sxt_ldMiss :=
((lsu.io.nack.valid && lsu.io.nack.isload) || dc_shim.io.core.load_miss) &&
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/lsu/lsu.scala
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,9 @@ class LoadStoreUnit(pl_width: Int)(implicit p: Parameters,
mem_ld_killed := true.B && mem_fired_ld
}

io.mem_ldSpecWakeup.valid := RegNext(will_fire_load_incoming && !io.exe_resp.bits.uop.fp_val, init=false.B)
io.mem_ldSpecWakeup.valid := RegNext(will_fire_load_incoming
&& !io.exe_resp.bits.uop.fp_val
&& io.exe_resp.bits.uop.pdst =/= 0.U, init=false.B)
io.mem_ldSpecWakeup.bits := mem_ld_uop.pdst

// tell the ROB to clear the busy bit on the incoming store
Expand Down

0 comments on commit 977590c

Please sign in to comment.