diff options
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Module.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Module.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Module.scala b/chiselFrontend/src/main/scala/chisel3/core/Module.scala index ca391091..62b6d5ce 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Module.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Module.scala @@ -41,8 +41,16 @@ object Module { sourceInfo.makeMessage(" See " + _)) } Builder.currentModule = parent // Back to parent! + val ports = m.computePorts - val component = Component(m, m.name, ports, m._commands) + // Blackbox inherits from Module so we have to match on it first TODO fix + val component = m match { + case bb: BlackBox => + DefBlackBox(bb, bb.name, ports, bb.params) + case mod: Module => + mod._commands.prepend(DefInvalid(childSourceInfo, mod.io.ref)) // init module outputs + DefModule(mod, mod.name, ports, mod._commands) + } m._component = Some(component) Builder.components += component // Avoid referencing 'parent' in top module |
