aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/ConstantPropagationTests.scala
diff options
context:
space:
mode:
authorJack Koenig2018-05-29 16:13:39 -0700
committerGitHub2018-05-29 16:13:39 -0700
commitf24a733dc279e93a7d5d945042ec7472a6872aa1 (patch)
tree150f7234abc74aa5f248bf2c0041e2f2dfc09c1e /src/test/scala/firrtlTests/ConstantPropagationTests.scala
parent87fe48938a3ccc58b1945bae72f0e7305ac14b3b (diff)
Fix pad (#817)
* Make VerilogEmitter properly handle pad of width <= width of arg * Constant prop pads with pad amount <= width of arg
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 =