diff options
| author | Jack Koenig | 2021-06-29 15:34:18 -0700 |
|---|---|---|
| committer | Jack Koenig | 2021-06-29 15:34:18 -0700 |
| commit | 0531cb53d3cedaff33c2a280e34418f6af5bc6a1 (patch) | |
| tree | 90ef041e872393b2cc8e23aad408d3fc0bc202a0 /core/src/main/scala/chisel3/Module.scala | |
| parent | 8724cd542df2e907069d9ee3fd7d1675a9ca9287 (diff) | |
Restore aop.Select behavior for CloneModuleAsRecord
Diffstat (limited to 'core/src/main/scala/chisel3/Module.scala')
| -rw-r--r-- | core/src/main/scala/chisel3/Module.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/main/scala/chisel3/Module.scala b/core/src/main/scala/chisel3/Module.scala index 8a914fbc..f82b6a7b 100644 --- a/core/src/main/scala/chisel3/Module.scala +++ b/core/src/main/scala/chisel3/Module.scala @@ -184,12 +184,14 @@ package internal { object BaseModule { // Private internal class to serve as a _parent for Data in cloned ports - private[chisel3] class ModuleClone(_proto: BaseModule) extends BaseModule { + private[chisel3] class ModuleClone(private[chisel3] val _proto: BaseModule) extends BaseModule { // ClonePorts that hold the bound ports for this module // Used for setting the refs of both this module and the Record private[BaseModule] var _portsRecord: Record = _ // Don't generate a component, but point to the one for the cloned Module private[chisel3] def generateComponent(): Option[Component] = { + require(!_closed, "Can't generate module more than once") + _closed = true _component = _proto._component None } |
