summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSchuyler Eldridge2019-08-07 18:00:29 -0400
committerSchuyler Eldridge2019-08-08 15:19:33 -0400
commit9e99adbe920f3127e02a8dac05c972e3ea518c12 (patch)
tree8c37e85d17ed616df9bb454b7dd39e5b3bd14922 /src/test
parent59d72b37d38556b7d11e55c44057d01e07fe1e31 (diff)
Require target is hardware for Vec.apply(a: UInt)
Adds a check that a Vec being indexed by a UInt is, in fact, a hardware type. This includes a test for this. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/chiselTests/Vec.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/Vec.scala b/src/test/scala/chiselTests/Vec.scala
index 0884ad37..2f67f375 100644
--- a/src/test/scala/chiselTests/Vec.scala
+++ b/src/test/scala/chiselTests/Vec.scala
@@ -272,4 +272,15 @@ class VecSpec extends ChiselPropSpec {
io.out := VecInit(Seq(4.U, 5.U, DontCare, 2.U))
})
}
+
+ property("Indexing a Chisel type Vec by a hardware type should give a sane error message") {
+ assertThrows[ExpectedHardwareException] {
+ elaborate{
+ new Module {
+ val io = IO(new Bundle{})
+ val foo = Vec(2, Bool())
+ foo(0.U) := false.B
+ }}
+ }
+ }
}