1
0

tilelink2: add an IdentityNode for adapters that change nothing

This commit is contained in:
Wesley W. Terpstra 2016-08-31 15:47:07 -07:00
parent 9cd2991fb3
commit 50f0dee69e
2 changed files with 5 additions and 3 deletions

View File

@ -72,15 +72,16 @@ class BaseNode[PO, PI, EO, EI, B <: Bundle](imp: NodeImp[PO, PI, EO, EI, B])(
} }
} }
class OutputNode[PO, PI, EO, EI, B <: Bundle](imp: NodeImp[PO, PI, EO, EI, B]) class IdentityNode[PO, PI, EO, EI, B <: Bundle](imp: NodeImp[PO, PI, EO, EI, B])
extends BaseNode(imp)(Some{case Seq(x) => x}, Some{case Seq(x) => x}, 1 to 1, 1 to 1) extends BaseNode(imp)(Some{case Seq(x) => x}, Some{case Seq(x) => x}, 1 to 1, 1 to 1)
class OutputNode[PO, PI, EO, EI, B <: Bundle](imp: NodeImp[PO, PI, EO, EI, B]) extends IdentityNode(imp)
{ {
override def connectOut = bundleOut override def connectOut = bundleOut
override def connectIn = bundleOut override def connectIn = bundleOut
} }
class InputNode[PO, PI, EO, EI, B <: Bundle](imp: NodeImp[PO, PI, EO, EI, B]) class InputNode[PO, PI, EO, EI, B <: Bundle](imp: NodeImp[PO, PI, EO, EI, B]) extends IdentityNode(imp)
extends BaseNode(imp)(Some{case Seq(x) => x}, Some{case Seq(x) => x}, 1 to 1, 1 to 1)
{ {
override def connectOut = bundleIn override def connectOut = bundleIn
override def connectIn = bundleIn override def connectIn = bundleIn

View File

@ -29,6 +29,7 @@ object TLImp extends NodeImp[TLClientPortParameters, TLManagerPortParameters, TL
} }
} }
case class TLIdentityNode() extends IdentityNode(TLImp)
case class TLOutputNode() extends OutputNode(TLImp) case class TLOutputNode() extends OutputNode(TLImp)
case class TLInputNode() extends InputNode(TLImp) case class TLInputNode() extends InputNode(TLImp)