aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Izraelevitz2017-05-12 13:08:36 -0700
committerGitHub2017-05-12 13:08:36 -0700
commit1a9ac26f6a1b363ecd16f33a9c76e4275b3312d1 (patch)
treede97b4c7d717c41febb7e94740f872e24152dec2 /src
parentcf226360a7681354609779743895d015c3415451 (diff)
Fix pad, second try (#465)
* Bugfix: pad is max(width,const) during constprop * Fixed max syntax
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/firrtl/passes/ConstProp.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/firrtl/passes/ConstProp.scala b/src/main/scala/firrtl/passes/ConstProp.scala
index 8736ee31..bb3fb1e8 100644
--- a/src/main/scala/firrtl/passes/ConstProp.scala
+++ b/src/main/scala/firrtl/passes/ConstProp.scala
@@ -196,8 +196,8 @@ object ConstProp extends Pass {
case _ => e
}
case Pad => e.args.head match {
- case UIntLiteral(v, _) => UIntLiteral(v, IntWidth(e.consts.head))
- case SIntLiteral(v, _) => SIntLiteral(v, IntWidth(e.consts.head))
+ case UIntLiteral(v, IntWidth(w)) => UIntLiteral(v, IntWidth(e.consts.head max w))
+ case SIntLiteral(v, IntWidth(w)) => SIntLiteral(v, IntWidth(e.consts.head max w))
case _ if bitWidth(e.args.head.tpe) == e.consts.head => e.args.head
case _ => e
}