Skip to content

Commit 90aaf59

Browse files
sinceforYyTang-Haojin
authored andcommitted
feat(TopDown): add l3Miss IO for Top-Down
* Exclude all prefetch * Co-authored-by: Xi Chen <chenxi171@mails.ucas.ac.cn>
1 parent 6574d23 commit 90aaf59

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/main/scala/huancun/HuanCun.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ class HuanCun(implicit p: Parameters) extends LazyModule with HasHuanCunParamete
260260
val robHeadPaddr = Vec(cacheParams.hartIds.length, Flipped(Valid(UInt(36.W))))
261261
val addrMatch = Vec(cacheParams.hartIds.length, Output(Bool()))
262262
}
263+
val l3Miss = Output(Bool())
263264
})
264265

265266
val sizeBytes = cacheParams.toCacheParams.capacity.toDouble
@@ -459,6 +460,8 @@ class HuanCun(implicit p: Parameters) extends LazyModule with HasHuanCunParamete
459460
t.io.debugTopDown <> io.debugTopDown
460461
case None => io.debugTopDown.addrMatch.foreach(_ := false.B)
461462
}
463+
464+
io.l3Miss := RegNext(slices.map(_.io.l3Miss).reduce(_ || _))
462465
}
463466

464467
}

src/main/scala/huancun/Slice.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class Slice()(implicit p: Parameters) extends HuanCunModule {
3838
val ctl_req = Flipped(DecoupledIO(new CtrlReq()))
3939
val ctl_resp = DecoupledIO(new CtrlResp())
4040
val ctl_ecc = DecoupledIO(new EccInfo())
41+
val l3Miss = Output(Bool())
4142
})
4243
println(s"clientBits: $clientBits")
4344

@@ -657,6 +658,12 @@ class Slice()(implicit p: Parameters) extends HuanCunModule {
657658
io.dir_result.get := directory.io.result
658659
}
659660
)
661+
io.l3Miss := Cat(ms.init.init.map { m =>
662+
m.io.status.valid && m.io.status.bits.channel(0) && (
663+
m.io.status.bits.reqSource === MemReqSource.CPULoadData.id.U ||
664+
m.io.status.bits.reqSource === MemReqSource.CPUStoreData.id.U
665+
)
666+
}).orR
660667

661668
val perfinfo = IO(Output(Vec(numPCntHc, (UInt(6.W)))))
662669
perfinfo := DontCare

0 commit comments

Comments
 (0)