From 6c6ec7161e8f046fff1cfc68a468ce2f053fdb7f Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 21 Jan 2021 11:41:20 -0800 Subject: Fold Chisel.CompatibilityModule into chisel3.internal.LegacyModule --- core/src/main/scala/chisel3/RawModule.scala | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'core/src') 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) -- cgit v1.2.3