From e3efc09b5b8cba2f6b7f06dc199c27259ca0057a Mon Sep 17 00:00:00 2001 From: Henry Cook Date: Thu, 5 Nov 2015 17:20:03 -0800 Subject: [PATCH] remove unnecessary UInt encode/decode on releaseMatches path --- uncore/src/main/scala/cache.scala | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/uncore/src/main/scala/cache.scala b/uncore/src/main/scala/cache.scala index a71568b4..821495dc 100644 --- a/uncore/src/main/scala/cache.scala +++ b/uncore/src/main/scala/cache.scala @@ -304,6 +304,7 @@ class TSHRFile(implicit p: Parameters) extends L2HellaCacheModule()(p) // WritebackUnit evicts data from L2, including invalidating L1s val wb = Module(new L2WritebackUnit(nTransactors)) + val trackerAndWbIOs = trackerList.map(_.io) :+ wb.io doInternalOutputArbitration(wb.io.wb.req, trackerList.map(_.io.wb.req)) doInternalInputRouting(wb.io.wb.resp, trackerList.map(_.io.wb.resp)) @@ -329,15 +330,12 @@ class TSHRFile(implicit p: Parameters) extends L2HellaCacheModule()(p) "At most a single tracker should match for any given Acquire") // Wire releases from clients - val trackerReleaseIOs = trackerList.map(_.io.inner.release) :+ wb.io.inner.release - val releaseReadys = Vec(trackerReleaseIOs.map(_.ready)).toBits - val releaseMatches = Vec(trackerList.map(_.io.has_release_match) :+ wb.io.has_release_match).toBits - val release_idx = OHToUInt(releaseMatches) - io.inner.release.ready := releaseReadys(release_idx) - trackerReleaseIOs.zipWithIndex.foreach { - case(tracker, i) => - tracker.bits := io.inner.release.bits - tracker.valid := io.inner.release.valid && (release_idx === UInt(i)) + val releaseReadys = Vec(trackerAndWbIOs.map(_.inner.release.ready)).toBits + val releaseMatches = Vec(trackerAndWbIOs.map(_.has_release_match)).toBits + io.inner.release.ready := (releaseMatches & releaseReadys).orR + trackerAndWbIOs foreach { tracker => + tracker.inner.release.bits := io.inner.release.bits + tracker.inner.release.valid := io.inner.release.valid && tracker.has_release_match } assert(PopCount(releaseMatches) <= UInt(nReleaseTransactors), "At most a single tracker should match for any given Release")