diplomacy: use HeterogeneousBag instead of Vec
This makes it possible for the bundles to have different widths. Previously, we had to widen all the bundles passing through a node to the widest of all the possibilities. This would mean that if you had two source[] fields, they end up the same.
This commit is contained in:
@ -53,14 +53,8 @@ object IntImp extends NodeImp[IntSourcePortParameters, IntSinkPortParameters, In
|
||||
{
|
||||
def edgeO(pd: IntSourcePortParameters, pu: IntSinkPortParameters): IntEdge = IntEdge(pd, pu)
|
||||
def edgeI(pd: IntSourcePortParameters, pu: IntSinkPortParameters): IntEdge = IntEdge(pd, pu)
|
||||
def bundleO(eo: Seq[IntEdge]): Vec[Vec[Bool]] = {
|
||||
if (eo.isEmpty) Vec(0, Vec(0, Bool())) else
|
||||
Vec(eo.size, Vec(eo.map(_.source.num).max, Bool()))
|
||||
}
|
||||
def bundleI(ei: Seq[IntEdge]): Vec[Vec[Bool]] = {
|
||||
if (ei.isEmpty) Vec(0, Vec(0, Bool())) else
|
||||
Vec(ei.size, Vec(ei.map(_.source.num).max, Bool()))
|
||||
}
|
||||
def bundleO(eo: IntEdge): Vec[Bool] = Vec(eo.source.num, Bool())
|
||||
def bundleI(ei: IntEdge): Vec[Bool] = Vec(ei.source.num, Bool())
|
||||
|
||||
def colour = "#0000ff" // blue
|
||||
override def labelI(ei: IntEdge) = ei.source.sources.map(_.range.size).sum.toString
|
||||
|
Reference in New Issue
Block a user