diff options
| author | Jim Lawson | 2017-04-04 09:33:38 -0700 |
|---|---|---|
| committer | GitHub | 2017-04-04 09:33:38 -0700 |
| commit | 0a36785778fb031dd01d82af3763bee997bf895f (patch) | |
| tree | 9cbe98df389c38dabd16419faa7c161a6f4604cd /src/test/scala/chiselTests/CompileOptionsTest.scala | |
| parent | bc05b7dadbd875c5a1ffb1448c36fcdb429386ab (diff) | |
Define CompileOptions case class to support CompileOptions manipulation. (#572)
Make it relatively easy to override a single CompileOption.
Diffstat (limited to 'src/test/scala/chiselTests/CompileOptionsTest.scala')
| -rw-r--r-- | src/test/scala/chiselTests/CompileOptionsTest.scala | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/src/test/scala/chiselTests/CompileOptionsTest.scala b/src/test/scala/chiselTests/CompileOptionsTest.scala index cc0a966c..63e6b9d1 100644 --- a/src/test/scala/chiselTests/CompileOptionsTest.scala +++ b/src/test/scala/chiselTests/CompileOptionsTest.scala @@ -16,15 +16,7 @@ class CompileOptionsSpec extends ChiselFlatSpec { // 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 CompileOptions { - val connectFieldsMustMatch = true - val declaredTypeMustBeUnbound = true - val requireIOWrap = false - val dontTryConnectionsSwapped = true - val dontAssumeDirectionality = true - val deprecateOldDirectionMethods = true - val checkSynthesizable = true - } + val strictWithoutIOWrapVal = chisel3.core.ExplicitCompileOptions.Strict.copy(requireIOWrap = false) class SmallBundle extends Bundle { val f1 = UInt(4.W) @@ -214,7 +206,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 + implicit val strictWithoutIOWrap = strictWithoutIOWrapVal class RequireIOWrapModule extends StrictModule { val io = IO(new Bundle { val in = UInt(32.W).asInput @@ -228,7 +220,7 @@ class CompileOptionsSpec extends ChiselFlatSpec { } "A Module with unwrapped IO when compiled with explicit NotStrict.CompileOption " should "not throw an exception" in { - implicit val strictWithoutIOWrap = StrictWithoutIOWrap + implicit val strictWithoutIOWrap = strictWithoutIOWrapVal class RequireIOWrapModule extends NotStrictModule { val io = new Bundle { val in = UInt(32.W).asInput @@ -243,7 +235,7 @@ class CompileOptionsSpec extends ChiselFlatSpec { "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 + implicit val strictWithoutIOWrap = strictWithoutIOWrapVal class RequireIOWrapModule extends StrictModule { val io = new Bundle { val in = UInt(32.W).asInput @@ -259,20 +251,9 @@ class CompileOptionsSpec extends ChiselFlatSpec { "A Module with unwrapped IO when compiled with an explicit requireIOWrap false " should "not throw an exception" in { - object StrictNotIOWrap { - - implicit object CompileOptions extends CompileOptions { - val connectFieldsMustMatch = true - val declaredTypeMustBeUnbound = true - val requireIOWrap = false - val dontTryConnectionsSwapped = true - val dontAssumeDirectionality = true - val deprecateOldDirectionMethods = false - val checkSynthesizable = true - } + val strictNotIOWrap = chisel3.core.ExplicitCompileOptions.Strict.copy(requireIOWrap = false, deprecateOldDirectionMethods = false) - } - class NotIOWrapModule extends Module()(StrictNotIOWrap.CompileOptions) { + class NotIOWrapModule extends Module()(strictNotIOWrap) { val io = new Bundle { val in = UInt(32.W).asInput val out = Bool().asOutput |
