aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests
diff options
context:
space:
mode:
authorJack Koenig2018-01-30 12:53:56 -0800
committerJack Koenig2018-01-30 12:53:56 -0800
commitc9d3e257bff74235a75ff5530051e419b9ce8005 (patch)
tree70de3e10760efef858ca78a4e181e28d30984abe /src/test/scala/firrtlTests
parent8bdc969f95571fa22b39612d3e3acc69268cf2f0 (diff)
Make Constant Propagation respect dontTouch on registers
Diffstat (limited to 'src/test/scala/firrtlTests')
-rw-r--r--src/test/scala/firrtlTests/ConstantPropagationTests.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/ConstantPropagationTests.scala b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
index 2aad4f21..e143f853 100644
--- a/src/test/scala/firrtlTests/ConstantPropagationTests.scala
+++ b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
@@ -712,6 +712,21 @@ class ConstantPropagationIntegrationSpec extends LowTransformSpec {
execute(input, check, Seq(dontTouch("Top.z")))
}
+ "ConstProp" should "NOT optimize across dontTouch on registers" in {
+ val input =
+ """circuit Top :
+ | module Top :
+ | input clk : Clock
+ | input reset : UInt<1>
+ | output y : UInt<1>
+ | reg z : UInt<1>, clk
+ | y <= z
+ | z <= mux(reset, UInt<1>("h0"), z)""".stripMargin
+ val check = input
+ execute(input, check, Seq(dontTouch("Top.z")))
+ }
+
+
it should "NOT optimize across dontTouch on wires" in {
val input =
"""circuit Top :