diplomacy: remove node arity and allow empty Nexus nodes (Xbars)
This removes the mostly obsolete 'numIn/Out' range restrictions on nodes. It also makes it possible to connect optional crossbars that disappear. val x = TLXbar() x := master slave := x val y = TLXbar() x :=* y // only connect y if it gets used This will create crossbar x, but crossbar y will disappear.
This commit is contained in:
@ -37,14 +37,21 @@ class TLBusBypass(beatBytes: Int)(implicit p: Parameters) extends TLBusBypassBas
|
||||
}
|
||||
}
|
||||
|
||||
class TLBypassNode(implicit valName: ValName) extends TLCustomNode
|
||||
{
|
||||
def resolveStar(iKnown: Int, oKnown: Int, iStars: Int, oStars: Int): (Int, Int) = {
|
||||
require (iStars == 0 && oStars == 0, "TLBypass node does not support :=* or :*=")
|
||||
require (iKnown == 1, "TLBypass node expects exactly one input")
|
||||
require (oKnown == 2, "TLBypass node expects exactly one output")
|
||||
(0, 0)
|
||||
}
|
||||
def mapParamsD(n: Int, p: Seq[TLClientPortParameters]): Seq[TLClientPortParameters] = { p ++ p }
|
||||
def mapParamsU(n: Int, p: Seq[TLManagerPortParameters]): Seq[TLManagerPortParameters] = { p.tail }
|
||||
}
|
||||
|
||||
class TLBusBypassBar(implicit p: Parameters) extends LazyModule
|
||||
{
|
||||
// The client only sees the second slave port
|
||||
val node = TLNexusNode(
|
||||
numClientPorts = 2 to 2 ,
|
||||
numManagerPorts = 1 to 1,
|
||||
clientFn = { seq => seq(0) },
|
||||
managerFn = { seq => seq(1) })
|
||||
val node = new TLBypassNode()
|
||||
|
||||
lazy val module = new LazyModuleImp(this) {
|
||||
val io = IO(new Bundle {
|
||||
|
Reference in New Issue
Block a user