From 9f77bf54543724594711f0455ef91f51edfbd22e Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Mon, 1 Apr 2019 14:00:55 -0700 Subject: Detect bundle aliasing (#1050) --- src/test/scala/chiselTests/BundleSpec.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/test/scala/chiselTests/BundleSpec.scala b/src/test/scala/chiselTests/BundleSpec.scala index 4fc7d7d0..d30b64b3 100644 --- a/src/test/scala/chiselTests/BundleSpec.scala +++ b/src/test/scala/chiselTests/BundleSpec.scala @@ -115,4 +115,17 @@ class BundleSpec extends ChiselFlatSpec with BundleSpecUtils { } } } + + "Bundles" should "not have aliased fields" in { + (the[ChiselException] thrownBy { + elaborate { new Module { + val io = IO(Output(new Bundle { + val a = UInt(8.W) + val b = a + })) + io.a := 0.U + io.b := 1.U + } } + }).getMessage should include("aliased fields") + } } -- cgit v1.2.3