aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/passes/ExpandWhens.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/firrtl/passes/ExpandWhens.scala')
-rw-r--r--src/main/scala/firrtl/passes/ExpandWhens.scala15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/scala/firrtl/passes/ExpandWhens.scala b/src/main/scala/firrtl/passes/ExpandWhens.scala
index 8fb4e5fb..1fd79f3a 100644
--- a/src/main/scala/firrtl/passes/ExpandWhens.scala
+++ b/src/main/scala/firrtl/passes/ExpandWhens.scala
@@ -125,13 +125,22 @@ object ExpandWhens extends Pass {
EmptyStmt
// For simulation constructs, update simlist with predicated statement and return EmptyStmt
case sx: Print =>
- simlist += (if (weq(p, one)) sx else sx.withEn(AND(p, sx.en)))
+ simlist += (if (weq(p, one)) sx else sx match {
+ case s: Print => s.copy(en = AND(p, s.en))
+ case o => o
+ })
EmptyStmt
case sx: Stop =>
- simlist += (if (weq(p, one)) sx else sx.withEn(AND(p, sx.en)))
+ simlist += (if (weq(p, one)) sx else sx match {
+ case s: Stop => s.copy(en = AND(p, s.en))
+ case o => o
+ })
EmptyStmt
case sx: Verification =>
- simlist += (if (weq(p, one)) sx else sx.withEn(AND(p, sx.en)))
+ simlist += (if (weq(p, one)) sx else sx match {
+ case s: Verification => s.copy(en = AND(p, s.en))
+ case o => o
+ })
EmptyStmt
// Expand conditionally, see comments below
case sx: Conditionally =>