summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/AutoClonetypeSpec.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/AutoClonetypeSpec.scala b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
index 75fb46b8..e533eb94 100644
--- a/src/test/scala/chiselTests/AutoClonetypeSpec.scala
+++ b/src/test/scala/chiselTests/AutoClonetypeSpec.scala
@@ -172,4 +172,29 @@ class AutoClonetypeSpec extends ChiselFlatSpec {
val a = WireDefault(io)
} }
}
+
+ "Aliased fields" should "be caught" in {
+ a [ChiselException] should be thrownBy {
+ elaborate { new Module {
+ val bundleFieldType = UInt(8.W)
+ val io = IO(Output(new Bundle {
+ val a = bundleFieldType
+ }))
+ io.a := 0.U
+ } }
+ }
+ }
+
+ "Aliased fields from inadequate autoclonetype" should "be caught" in {
+ a [ChiselException] should be thrownBy {
+ class BadBundle(val typeTuple: (Data, Int)) extends Bundle {
+ val a = typeTuple._1
+ }
+
+ elaborate { new Module {
+ val io = IO(Output(new BadBundle(UInt(8.W), 1)))
+ io.a := 0.U
+ } }
+ }
+ }
}