Skip to content

Commit e4fd161

Browse files
authored
fix(CoupledL2): fix l2MissMatch io compilation error (OpenXiangShan#456)
1 parent b40da89 commit e4fd161

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/main/scala/coupledL2/CoupledL2.scala

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -562,19 +562,18 @@ abstract class CoupledL2Base(implicit p: Parameters) extends LazyModule with Has
562562
case EdgeOutKey => node.out.head._2
563563
case BankBitsKey => bankBits
564564
})))
565-
topDown.foreach { t =>
566-
for ((s, i) <- slices.zipWithIndex) {
567-
t.io.msStatus(i) := s.io.msStatus.get
568-
t.io.msAlloc(i) := s.io.msAlloc.get
569-
t.io.dirResult(i) := s.io.dirResult.get
570-
t.io.hitPfInMSHR(i) := s.io.hitPfInMSHR.get
571-
t.io.pfLateInMSHR(i) := s.io.pfLateInMSHR.get
572-
t.io.pfSent(i) := s.io.pfSent.get
573-
}
574-
t.io.debugTopDown <> io.debugTopDown
575-
}
576-
when (topDown.isEmpty.B) {
577-
io.debugTopDown.l2MissMatch := false.B
565+
topDown match {
566+
case Some(t) =>
567+
for ((s, i) <- slices.zipWithIndex) {
568+
t.io.msStatus(i) := s.io.msStatus.get
569+
t.io.msAlloc(i) := s.io.msAlloc.get
570+
t.io.dirResult(i) := s.io.dirResult.get
571+
t.io.hitPfInMSHR(i) := s.io.hitPfInMSHR.get
572+
t.io.pfLateInMSHR(i) := s.io.pfLateInMSHR.get
573+
t.io.pfSent(i) := s.io.pfSent.get
574+
}
575+
t.io.debugTopDown <> io.debugTopDown
576+
case None => io.debugTopDown.l2MissMatch := false.B
578577
}
579578

580579
io.l2Miss := RegNext(slices.map(_.io.l2Miss).reduce(_ || _))

0 commit comments

Comments
 (0)