Skip to content

Commit

Permalink
MSHR: fix bug when aliasTask is AcquireBlock NtoT and L2 is Branch (#77)
Browse files Browse the repository at this point in the history
* MHSR: fix bug when aliasTask is AcquireBlock NtoT and self_state is Branch
use data in RefillBuffer not ReleaseBuffer

* Update MSHR.scala

---------

Co-authored-by: Chen Xi <48302201+Ivyfeather@users.noreply.github.com>
  • Loading branch information
ruiszhang and Ivyfeather authored Oct 30, 2023
1 parent a72721e commit 290cb89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/scala/coupledL2/MSHR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,14 @@ class MSHR(implicit p: Parameters) extends L2Module {
val aliasFinal = Mux(req_get || req_prefetch, meta.alias.getOrElse(0.U), req.alias.getOrElse(0.U))
mp_grant.alias.foreach(_ := aliasFinal)
mp_grant.aliasTask.foreach(_ := req.aliasTask.getOrElse(false.B))
// [Alias] write probeData into DS for alias-caused Probe,
// but not replacement-cased Probe
mp_grant.useProbeData := dirResult.hit && req_get || req.aliasTask.getOrElse(false.B)
// [Alias] write probeData into DS for alias-caused Probe, but not replacement-caused Probe
// Exception case when multi-core: if aliasTask is AcquireBlock NtoT and self_state is Branch,
// and there is a nested Probe toN from L3 (means the data Granted from L3 in the future may be a new data),
// useProbeData will be set false to use data in RefillBuffer
mp_grant.useProbeData := (dirResult.hit && req_get) ||
(req.aliasTask.getOrElse(false.B) &&
!(dirResult.meta.state === BRANCH && req_needT)
)
mp_grant.dirty := false.B

mp_grant.meta := MetaEntry(
Expand Down
1 change: 1 addition & 0 deletions src/test/scala/TestTop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ class TestTop_L2L3L2()(implicit p: Parameters) extends LazyModule {
TLFragmenter(32, 64) :=*
TLCacheCork() :=*
TLDelayer(delayFactor) :=*
TLLogger(s"MEM_L3", true) :=*
l3.node :=* xbar

lazy val module = new LazyModuleImp(this) {
Expand Down

0 comments on commit 290cb89

Please sign in to comment.