summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchuyler Eldridge2019-07-31 15:45:29 -0400
committerSchuyler Eldridge2019-07-31 15:53:26 -0400
commit4a919c83318c6964d9a864c50cb3ba719b1fdbfe (patch)
tree5428eff018a0131e2ead5db8c91623baa3087701
parent86b8e14f5f5dcb09546e4a7ff2b088e4109b0df9 (diff)
Add Bits deprecated compatibility tests
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
-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)
+ }
+
}