From 4a919c83318c6964d9a864c50cb3ba719b1fdbfe Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Wed, 31 Jul 2019 15:45:29 -0400 Subject: Add Bits deprecated compatibility tests Signed-off-by: Schuyler Eldridge --- src/test/scala/chiselTests/CompatibilitySpec.scala | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src') diff --git a/src/test/scala/chiselTests/CompatibilitySpec.scala b/src/test/scala/chiselTests/CompatibilitySpec.scala index 11f44449..88228475 100644 --- a/src/test/scala/chiselTests/CompatibilitySpec.scala +++ b/src/test/scala/chiselTests/CompatibilitySpec.scala @@ -526,4 +526,32 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks assertTesterPasses(new Foo) } + behavior of "Bits methods" + + it should "support legacy methods" in { + class Foo extends Module { + val io = new Bundle{} + + val u = UInt(8) + val s = SInt(-4) + + info("toBools works") + u.toBools shouldBe a [Seq[Bool]] + + info("asBits works") + s.asBits shouldBe a [Bits] + + info("toSInt works") + u.toSInt shouldBe a [SInt] + + info("toUInt works") + s.toUInt shouldBe a [UInt] + + info("toBool works") + UInt(1).toBool shouldBe a [Bool] + } + + elaborate(new Foo) + } + } -- cgit v1.2.3