From d6bbbf664fa15e85132e33b42e64d4e37483a514 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Wed, 31 Jul 2019 14:27:21 -0400 Subject: Add Wire deprecated compatibility tests Signed-off-by: Schuyler Eldridge --- src/test/scala/chiselTests/CompatibilitySpec.scala | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/test/scala') diff --git a/src/test/scala/chiselTests/CompatibilitySpec.scala b/src/test/scala/chiselTests/CompatibilitySpec.scala index 2fa936ed..81c97ee9 100644 --- a/src/test/scala/chiselTests/CompatibilitySpec.scala +++ b/src/test/scala/chiselTests/CompatibilitySpec.scala @@ -481,4 +481,26 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks elaborate(new Foo) } + behavior of "Wire" + + it should "support legacy methods" in { + class Foo extends Module { + val io = IO(new Bundle{}) + + info("apply[T <: Data](dummy: Int = 0, init: T): T works") + val first = Wire(init=UInt("hdeadbeef")) + first shouldBe a [UInt] + + info("apply[T <: Data](t: T, init: T): T works") + val second = Wire(SInt(), SInt(-100)) + second shouldBe a [SInt] + + info("apply[T <: Data](t: T, init: DontCare.type): T works") + val third = Wire(UInt(), chisel3.DontCare) + third shouldBe a [UInt] + } + + elaborate(new Foo) + } + } -- cgit v1.2.3