From b24b9a0167762b7f7ef1aae3fd6735a3bb1f898e Mon Sep 17 00:00:00 2001 From: Albert Chen Date: Fri, 24 Jul 2020 13:56:49 -0700 Subject: Fix sign extension issue in Emitter (#1785) * add sign-extend const-prop test * Emitter: don't wrap Neg operand in concat--- src/test/scala/firrtlTests/ConstantPropagationTests.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test') diff --git a/src/test/scala/firrtlTests/ConstantPropagationTests.scala b/src/test/scala/firrtlTests/ConstantPropagationTests.scala index 653653d6..efe85e48 100644 --- a/src/test/scala/firrtlTests/ConstantPropagationTests.scala +++ b/src/test/scala/firrtlTests/ConstantPropagationTests.scala @@ -1651,4 +1651,14 @@ class ConstantPropagationEquivalenceSpec extends FirrtlFlatSpec { |""".stripMargin firrtlEquivalenceTest(input, transforms) } + + "propagation of signed expressions" should "have the correct signs" in { + val input = + s"""circuit SignTester : + | module SignTester : + | output ref : SInt<3> + | ref <= mux(UInt<1>("h0"), SInt<3>("h0"), neg(UInt<2>("h3"))) + |""".stripMargin + firrtlEquivalenceTest(input, transforms) + } } -- cgit v1.2.3