From ec02d9336800f3d837ac69e173533d4c0b264eb4 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 29 Jun 2017 22:05:11 -0700 Subject: Add test for padding constant connections to wires in ConstProp --- .../scala/firrtlTests/ConstantPropagationTests.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/ConstantPropagationTests.scala b/src/test/scala/firrtlTests/ConstantPropagationTests.scala index 8f09ac9e..985d9956 100644 --- a/src/test/scala/firrtlTests/ConstantPropagationTests.scala +++ b/src/test/scala/firrtlTests/ConstantPropagationTests.scala @@ -514,4 +514,21 @@ class ConstantPropagationIntegrationSpec extends LowTransformSpec { | z <= UInt<1>(0)""".stripMargin execute(input, check, Seq.empty) } + + it should "pad constant connections to wires when propagating" in { + val input = + """circuit Top : + | module Top : + | output z : UInt<16> + | wire w : { a : UInt<8>, b : UInt<8> } + | w.a <= UInt<2>("h3") + | w.b <= UInt<2>("h3") + | z <= cat(w.a, w.b)""".stripMargin + val check = + """circuit Top : + | module Top : + | output z : UInt<16> + | z <= UInt<16>("h303")""".stripMargin + execute(input, check, Seq.empty) + } } -- cgit v1.2.3