diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/scala/firrtlTests/ConstantPropagationTests.scala | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/ConstantPropagationTests.scala b/src/test/scala/firrtlTests/ConstantPropagationTests.scala index 380d53e5..e42ecfac 100644 --- a/src/test/scala/firrtlTests/ConstantPropagationTests.scala +++ b/src/test/scala/firrtlTests/ConstantPropagationTests.scala @@ -478,6 +478,36 @@ class ConstantPropagationSpec extends FirrtlFlatSpec { """ (parse(exec(input))) should be (parse(check)) } + + "ConstProp" should "NOT swap wire names with node names" in { + val input = +"""circuit Top : + module Top : + input clock : Clock + input x : UInt<1> + input y : UInt<1> + output z : UInt<1> + wire hit : UInt<1> + node _T_1 = or(x, y) + node _T_2 = eq(_T_1, UInt<1>(1)) + hit <= _T_2 + z <= hit +""" + val check = +"""circuit Top : + module Top : + input clock : Clock + input x : UInt<1> + input y : UInt<1> + output z : UInt<1> + wire hit : UInt<1> + node _T_1 = or(x, y) + node _T_2 = _T_1 + hit <= _T_1 + z <= hit +""" + (parse(exec(input))) should be (parse(check)) + } } // More sophisticated tests of the full compiler |
