From e27657118ff5915b96f8e3a467d464245fe09769 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Wed, 20 Dec 2017 15:54:25 -0800 Subject: Add compileOptions to Module.apply, use for invalidating submod ports (#747) Fixes #746 Also add test for https://github.com/freechipsproject/firrtl/issues/705 --- chiselFrontend/src/main/scala/chisel3/core/Module.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'chiselFrontend/src/main/scala/chisel3/core/Module.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Module.scala b/chiselFrontend/src/main/scala/chisel3/core/Module.scala index 0e919d3c..fa9ab082 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Module.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Module.scala @@ -23,7 +23,9 @@ object Module { */ def apply[T <: BaseModule](bc: => T): T = macro InstTransform.apply[T] - def do_apply[T <: BaseModule](bc: => T)(implicit sourceInfo: SourceInfo): T = { + def do_apply[T <: BaseModule](bc: => T) + (implicit sourceInfo: SourceInfo, + compileOptions: CompileOptions): T = { if (Builder.readyForModuleConstr) { throwException("Error: Called Module() twice without instantiating a Module." + sourceInfo.makeMessage(" See " + _)) @@ -62,7 +64,7 @@ object Module { // Handle connections at enclosing scope if(!Builder.currentModule.isEmpty) { pushCommand(DefInstance(sourceInfo, module, component.ports)) - module.initializeInParent() + module.initializeInParent(compileOptions) } module } @@ -124,7 +126,7 @@ abstract class BaseModule extends HasId { /** Sets up this module in the parent context */ - private[core] def initializeInParent() + private[core] def initializeInParent(parentCompileOptions: CompileOptions): Unit // // Chisel Internals -- cgit v1.2.3