diff options
| author | Schuyler Eldridge | 2020-06-16 11:59:15 -0400 |
|---|---|---|
| committer | Schuyler Eldridge | 2020-06-22 20:00:10 -0400 |
| commit | 6e03f63d525aac0bdf4a59b6fe66a0b4d5a3a25a (patch) | |
| tree | 482481bcfe93ea5dfcece80772ce1957fb68c74c /src/test/scala/chiselTests/AutoNestedCloneSpec.scala | |
| parent | cc4fa583690292d690804144fe92427f0c9f5fdf (diff) | |
Use ChiselStage in Tests
This migrates the tests to Chisel 3.4/FIRRTL 1.4. This primarily
involves removing usages of deprecated methods including:
- Remove usages of Driver
- Use ChiselStage methods instead of BackendCompilationUtilities
methods
- Use Dependency API for custom transforms
- Use extractCause to unpack StackError
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src/test/scala/chiselTests/AutoNestedCloneSpec.scala')
| -rw-r--r-- | src/test/scala/chiselTests/AutoNestedCloneSpec.scala | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/test/scala/chiselTests/AutoNestedCloneSpec.scala b/src/test/scala/chiselTests/AutoNestedCloneSpec.scala index 743440bf..7dd0b070 100644 --- a/src/test/scala/chiselTests/AutoNestedCloneSpec.scala +++ b/src/test/scala/chiselTests/AutoNestedCloneSpec.scala @@ -4,6 +4,7 @@ package chiselTests import Chisel.ChiselException import org.scalatest._ import chisel3._ +import chisel3.stage.ChiselStage import org.scalatest.matchers.should.Matchers class BundleWithAnonymousInner(val w: Int) extends Bundle { @@ -12,11 +13,11 @@ class BundleWithAnonymousInner(val w: Int) extends Bundle { } } -class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers { +class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers with Utils { behavior of "autoCloneType of inner Bundle in Chisel3" it should "clone a doubly-nested inner bundle successfully" in { - elaborate { + ChiselStage.elaborate { class Outer(val w: Int) extends Module { class Middle(val w: Int) { class InnerIOType extends Bundle { @@ -32,7 +33,7 @@ class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers { } it should "clone an anonymous inner bundle successfully" in { - elaborate { + ChiselStage.elaborate { class TestTop(val w: Int) extends Module { val io = IO(new Bundle {}) val myWire = Wire(new Bundle{ val a = UInt(w.W) }) @@ -42,7 +43,7 @@ class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers { } it should "pick the correct $outer instance for an anonymous inner bundle" in { - elaborate { + ChiselStage.elaborate { class Inner(val w: Int) extends Module { val io = IO(new Bundle{ val in = Input(UInt(w.W)) @@ -64,7 +65,7 @@ class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers { } it should "clone an anonymous, bound, inner bundle of another bundle successfully" in { - elaborate { + ChiselStage.elaborate { class TestModule(w: Int) extends Module { val io = IO(new BundleWithAnonymousInner(w) ) val w0 = WireDefault(io) @@ -75,7 +76,7 @@ class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers { } it should "clone an anonymous, inner bundle of a Module, bound to another bundle successfully" in { - elaborate { + ChiselStage.elaborate { class TestModule(w: Int) extends Module { val bun = new Bundle { val foo = UInt(w.W) @@ -91,7 +92,7 @@ class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers { } it should "clone a double-nested anonymous Bundle" in { - elaborate { + ChiselStage.elaborate { class TestModule() extends Module { val io = IO(new Bundle { val inner = Input(new Bundle { @@ -105,7 +106,7 @@ class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers { // Test ignored because the compatibility null-inserting autoclonetype doesn't trip this ignore should "fail on anonymous doubly-nested inner bundle with clear error" in { - intercept[ChiselException] { elaborate { + intercept[ChiselException] { extractCause[ChiselException] { ChiselStage.elaborate { class Outer(val w: Int) extends Module { class Middle(val w: Int) { def getIO: Bundle = new Bundle { @@ -116,6 +117,6 @@ class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers { val myWire = Wire((new Middle(w)).getIO) } new Outer(2) - }}.getMessage should include("Unable to determine instance") + }}}.getMessage should include("Unable to determine instance") } } |
