From abeff01f0714d5474b9d18d78fc13011e5ad6b99 Mon Sep 17 00:00:00 2001 From: Jiuyang Liu Date: Sat, 27 Mar 2021 00:53:25 +0000 Subject: Add NoConstantPropagationAnnotation to disable constatnt propagation (#2150) * add --no-constant-propagation to disable constant propagation * add test * deprecate DisableFold. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>--- src/test/scala/firrtlTests/ConstantPropagationTests.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/ConstantPropagationTests.scala b/src/test/scala/firrtlTests/ConstantPropagationTests.scala index 60cf1b8b..bc7f92e6 100644 --- a/src/test/scala/firrtlTests/ConstantPropagationTests.scala +++ b/src/test/scala/firrtlTests/ConstantPropagationTests.scala @@ -908,6 +908,17 @@ class ConstantPropagationIntegrationSpec extends LowTransformSpec { execute(input, check, Seq(dontTouch("Child.in1"))) } + it should "NOT optimize if no-constant-propagation is enabled" in { + val input = + """circuit Foo: + | module Foo: + | input a: UInt<1> + | output b: UInt<1> + | b <= and(UInt<1>(0), a)""".stripMargin + val check = parse(input).serialize + execute(input, check, Seq(NoConstantPropagationAnnotation)) + } + it should "still propagate constants even when there is name swapping" in { val input = """circuit Top : -- cgit v1.2.3