Early wire/reg/parameter width calculation in ast/simplify
authorClifford Wolf <clifford@clifford.at>
Sun, 24 Nov 2013 18:40:23 +0000 (19:40 +0100)
committerClifford Wolf <clifford@clifford.at>
Sun, 24 Nov 2013 18:40:23 +0000 (19:40 +0100)
frontends/ast/simplify.cc

index a3518ff03ed0e8611e64edd410c949a687f9e74a..80cf230e6a9361c8ff2258494339b4eaedfb7e40 100644 (file)
@@ -212,6 +212,11 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
                                current_scope[node->str] = node;
                        }
                }
+               for (size_t i = 0; i < children.size(); i++) {
+                       AstNode *node = children[i];
+                       if (node->type == AST_PARAMETER || node->type == AST_LOCALPARAM || node->type == AST_WIRE || node->type == AST_AUTOWIRE)
+                               while (node->simplify(true, false, false, 1, -1, false)) { }
+               }
        }
 
        auto backup_current_block = current_block;