summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Lawson2016-10-06 11:06:30 -0700
committerGitHub2016-10-06 11:06:30 -0700
commit7aea39d4deac62d5477904f4bf4381c3482c41d0 (patch)
tree93f217dbdb18c18a386c7a6cfb6ecc9ea105c9ed /src
parentc9fe6005080f7695ff104253c1bf27388f749091 (diff)
parent1abe52da025c3935c28d0280abbadf40021d5b3f (diff)
Merge pull request #312 from ucb-bar/improveunboundioerrormessage305
Generate a better error message for missing IO() wrapper - fix #305
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/IOCompatibility.scala16
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)
+ }
+ }
}