aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/scala/firrtl/passes/ZeroWidth.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/scala/firrtl/passes/ZeroWidth.scala b/src/main/scala/firrtl/passes/ZeroWidth.scala
index 60439ec1..e918ff63 100644
--- a/src/main/scala/firrtl/passes/ZeroWidth.scala
+++ b/src/main/scala/firrtl/passes/ZeroWidth.scala
@@ -135,8 +135,9 @@ object ZeroWidth extends Transform with DependencyAPIMigration {
}
}
nonZeros match {
- case Nil => UIntLiteral(ZERO, IntWidth(BigInt(1)))
- case Seq(x) => x
+ case Nil => UIntLiteral(ZERO, IntWidth(BigInt(1)))
+ // We may have an SInt, Cat has type UInt so cast
+ case Seq(x) => castRhs(tpe, x)
case seq => DoPrim(Cat, seq, consts, tpe).map(onExp)
}
case DoPrim(Andr, Seq(x), _, _) if (bitWidth(x.tpe) == 0) => UIntLiteral(1) // nothing false