summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/scala/chiselTests/CompatibilitySpec.scala28
1 files changed, 28 insertions, 0 deletions
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)
+ }
+
}