From 095fd80cc1250f5ec242fde6ccc9271665f784b2 Mon Sep 17 00:00:00 2001 From: Jim Lawson Date: Tue, 4 Oct 2016 11:46:13 -0700 Subject: Add CompileOptions implicits to all Module constructors - fix #310. (#311) --- .../chiselTests/ModuleExplicitResetSpec.scala | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/test/scala/chiselTests/ModuleExplicitResetSpec.scala (limited to 'src/test/scala/chiselTests/ModuleExplicitResetSpec.scala') diff --git a/src/test/scala/chiselTests/ModuleExplicitResetSpec.scala b/src/test/scala/chiselTests/ModuleExplicitResetSpec.scala new file mode 100644 index 00000000..f8206b9c --- /dev/null +++ b/src/test/scala/chiselTests/ModuleExplicitResetSpec.scala @@ -0,0 +1,38 @@ +// See LICENSE for license details. + +package chiselTests + +class ModuleExplicitResetSpec extends ChiselFlatSpec { + + "A Module with an explicit reset in compatibility mode" should "elaborate" in { + import Chisel._ + val myReset = Bool(true) + class ModuleExplicitReset(reset: Bool) extends Module(_reset = reset) { + val io = new Bundle { + val done = Bool(OUTPUT) + } + + io.done := Bool(false) + } + + elaborate { + new ModuleExplicitReset(myReset) + } + } + + "A Module with an explicit reset in non-compatibility mode" should "elaborate" in { + import chisel3._ + val myReset = Bool(true) + class ModuleExplicitReset(reset: Bool) extends Module(_reset = reset) { + val io = IO(new Bundle { + val done = Bool(OUTPUT) + }) + + io.done := Bool(false) + } + + elaborate { + new ModuleExplicitReset(myReset) + } + } +} -- cgit v1.2.3