From 99ac8a134b134713913036013ffdec98ec92c73a Mon Sep 17 00:00:00 2001 From: Albert Magyar Date: Mon, 8 Jun 2020 12:14:10 -0700 Subject: Report Builder.error errors as exceptions outside hardware context (#1425) * Immediately throw Builder.error errors outside hardware context * Add example of hidden no-hardware-context error from #1422 Co-authored-by: Schuyler Eldridge --- src/test/scala/chiselTests/ImplicitConversionsSpec.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/scala/chiselTests/ImplicitConversionsSpec.scala b/src/test/scala/chiselTests/ImplicitConversionsSpec.scala index d5939b24..bde43717 100644 --- a/src/test/scala/chiselTests/ImplicitConversionsSpec.scala +++ b/src/test/scala/chiselTests/ImplicitConversionsSpec.scala @@ -39,5 +39,10 @@ class ImplicitConversionsSpec extends ChiselFlatSpec { import chisel3.util._ assertTypeError("Decoupled(UInt(8.W)).target") } -} + "X.B for X not in [0,1]" should "throw an exception, even outside hardware context" in { + a [ChiselException] should be thrownBy { + 65.B + } + } +} -- cgit v1.2.3