diff options
| author | Richard Lin | 2017-07-28 14:22:57 -0700 |
|---|---|---|
| committer | Adam Izraelevitz | 2017-07-28 14:22:57 -0700 |
| commit | 2666b809a8964a3ec396714c36bd54469e943516 (patch) | |
| tree | de85152968989c22045274135a636b06e3d83731 /src | |
| parent | 91f20ccbe1dc1d6dccd06247e39e6bc607517e32 (diff) | |
Add rebinding test (#654)
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/scala/chiselTests/RebindingSpec.scala | 27 |
1 files changed, 27 insertions, 0 deletions
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)) + }) + } } + } + } +} |
