summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/CompatibilitySpec.scala
diff options
context:
space:
mode:
authorJack Koenig2021-01-20 18:55:16 -0800
committerJack Koenig2021-01-21 15:36:55 -0800
commit8a73362bb6fe87817a1867cc2482c1841f95c077 (patch)
treea439d2a5fb52941baeffa22297b38160dc2d1249 /src/test/scala/chiselTests/CompatibilitySpec.scala
parentb88ae1fb5cd106f114fa2152ac53c197ae69c164 (diff)
Remove val io
Chisel projects no longer need -Xsource:2.11 when compiling with Scala 2.12. Autowrapping of "val io" for compatibility mode Modules is now implemented using reflection instead of calling the virtual method. Also move Chisel.BlackBox to new chisel3.internal.LegacyBlackBox
Diffstat (limited to 'src/test/scala/chiselTests/CompatibilitySpec.scala')
-rw-r--r--src/test/scala/chiselTests/CompatibilitySpec.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/CompatibilitySpec.scala b/src/test/scala/chiselTests/CompatibilitySpec.scala
index 50213d4d..6a77c821 100644
--- a/src/test/scala/chiselTests/CompatibilitySpec.scala
+++ b/src/test/scala/chiselTests/CompatibilitySpec.scala
@@ -239,6 +239,20 @@ class CompatibiltySpec extends ChiselFlatSpec with ScalaCheckDrivenPropertyCheck
ChiselStage.elaborate { new RequireIOWrapModule() }
}
+ "A Module without val io" should "throw an exception" in {
+ class ModuleWithoutValIO extends Module {
+ val foo = new Bundle {
+ val in = UInt(width = 32).asInput
+ val out = Bool().asOutput
+ }
+ foo.out := foo.in(1)
+ }
+ val e = intercept[Exception](
+ ChiselStage.elaborate { new ModuleWithoutValIO }
+ )
+ e.getMessage should include("must have a 'val io' Bundle")
+ }
+
"A Module connecting output as source to input as sink when compiled with the Chisel compatibility package" should "not throw an exception" in {
class SimpleModule extends Module {