From 31e145eaf0e1cca94da0e27d7849a5f91a47c93f Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Tue, 5 Apr 2016 16:21:18 -0700 Subject: [PATCH] fix BroadcastHub allocation and routing --- uncore/src/main/scala/broadcast.scala | 3 ++- uncore/src/main/scala/uncore.scala | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/uncore/src/main/scala/broadcast.scala b/uncore/src/main/scala/broadcast.scala index 520c68af..5ecaa7e2 100644 --- a/uncore/src/main/scala/broadcast.scala +++ b/uncore/src/main/scala/broadcast.scala @@ -73,7 +73,8 @@ class L2BroadcastHub(implicit p: Parameters) extends ManagerCoherenceAgent()(p) trackerList.map(_.io.matches.iacq), trackerList.map(_.io.alloc.iacq), Some(sdqLoc), - Some(sdq_rdy && !irel_vs_iacq_conflict)) + Some(sdq_rdy && !irel_vs_iacq_conflict), + Some(sdq_rdy)) // Queue to store impending Voluntary Release data val voluntary = io.irel().isVoluntary() diff --git a/uncore/src/main/scala/uncore.scala b/uncore/src/main/scala/uncore.scala index 6444f54f..e64ad083 100644 --- a/uncore/src/main/scala/uncore.scala +++ b/uncore/src/main/scala/uncore.scala @@ -77,18 +77,20 @@ trait HasCoherenceAgentWiringHelpers { matches: Seq[Bool], allocs: Seq[Bool], dataOverrides: Option[Seq[UInt]] = None, - allocOverride: Option[Bool] = None) { + allocOverride: Option[Bool] = None, + matchOverride: Option[Bool] = None) { val ready_bits = Vec(outs.map(_.ready)).toBits val alloc_bits = PriorityEncoderOH(ready_bits) val match_bits = Vec(matches).toBits val no_matches = !match_bits.orR - val do_alloc = allocOverride.getOrElse(Bool(true)) - in.ready := Mux(no_matches, ready_bits.orR, (match_bits & ready_bits).orR) && do_alloc + val alloc_ok = allocOverride.getOrElse(Bool(true)) + val match_ok = matchOverride.getOrElse(Bool(true)) + in.ready := Mux(no_matches, ready_bits.orR, (match_bits & ready_bits).orR) && alloc_ok && match_ok outs.zip(allocs).zipWithIndex.foreach { case((out, a), i) => - out.valid := in.valid + out.valid := in.valid && match_ok out.bits := in.bits dataOverrides foreach { d => out.bits.data := d(i) } - a := alloc_bits(i) & no_matches & do_alloc + a := alloc_bits(i) & no_matches & alloc_ok } } }