From 09f7aa03e1e729ad9e6eb97ab08419d0b95c8703 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Wed, 31 Jul 2019 12:57:13 -0400 Subject: Add BitPat deprecated compatibility tests Signed-off-by: Schuyler Eldridge --- src/test/scala/chiselTests/CompatibilitySpec.scala | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/test/scala/chiselTests/CompatibilitySpec.scala b/src/test/scala/chiselTests/CompatibilitySpec.scala index 24149cf3..eece45e2 100644 --- a/src/test/scala/chiselTests/CompatibilitySpec.scala +++ b/src/test/scala/chiselTests/CompatibilitySpec.scala @@ -338,4 +338,24 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks }) } // scalastyle:on line.size.limit + + behavior of "BitPat" + + it should "support old operators" in { + class Foo extends Module { + val io = IO(new Bundle{}) + + info("Deprecated method DC hasn't been removed") + val bp = BitPat.DC(4) + + info("BitPat != UInt is a Bool") + (bp != UInt(4)) shouldBe a [Bool] + + /* This test does not work, but I'm not sure it's supposed to? It does *not* work on chisel3. */ + // info("UInt != BitPat is a Bool") + // (UInt(4) != bp) shouldBe a [Bool] + } + + elaborate(new Foo) + } } -- cgit v1.2.3