aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/passes/RemoveValidIf.scala
diff options
context:
space:
mode:
authorJack Koenig2020-11-11 16:07:54 -0800
committerGitHub2020-11-12 00:07:54 +0000
commitc7bbb75b8b293d639848abaa9f68121f80947f42 (patch)
treea80fbf90a249d8372751fa728b7f709e850778ea /src/main/scala/firrtl/passes/RemoveValidIf.scala
parent7d637e256d09e46c5b45c9ac3b6258e43c279f2a (diff)
Fix RemoveWires handling of invalidated non-UInt wires (#1949)
It would replace them with a validif node with a UIntLiteral which can lead to type errors.
Diffstat (limited to 'src/main/scala/firrtl/passes/RemoveValidIf.scala')
-rw-r--r--src/main/scala/firrtl/passes/RemoveValidIf.scala8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main/scala/firrtl/passes/RemoveValidIf.scala b/src/main/scala/firrtl/passes/RemoveValidIf.scala
index bc8e8c1b..03214f83 100644
--- a/src/main/scala/firrtl/passes/RemoveValidIf.scala
+++ b/src/main/scala/firrtl/passes/RemoveValidIf.scala
@@ -21,12 +21,8 @@ object RemoveValidIf extends Pass {
* @note Accepts [[firrtl.ir.Type Type]] but dyanmically expects [[firrtl.ir.GroundType GroundType]]
*/
def getGroundZero(tpe: Type): Expression = tpe match {
- case _: UIntType => UIntZero
- case _: SIntType => SIntZero
- case ClockType => ClockZero
- case _: FixedType => FixedZero
- case AsyncResetType => AsyncZero
- case other => throwInternalError(s"Unexpected type $other")
+ case g: GroundType => Utils.getGroundZero(g)
+ case other => throwInternalError(s"Unexpected type $other")
}
override def prerequisites = firrtl.stage.Forms.LowForm