TLBuffer: Create a wrapper module for TLBufferChain, to allow for more stable naming
This commit is contained in:
committed by
Wesley W. Terpstra
parent
94f06dc85c
commit
667d966410
@ -67,17 +67,10 @@ abstract class TLBusWrapper(params: TLBusParams, val busName: String)(implicit p
|
||||
protected def inwardNode: TLInwardNode = xbar.node
|
||||
protected def inwardBufNode: TLInwardNode = master_buffer.node
|
||||
|
||||
protected def bufferChain(depth: Int, params: BufferParams = BufferParams.default, name: Option[String] = None): (TLInwardNode, TLOutwardNode) = {
|
||||
if (depth > 0) {
|
||||
val chain = List.fill(depth)(LazyModule(new TLBuffer(params)))
|
||||
name.foreach { n => chain.zipWithIndex foreach { case(b, i) => b.suggestName(s"${busName}_${n}_${i}_TLBuffer") } }
|
||||
(chain.init zip chain.tail) foreach { case(prev, next) => next.node :=* prev.node }
|
||||
(chain.head.node, chain.last.node)
|
||||
} else {
|
||||
val dummy = LazyModule(new TLBuffer(BufferParams.none))
|
||||
name.foreach { n => dummy.suggestName(s"${busName}_${n}_empty_TLBuffer")}
|
||||
(dummy.node, dummy.node)
|
||||
}
|
||||
protected def bufferChain(depth: Int, name: Option[String] = None): (TLInwardNode, TLOutwardNode) = {
|
||||
val chain = LazyModule(new TLBufferChain(depth))
|
||||
name.foreach { n => chain.suggestName(s"${busName}_${n}_TLBufferChain")}
|
||||
(chain.nodeIn, chain.nodeOut)
|
||||
}
|
||||
|
||||
def bufferFromMasters: TLInwardNode = inwardBufNode
|
||||
|
Reference in New Issue
Block a user