From 2666b809a8964a3ec396714c36bd54469e943516 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Fri, 28 Jul 2017 14:22:57 -0700 Subject: Add rebinding test (#654) --- src/test/scala/chiselTests/RebindingSpec.scala | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/test/scala/chiselTests/RebindingSpec.scala (limited to 'src') diff --git a/src/test/scala/chiselTests/RebindingSpec.scala b/src/test/scala/chiselTests/RebindingSpec.scala new file mode 100644 index 00000000..dddf26b6 --- /dev/null +++ b/src/test/scala/chiselTests/RebindingSpec.scala @@ -0,0 +1,27 @@ +// See LICENSE for license details. + +package chiselTests + +import chisel3._ + +class RebindingSpec extends ChiselFlatSpec { + "Rebinding a literal" should "fail" in { + a [chisel3.core.Binding.BindingException] should be thrownBy { + elaborate { new Module { + val io = IO(new Bundle { + val a = 4.U + }) + } } + } + } + + "Rebinding a hardware type" should "fail" in { + a [chisel3.core.Binding.BindingException] should be thrownBy { + elaborate { new Module { + val io = IO(new Bundle { + val a = Reg(UInt(32.W)) + }) + } } + } + } +} -- cgit v1.2.3