aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/ConstantPropagationTests.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/firrtlTests/ConstantPropagationTests.scala')
-rw-r--r--src/test/scala/firrtlTests/ConstantPropagationTests.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/ConstantPropagationTests.scala b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
index 19fe20c9..6fc685a8 100644
--- a/src/test/scala/firrtlTests/ConstantPropagationTests.scala
+++ b/src/test/scala/firrtlTests/ConstantPropagationTests.scala
@@ -893,6 +893,23 @@ class ConstantPropagationIntegrationSpec extends LowTransformSpec {
execute(input, check, Seq.empty)
}
+ it should "remove pads if the width is <= the width of the argument" in {
+ def input(w: Int) =
+ s"""circuit Top :
+ | module Top :
+ | input x : UInt<8>
+ | output z : UInt<8>
+ | z <= pad(x, $w)""".stripMargin
+ val check =
+ """circuit Top :
+ | module Top :
+ | input x : UInt<8>
+ | output z : UInt<8>
+ | z <= x""".stripMargin
+ execute(input(6), check, Seq.empty)
+ execute(input(8), check, Seq.empty)
+ }
+
"Registers with no reset or connections" should "be replaced with constant zero" in {
val input =