From 40a5059cee6311f6bd5e74fc4a46aee5f34d99fe Mon Sep 17 00:00:00 2001 From: Henry Cook Date: Tue, 17 Mar 2015 00:23:11 -0700 Subject: [PATCH] clean up acquire alloc in hub --- uncore/src/main/scala/broadcast.scala | 24 ++++++++++++++---------- uncore/src/main/scala/cache.scala | 3 +-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/uncore/src/main/scala/broadcast.scala b/uncore/src/main/scala/broadcast.scala index c8014f45..2564140b 100644 --- a/uncore/src/main/scala/broadcast.scala +++ b/uncore/src/main/scala/broadcast.scala @@ -48,25 +48,29 @@ class L2BroadcastHub(bankId: Int) extends ManagerCoherenceAgent when (sdq_enq) { sdq(sdq_alloc_id) := io.iacq().data } // Handle acquire transaction initiation - val alloc_arb = Module(new Arbiter(Bool(), trackerList.size)) val trackerAcquireIOs = trackerList.map(_.io.inner.acquire) + + val alloc_arb = Module(new Arbiter(Bool(), trackerList.size)) + alloc_arb.io.out.ready := Bool(true) + trackerAcquireIOs.zip(alloc_arb.io.in).foreach { + case(tracker, arb) => arb.valid := tracker.ready + } + val alloc_idx = Vec(alloc_arb.io.in.map(_.ready)).lastIndexWhere{b: Bool => b} + val acquireMatchList = trackerList.map(_.io.has_acquire_match) val any_acquire_matches = acquireMatchList.reduce(_||_) - val alloc_idx = Vec(alloc_arb.io.in.map(_.ready)).lastIndexWhere{b: Bool => b} val match_idx = Vec(acquireMatchList).indexWhere{b: Bool => b} + val acquire_idx = Mux(any_acquire_matches, match_idx, alloc_idx) - trackerAcquireIOs.zip(alloc_arb.io.in).zipWithIndex.foreach { - case((tracker, arb), i) => - arb.valid := tracker.ready + val block_acquires = trackerList.map(_.io.has_acquire_conflict).reduce(_||_) + io.inner.acquire.ready := trackerAcquireIOs.map(_.ready).reduce(_||_) && !block_acquires && sdq_rdy + trackerAcquireIOs.zipWithIndex.foreach { + case(tracker, i) => tracker.bits := io.inner.acquire.bits tracker.bits.payload.data := DataQueueLocation(sdq_alloc_id, inStoreQueue).toBits - tracker.valid := arb.ready && (acquire_idx === UInt(i)) + tracker.valid := io.inner.acquire.valid && !block_acquires && (acquire_idx === UInt(i)) } - val block_acquires = trackerList.map(_.io.has_acquire_conflict).reduce(_||_) - io.inner.acquire.ready := trackerAcquireIOs.map(_.ready).reduce(_||_) && - sdq_rdy && !block_acquires - alloc_arb.io.out.ready := io.inner.acquire.valid && sdq_rdy && !block_acquires // Queue to store impending Voluntary Release data val voluntary = io.irel().isVoluntary() diff --git a/uncore/src/main/scala/cache.scala b/uncore/src/main/scala/cache.scala index a1defb3b..4af26399 100644 --- a/uncore/src/main/scala/cache.scala +++ b/uncore/src/main/scala/cache.scala @@ -376,8 +376,7 @@ class TSHRFile(bankId: Int) extends L2HellaCacheModule val alloc_arb = Module(new Arbiter(Bool(), trackerList.size)) alloc_arb.io.out.ready := Bool(true) trackerAcquireIOs.zip(alloc_arb.io.in).foreach { - case(tracker, arb) => - arb.valid := tracker.ready + case(tracker, arb) => arb.valid := tracker.ready } val alloc_idx = Vec(alloc_arb.io.in.map(_.ready)).lastIndexWhere{b: Bool => b}