From 9d2637c2c7f26a07292b9189bba01a8e4ce9a2e6 Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Thu, 7 Jan 2016 11:55:19 -0800 Subject: [PATCH] support empty submaps in interconnect generator --- junctions/src/main/scala/nasti.scala | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/junctions/src/main/scala/nasti.scala b/junctions/src/main/scala/nasti.scala index a8fb4586..428a0837 100644 --- a/junctions/src/main/scala/nasti.scala +++ b/junctions/src/main/scala/nasti.scala @@ -555,12 +555,17 @@ class NastiRecursiveInterconnect( io.slaves(slaveInd) <> xbarSlave slaveInd += 1 case MemSubmap(_, submap) => - val subSlaves = submap.countSlaves - val outputs = Vec(io.slaves.drop(slaveInd).take(subSlaves)) - val ic = Module(new NastiRecursiveInterconnect(1, subSlaves, submap, start)) - ic.io.masters.head <> xbarSlave - outputs <> ic.io.slaves - slaveInd += subSlaves + if (submap.isEmpty) { + val err_slave = Module(new NastiErrorSlave) + err_slave.io <> xbarSlave + } else { + val subSlaves = submap.countSlaves + val outputs = Vec(io.slaves.drop(slaveInd).take(subSlaves)) + val ic = Module(new NastiRecursiveInterconnect(1, subSlaves, submap, start)) + ic.io.masters.head <> xbarSlave + outputs <> ic.io.slaves + slaveInd += subSlaves + } case MemChannels(_, nchannels, _) => require(nchannels == 1, "Recursive interconnect cannot handle MultiChannel interface") io.slaves(slaveInd) <> xbarSlave