TLBuffer: Add a nodedebugstring for quick browsing of the properties of the buffer.
This commit is contained in:
parent
bdaae40035
commit
a62ce0afe6
@ -279,6 +279,9 @@ case class BufferParams(depth: Int, flow: Boolean, pipe: Boolean)
|
|||||||
sq.io.enq <> x
|
sq.io.enq <> x
|
||||||
sq.io.deq
|
sq.io.deq
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override def toString() = "BufferParams:%d%s%s".format(depth, if (flow) "F" else "", if (pipe) "P" else "")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object BufferParams
|
object BufferParams
|
||||||
|
@ -8,6 +8,19 @@ import freechips.rocketchip.config.Parameters
|
|||||||
import freechips.rocketchip.diplomacy._
|
import freechips.rocketchip.diplomacy._
|
||||||
import scala.math.{min,max}
|
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(
|
class TLBuffer(
|
||||||
a: BufferParams,
|
a: BufferParams,
|
||||||
b: BufferParams,
|
b: BufferParams,
|
||||||
@ -19,9 +32,7 @@ class TLBuffer(
|
|||||||
def this(abcde: BufferParams)(implicit p: Parameters) = this(abcde, abcde)
|
def this(abcde: BufferParams)(implicit p: Parameters) = this(abcde, abcde)
|
||||||
def this()(implicit p: Parameters) = this(BufferParams.default)
|
def this()(implicit p: Parameters) = this(BufferParams.default)
|
||||||
|
|
||||||
val node = TLAdapterNode(
|
val node = new TLBufferNode(a, b, c, d, e)
|
||||||
clientFn = { p => p.copy(minLatency = p.minLatency + b.latency + c.latency) },
|
|
||||||
managerFn = { p => p.copy(minLatency = p.minLatency + a.latency + d.latency) })
|
|
||||||
|
|
||||||
lazy val module = new LazyModuleImp(this) {
|
lazy val module = new LazyModuleImp(this) {
|
||||||
val io = new Bundle {
|
val io = new Bundle {
|
||||||
|
Loading…
Reference in New Issue
Block a user