From 5854fb5f7cbb9e678f202c6eddb67a9737339f9d Mon Sep 17 00:00:00 2001 From: "Wesley W. Terpstra" Date: Wed, 17 Jan 2018 18:02:19 -0800 Subject: [PATCH] SourceShrinker improvements (#1197) * SourceShrinker: preserve FIFO guarantees of slaves * tilelink: document that Releases can use TtoT, BtoB, and NtoN TtoT is needed for write-through caches. --- src/main/scala/tilelink/Bundles.scala | 2 +- src/main/scala/tilelink/SourceShrinker.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/tilelink/Bundles.scala b/src/main/scala/tilelink/Bundles.scala index 118b01e5..0e3e0696 100644 --- a/src/main/scala/tilelink/Bundles.scala +++ b/src/main/scala/tilelink/Bundles.scala @@ -76,7 +76,7 @@ object TLPermissions def BtoN = UInt(2, cWidth) def isShrink(x: UInt) = x <= BtoN - // Report types (ProbeAck) + // Report types (ProbeAck, Release) def TtoT = UInt(3, cWidth) def BtoB = UInt(4, cWidth) def NtoN = UInt(5, cWidth) diff --git a/src/main/scala/tilelink/SourceShrinker.scala b/src/main/scala/tilelink/SourceShrinker.scala index 380c8eaa..c438470d 100644 --- a/src/main/scala/tilelink/SourceShrinker.scala +++ b/src/main/scala/tilelink/SourceShrinker.scala @@ -18,8 +18,8 @@ class TLSourceShrinker(maxInFlight: Int)(implicit p: Parameters) extends LazyMod sourceId = IdRange(0, maxInFlight)) val node = TLAdapterNode( // We erase all client information since we crush the source Ids - clientFn = { _ => TLClientPortParameters(clients = Seq(client)) }, - managerFn = { mp => mp.copy(managers = mp.managers.map(_.copy(fifoId = None))) }) + clientFn = { cp => TLClientPortParameters(clients = Seq(client.copy(requestFifo = cp.clients.exists(_.requestFifo)))) }, + managerFn = { mp => mp.copy(managers = mp.managers.map(m => m.copy(fifoId = if (maxInFlight==1) Some(0) else m.fifoId))) }) lazy val module = new LazyModuleImp(this) { (node.in zip node.out) foreach { case ((in, edgeIn), (out, edgeOut)) =>