diff options
| author | Jiuyang Liu | 2021-03-27 00:53:25 +0000 |
|---|---|---|
| committer | GitHub | 2021-03-27 00:53:25 +0000 |
| commit | abeff01f0714d5474b9d18d78fc13011e5ad6b99 (patch) | |
| tree | 8985ae7da691d378d192060872360517debd8805 /src/test | |
| parent | 67ce97a10564cfa07829af8cfce562009d60bafb (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.scala | 11 |
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 : |
