From 43146ebc08716b06f63f1965e698d9f0d9a4f40c Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Wed, 31 Jul 2019 13:58:04 -0400 Subject: Add Mem/SeqMem deprecated compatibility tests Signed-off-by: Schuyler Eldridge --- src/test/scala/chiselTests/CompatibilitySpec.scala | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/test') diff --git a/src/test/scala/chiselTests/CompatibilitySpec.scala b/src/test/scala/chiselTests/CompatibilitySpec.scala index d9f4ccdb..3cc8fb89 100644 --- a/src/test/scala/chiselTests/CompatibilitySpec.scala +++ b/src/test/scala/chiselTests/CompatibilitySpec.scala @@ -414,4 +414,40 @@ class CompatibiltySpec extends ChiselFlatSpec with GeneratorDrivenPropertyChecks elaborate(new Foo) } + behavior of "Mem" + + it should "support deprecated apply methods" in { + class Foo extends Module { + val io = IO(new Bundle{}) + + info("apply[T <: Data](t: T, size: BigInt): Mem[T] works") + val memBigInt = Mem(UInt(), 8: BigInt) + memBigInt shouldBe a [Mem[UInt]] + + info("apply[T <: Data](t: T, size: Int): Mem[T] works") + val memInt = Mem(SInt(), 16: Int) + memInt shouldBe a [Mem[SInt]] + } + + elaborate(new Foo) + } + + behavior of "SeqMem" + + it should "support deprecated apply methods" in { + class Foo extends Module { + val io = IO(new Bundle{}) + + info("apply[T <: Data](t: T, size: BigInt): SeqMem[T] works") + val seqMemBigInt = SeqMem(UInt(), 8: BigInt) + seqMemBigInt shouldBe a [SeqMem[UInt]] + + info("apply[T <: Data](t: T, size: Int): SeqMem[T] works") + val seqMemInt = SeqMem(UInt(), 16: Int) + seqMemInt shouldBe a [SeqMem[UInt]] + } + + elaborate(new Foo) + } + } -- cgit v1.2.3