1
0

TLSplitter: special-case the case of no split necessary

This commit is contained in:
Wesley W. Terpstra 2017-06-20 14:10:25 -07:00
parent 53f030c037
commit bb309e573f

View File

@ -42,7 +42,9 @@ class TLSplitter(policy: TLArbiter.Policy = TLArbiter.roundRobin)(implicit p: Pa
def group[T](x: Seq[T]) = def group[T](x: Seq[T]) =
if (x.isEmpty) Nil else x.grouped(node.edgesIn.size).toList.transpose if (x.isEmpty) Nil else x.grouped(node.edgesIn.size).toList.transpose
((node.edgesIn zip io.in) zip (group(node.edgesOut) zip group(io.out))) foreach { if (node.edgesIn.size <= 1) {
io.out <> io.in
} else ((node.edgesIn zip io.in) zip (group(node.edgesOut) zip group(io.out))) foreach {
case ((edgeIn, io_in), (edgesOut, io_out)) => case ((edgeIn, io_in), (edgesOut, io_out)) =>
// Grab the port ID mapping // Grab the port ID mapping