From cb7bd3e70f2864d233a32e9935af4b7a829ff0af Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Wed, 31 Jul 2019 14:19:58 -0400 Subject: Add Data deprecated compatibility tests Signed-off-by: Schuyler Eldridge --- src/test/scala/chiselTests/CompatibilitySpec.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/test/scala/chiselTests/CompatibilitySpec.scala') diff --git a/src/test/scala/chiselTests/CompatibilitySpec.scala b/src/test/scala/chiselTests/CompatibilitySpec.scala index 7194cb3c..2fa936ed 100644 --- a/src/test/scala/chiselTests/CompatibilitySpec.scala +++ b/src/test/scala/chiselTests/CompatibilitySpec.scala @@ -463,4 +463,22 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks elaborate(new Foo) } + behavior of "Data methods" + + it should "support legacy methods" in { + class Foo extends Module { + val io = IO(new Bundle{}) + + info("litArg works") + UInt(width=3).litArg() should be (None) + UInt(0, width=3).litArg() should be (Some(chisel3.internal.firrtl.ULit(0, 3.W))) + + info("toBits works") + val wire = Wire(UInt(width=4)) + Vec.fill(4)(wire).toBits.getWidth should be (wire.getWidth * 4) + } + + elaborate(new Foo) + } + } -- cgit v1.2.3