diff options
| author | Jim Lawson | 2016-10-04 11:02:14 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-10-04 11:02:14 -0700 |
| commit | 1abe52da025c3935c28d0280abbadf40021d5b3f (patch) | |
| tree | 97d86eb49f609730b4a1ab8211501a337231a461 /src/test/scala/chiselTests | |
| parent | db25e8180a53fb8f4912fd37b7a613e15a01564f (diff) | |
Generate a better error message for missing IO() wrapper - fix #305
Diffstat (limited to 'src/test/scala/chiselTests')
| -rw-r--r-- | src/test/scala/chiselTests/IOCompatibility.scala | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/test/scala/chiselTests/IOCompatibility.scala b/src/test/scala/chiselTests/IOCompatibility.scala index 7bf3dded..552fe776 100644 --- a/src/test/scala/chiselTests/IOCompatibility.scala +++ b/src/test/scala/chiselTests/IOCompatibility.scala @@ -3,6 +3,8 @@ package chiselTests import chisel3._ +import chisel3.core.Binding.BindingException +import org.scalatest._ class IOCSimpleIO extends Bundle { val in = Input(UInt(width=32)) @@ -33,7 +35,7 @@ class IOCModuleWire extends Module { io.out := inc.out } -class IOCompatibilitySpec extends ChiselPropSpec { +class IOCompatibilitySpec extends ChiselPropSpec with Matchers { property("IOCModuleVec should elaborate") { elaborate { new IOCModuleVec(2) } @@ -42,4 +44,16 @@ class IOCompatibilitySpec extends ChiselPropSpec { property("IOCModuleWire should elaborate") { elaborate { new IOCModuleWire } } + + + class IOUnwrapped extends Module { + val io = new IOCSimpleIO + io.out := io.in + } + + property("Unwrapped IO should generate an exception") { + a [BindingException] should be thrownBy { + elaborate(new IOUnwrapped) + } + } } |
