summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/core/Module.scala
diff options
context:
space:
mode:
authorJack Koenig2017-12-20 15:54:25 -0800
committerGitHub2017-12-20 15:54:25 -0800
commite27657118ff5915b96f8e3a467d464245fe09769 (patch)
tree2353d94bc70fa006639bf5019bde366b15e82b29 /chiselFrontend/src/main/scala/chisel3/core/Module.scala
parent0f5ba51572b22ff5c85f9dd1add82680e0620797 (diff)
Add compileOptions to Module.apply, use for invalidating submod ports (#747)
Fixes #746 Also add test for https://github.com/freechipsproject/firrtl/issues/705
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Module.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Module.scala8
1 files changed, 5 insertions, 3 deletions
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