aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorJack Koenig2021-03-14 00:03:25 -0800
committerGitHub2021-03-14 00:03:25 -0800
commit0eb7afd09d488507d776017c5df8f6ec56924927 (patch)
treec8f0f82c065134fd082ddb1b803d1ac3dd1cd0c4 /src/test
parentfd55c51bcef01c2b2919817aa33c67e5a0849d05 (diff)
Fix width of constant propagation of SInt with zero (#2120)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/firrtlTests/ConstantPropagationTests.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/ConstantPropagationTests.scala b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
index 28c1d823..60cf1b8b 100644
--- a/src/test/scala/firrtlTests/ConstantPropagationTests.scala
+++ b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
@@ -1638,6 +1638,20 @@ class ConstantPropagationEquivalenceSpec extends FirrtlFlatSpec {
firrtlEquivalenceTest(input, transforms)
}
+ // https://github.com/chipsalliance/firrtl/issues/2034
+ "SInt OR with constant zero" should "have the correct widths" in {
+ val input =
+ s"""circuit WidthsOrSInt :
+ | module WidthsOrSInt :
+ | input in : SInt<1>
+ | input in2 : SInt<4>
+ | output out : UInt<8>
+ | output out2 : UInt<8>
+ | out <= or(in, SInt<8>(0))
+ | out2 <= or(in2, SInt<8>(0))""".stripMargin
+ firrtlEquivalenceTest(input, transforms)
+ }
+
"addition by zero width wires" should "have the correct widths" in {
val input =
s"""circuit ZeroWidthAdd: