From 1a9ac26f6a1b363ecd16f33a9c76e4275b3312d1 Mon Sep 17 00:00:00 2001 From: Adam Izraelevitz Date: Fri, 12 May 2017 13:08:36 -0700 Subject: Fix pad, second try (#465) * Bugfix: pad is max(width,const) during constprop * Fixed max syntax --- src/main/scala/firrtl/passes/ConstProp.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') 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 } -- cgit v1.2.3