diplomacy: support zero-port Nodes
This commit is contained in:
@ -11,14 +11,9 @@ object APBImp extends NodeImp[APBMasterPortParameters, APBSlavePortParameters, A
|
||||
{
|
||||
def edgeO(pd: APBMasterPortParameters, pu: APBSlavePortParameters): APBEdgeParameters = APBEdgeParameters(pd, pu)
|
||||
def edgeI(pd: APBMasterPortParameters, pu: APBSlavePortParameters): APBEdgeParameters = APBEdgeParameters(pd, pu)
|
||||
def bundleO(eo: Seq[APBEdgeParameters]): Vec[APBBundle] = {
|
||||
require (!eo.isEmpty)
|
||||
Vec(eo.size, APBBundle(eo.map(_.bundle).reduce(_.union(_))))
|
||||
}
|
||||
def bundleI(ei: Seq[APBEdgeParameters]): Vec[APBBundle] = {
|
||||
require (!ei.isEmpty)
|
||||
Vec(ei.size, APBBundle(ei.map(_.bundle).reduce(_.union(_))))
|
||||
}
|
||||
|
||||
def bundleO(eo: Seq[APBEdgeParameters]): Vec[APBBundle] = Vec(eo.size, APBBundle(APBBundleParameters.union(eo.map(_.bundle))))
|
||||
def bundleI(ei: Seq[APBEdgeParameters]): Vec[APBBundle] = Vec(ei.size, APBBundle(APBBundleParameters.union(ei.map(_.bundle))))
|
||||
|
||||
def colour = "#00ccff" // bluish
|
||||
override def labelI(ei: APBEdgeParameters) = (ei.slave.beatBytes * 8).toString
|
||||
|
@ -72,6 +72,9 @@ case class APBBundleParameters(
|
||||
|
||||
object APBBundleParameters
|
||||
{
|
||||
val emptyBundleParams = APBBundleParameters(addrBits = 1, dataBits = 8)
|
||||
def union(x: Seq[APBBundleParameters]) = x.foldLeft(emptyBundleParams)((x,y) => x.union(y))
|
||||
|
||||
def apply(master: APBMasterPortParameters, slave: APBSlavePortParameters) =
|
||||
new APBBundleParameters(
|
||||
addrBits = log2Up(slave.maxAddress+1),
|
||||
|
Reference in New Issue
Block a user