1
0

coreplex: improve tile attachment adapters

This commit is contained in:
Henry Cook
2017-10-19 19:48:20 -07:00
committed by Wesley W. Terpstra
parent 2175758050
commit 95a2e6ef27
6 changed files with 60 additions and 71 deletions

View File

@ -73,15 +73,18 @@ object TLBuffer
}
}
class TLBufferChain(depth: Int)(implicit p: Parameters) extends LazyModule {
val buf_chain = List.fill(depth)(LazyModule(new TLBuffer(BufferParams.default)))
val node = if (depth > 0) {
(buf_chain.init zip buf_chain.tail) foreach { case (prev, next) => next.node :=? prev.node }
NodeHandle(buf_chain.head.node, buf_chain.last.node)
object TLNodeChain {
def apply(nodes: Seq[TLNode])(implicit p: Parameters): Option[TLNode] = if(nodes.size > 0) {
(nodes.init zip nodes.tail) foreach { case (prev, next) => next :=? prev }
Some(NodeHandle(nodes.head, nodes.last))
} else {
TLIdentityNode()
None
}
lazy val module = new LazyModuleImp(this) { }
}
class TLBufferChain(depth: Int)(implicit p: Parameters) extends SimpleLazyModule {
val buf_chain = List.fill(depth)(LazyModule(new TLBuffer(BufferParams.default)))
val node = TLNodeChain(buf_chain.map(_.node)).getOrElse(TLIdentityNode())
}
object TLBufferChain

View File

@ -9,6 +9,7 @@ package object tilelink
{
type TLInwardNode = InwardNodeHandle[TLClientPortParameters, TLManagerPortParameters, TLBundle]
type TLOutwardNode = OutwardNodeHandle[TLClientPortParameters, TLManagerPortParameters, TLBundle]
type TLNode = TLInwardNode with TLOutwardNode
type TLAsyncInwardNode = InwardNodeHandle[TLAsyncClientPortParameters, TLAsyncManagerPortParameters, TLAsyncBundle]
type TLAsyncOutwardNode = OutwardNodeHandle[TLAsyncClientPortParameters, TLAsyncManagerPortParameters, TLAsyncBundle]
type TLRationalInwardNode = InwardNodeHandle[TLRationalClientPortParameters, TLRationalManagerPortParameters, TLRationalBundle]