aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorJiuyang Liu2021-03-27 00:53:25 +0000
committerGitHub2021-03-27 00:53:25 +0000
commitabeff01f0714d5474b9d18d78fc13011e5ad6b99 (patch)
tree8985ae7da691d378d192060872360517debd8805 /src/test
parent67ce97a10564cfa07829af8cfce562009d60bafb (diff)
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>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/ConstantPropagationTests.scala11
1 files changed, 11 insertions, 0 deletions
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 :