summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Lin2018-02-07 12:04:09 -0800
committerGitHub2018-02-07 12:04:09 -0800
commit7be9b1c681558695b95fccb22a60c34101c86118 (patch)
treeeb0eaef935b55ace66ae49bdce0b3428fcc09c5c /src
parent1bfca502c69a26edca86d716a1ca9d24e6789e59 (diff)
Better support for autoclonetype of nested Bundles (#769)
* Better support for autoclonetype of nested Bundles * Move bundleStack to dynamicContext * prefer $outer if available, make guesses distinct * Catch IllegalAccessException in autoclonetype In strange circumstances this type of exception can occur when accessing $outer
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/AutoNestedCloneSpec.scala14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/test/scala/chiselTests/AutoNestedCloneSpec.scala b/src/test/scala/chiselTests/AutoNestedCloneSpec.scala
index 746780be..236de101 100644
--- a/src/test/scala/chiselTests/AutoNestedCloneSpec.scala
+++ b/src/test/scala/chiselTests/AutoNestedCloneSpec.scala
@@ -89,6 +89,19 @@ class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers {
}
}
+ it should "clone a double-nested anonymous Bundle" in {
+ elaborate {
+ class TestModule() extends Module {
+ val io = IO(new Bundle {
+ val inner = Input(new Bundle {
+ val x = UInt(8.W)
+ })
+ })
+ }
+ new TestModule()
+ }
+ }
+
behavior of "anonymous doubly-nested inner bundle fails with clear error"
( the[ChiselException] thrownBy {
elaborate {
@@ -104,5 +117,4 @@ class AutoNestedCloneSpec extends ChiselFlatSpec with Matchers {
new Outer(2)
}
}).getMessage should include("Unable to determine instance")
-
}