From a62ce0afe630b40b5631a49e71ff75869738adc9 Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Tue, 29 Aug 2017 10:36:46 -0700 Subject: [PATCH] TLBuffer: Add a nodedebugstring for quick browsing of the properties of the buffer. --- src/main/scala/diplomacy/Parameters.scala | 3 +++ src/main/scala/tilelink/Buffer.scala | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/scala/diplomacy/Parameters.scala b/src/main/scala/diplomacy/Parameters.scala index a16f70aa..f7273e6a 100644 --- a/src/main/scala/diplomacy/Parameters.scala +++ b/src/main/scala/diplomacy/Parameters.scala @@ -279,6 +279,9 @@ case class BufferParams(depth: Int, flow: Boolean, pipe: Boolean) sq.io.enq <> x sq.io.deq } + + override def toString() = "BufferParams:%d%s%s".format(depth, if (flow) "F" else "", if (pipe) "P" else "") + } object BufferParams diff --git a/src/main/scala/tilelink/Buffer.scala b/src/main/scala/tilelink/Buffer.scala index 9a741ab3..09b76b0a 100644 --- a/src/main/scala/tilelink/Buffer.scala +++ b/src/main/scala/tilelink/Buffer.scala @@ -8,6 +8,19 @@ import freechips.rocketchip.config.Parameters import freechips.rocketchip.diplomacy._ import scala.math.{min,max} +class TLBufferNode ( + a: BufferParams, + b: BufferParams, + c: BufferParams, + d: BufferParams, + e: BufferParams)(implicit p: Parameters) extends TLAdapterNode( + clientFn = { p => p.copy(minLatency = p.minLatency + b.latency + c.latency) }, + managerFn = { p => p.copy(minLatency = p.minLatency + a.latency + d.latency) } +) { + override lazy val nodedebugstring = s"a:${a.toString}, b:${b.toString}, c:${c.toString}, d:${d.toString}, e:${e.toString}" + +} + class TLBuffer( a: BufferParams, b: BufferParams, @@ -19,9 +32,7 @@ class TLBuffer( def this(abcde: BufferParams)(implicit p: Parameters) = this(abcde, abcde) def this()(implicit p: Parameters) = this(BufferParams.default) - val node = TLAdapterNode( - clientFn = { p => p.copy(minLatency = p.minLatency + b.latency + c.latency) }, - managerFn = { p => p.copy(minLatency = p.minLatency + a.latency + d.latency) }) + val node = new TLBufferNode(a, b, c, d, e) lazy val module = new LazyModuleImp(this) { val io = new Bundle {