summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3
diff options
context:
space:
mode:
authorJack Koenig2021-01-21 11:41:20 -0800
committerJack Koenig2021-01-21 15:57:10 -0800
commit6c6ec7161e8f046fff1cfc68a468ce2f053fdb7f (patch)
treedebd31d50abb936b12213ec40d752e8cc18067ad /core/src/main/scala/chisel3
parent8a73362bb6fe87817a1867cc2482c1841f95c077 (diff)
Fold Chisel.CompatibilityModule into chisel3.internal.LegacyModule
Diffstat (limited to 'core/src/main/scala/chisel3')
-rw-r--r--core/src/main/scala/chisel3/RawModule.scala17
1 files changed, 15 insertions, 2 deletions
diff --git a/core/src/main/scala/chisel3/RawModule.scala b/core/src/main/scala/chisel3/RawModule.scala
index ac6a2d1f..a686fd7e 100644
--- a/core/src/main/scala/chisel3/RawModule.scala
+++ b/core/src/main/scala/chisel3/RawModule.scala
@@ -197,10 +197,23 @@ package object internal {
/** Legacy Module class that restricts IOs to just io, clock, and reset, and provides a constructor
* for threading through explicit clock and reset.
*
- * This is only intended as a bridge from chisel3 to Chisel.Module, do not extend this in user
- * code, use [[Module]]
+ * '''Do not use this class in user code'''. Use whichever `Module` is imported by your wildcard
+ * import (preferably `import chisel3._`).
*/
abstract class LegacyModule(implicit moduleCompileOptions: CompileOptions) extends Module {
+ // Provide a non-deprecated constructor
+ def this(override_clock: Option[Clock]=None, override_reset: Option[Bool]=None)
+ (implicit moduleCompileOptions: CompileOptions) = {
+ this()
+ this.override_clock = override_clock
+ this.override_reset = override_reset
+ }
+ def this(_clock: Clock)(implicit moduleCompileOptions: CompileOptions) =
+ this(Option(_clock), None)(moduleCompileOptions)
+ def this(_reset: Bool)(implicit moduleCompileOptions: CompileOptions) =
+ this(None, Option(_reset))(moduleCompileOptions)
+ def this(_clock: Clock, _reset: Bool)(implicit moduleCompileOptions: CompileOptions) =
+ this(Option(_clock), Option(_reset))(moduleCompileOptions)
private lazy val _io: Record = reflectivelyFindValIO(this)