aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/ConstantPropagationTests.scala
diff options
context:
space:
mode:
authorAlbert Chen2020-07-23 09:39:41 -0700
committerGitHub2020-07-23 16:39:41 +0000
commitea558ad79ed0e65df73b5a01ceea690e5b0479ca (patch)
tree5413daebddf2cfa91adc1bae7c7d23fc887b985f /src/test/scala/firrtlTests/ConstantPropagationTests.scala
parentd177add0df50bfd7059557b2b648d101489b7285 (diff)
Update negative literal emission (#1782)
* test const prop of addition of negative literals * Emitter: handle minimum negative values correctly * update expected verilog in AsyncResetSpec
Diffstat (limited to 'src/test/scala/firrtlTests/ConstantPropagationTests.scala')
-rw-r--r--src/test/scala/firrtlTests/ConstantPropagationTests.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/ConstantPropagationTests.scala b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
index 32303949..131f9466 100644
--- a/src/test/scala/firrtlTests/ConstantPropagationTests.scala
+++ b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
@@ -1604,4 +1604,14 @@ class ConstantPropagationEquivalenceSpec extends FirrtlFlatSpec {
| out <= head_temp""".stripMargin
firrtlEquivalenceTest(input, transforms)
}
+
+ "addition of negative literals" should "be propagated" in {
+ val input =
+ s"""circuit AddTester :
+ | module AddTester :
+ | output ref : SInt<2>
+ | ref <= add(SInt<1>("h-1"), SInt<1>("h-1"))
+ |""".stripMargin
+ firrtlEquivalenceTest(input, transforms)
+ }
}