diff options
| author | Jim Lawson | 2016-09-01 10:21:57 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-09-01 13:08:44 -0700 |
| commit | 4b88a5dd45337fa88178fe17324eef3661daf1b3 (patch) | |
| tree | 225f34b9f0093b0f59bb66edacbb4cc2341a6d0b /src/test/scala/chiselTests/CompileOptionsTest.scala | |
| parent | 4e7e1c2b30bfa06f167b04aae4ef6944794323a9 (diff) | |
Move connection implicits from Module constructor to connection methods.
Eliminate builder compileOptions.
Diffstat (limited to 'src/test/scala/chiselTests/CompileOptionsTest.scala')
| -rw-r--r-- | src/test/scala/chiselTests/CompileOptionsTest.scala | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/test/scala/chiselTests/CompileOptionsTest.scala b/src/test/scala/chiselTests/CompileOptionsTest.scala index 70843c3e..f835ab0d 100644 --- a/src/test/scala/chiselTests/CompileOptionsTest.scala +++ b/src/test/scala/chiselTests/CompileOptionsTest.scala @@ -13,6 +13,16 @@ class CompileOptionsSpec extends ChiselFlatSpec { abstract class StrictModule extends Module()(chisel3.Strict.CompileOptions) abstract class NotStrictModule extends Module()(chisel3.NotStrict.CompileOptions) + // Generate a set of options that do not have requireIOWrap enabled, in order to + // ensure its definition comes from the implicit options passed to the Module constructor. + object StrictWithoutIOWrap extends ExplicitCompileOptions { + val connectFieldsMustMatch = true + val declaredTypeMustBeUnbound = true + val requireIOWrap = false + val dontTryConnectionsSwapped = true + val dontAssumeDirectionality = true + } + class SmallBundle extends Bundle { val f1 = UInt(width = 4) val f2 = UInt(width = 5) @@ -199,7 +209,7 @@ class CompileOptionsSpec extends ChiselFlatSpec { } "A Module with wrapped IO when compiled with explicit Strict.CompileOption " should "not throw an exception" in { - + implicit val strictWithoutIOWrap = StrictWithoutIOWrap class RequireIOWrapModule extends StrictModule { val io = IO(new Bundle { val in = UInt(width = 32).asInput @@ -207,11 +217,13 @@ class CompileOptionsSpec extends ChiselFlatSpec { }) io.out := io.in(1) } - elaborate { new RequireIOWrapModule() } + elaborate { + new RequireIOWrapModule() + } } "A Module with unwrapped IO when compiled with explicit NotStrict.CompileOption " should "not throw an exception" in { - + implicit val strictWithoutIOWrap = StrictWithoutIOWrap class RequireIOWrapModule extends NotStrictModule { val io = new Bundle { val in = UInt(width = 32).asInput @@ -219,12 +231,14 @@ class CompileOptionsSpec extends ChiselFlatSpec { } io.out := io.in(1) } - elaborate { new RequireIOWrapModule() } + elaborate { + new RequireIOWrapModule() + } } "A Module with unwrapped IO when compiled with explicit Strict.CompileOption " should "throw an exception" in { a [BindingException] should be thrownBy { - + implicit val strictWithoutIOWrap = StrictWithoutIOWrap class RequireIOWrapModule extends StrictModule { val io = new Bundle { val in = UInt(width = 32).asInput @@ -256,7 +270,6 @@ class CompileOptionsSpec extends ChiselFlatSpec { val in = UInt(width = 32).asInput val out = Bool().asOutput } - io.out := io.in(1) } elaborate { new NotIOWrapModule() |
