Allow $past, $stable, $rose, $fell in $global_clock blocks
authorClifford Wolf <clifford@clifford.at>
Tue, 10 Oct 2017 09:59:32 +0000 (11:59 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 10 Oct 2017 09:59:32 +0000 (11:59 +0200)
frontends/ast/simplify.cc

index cd2120b8c9304be713f47ea240b323388caeaaa7..4baed3bfc482eae31857217e9160f807028d3500 100644 (file)
@@ -405,9 +405,13 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
                current_always_clocked = false;
 
                if (type == AST_ALWAYS)
-                       for (auto child : children)
+                       for (auto child : children) {
                                if (child->type == AST_POSEDGE || child->type == AST_NEGEDGE)
                                        current_always_clocked = true;
+                               if (child->type == AST_EDGE && GetSize(child->children) == 1 &&
+                                               child->children[0]->type == AST_IDENTIFIER && child->children[0]->str == "\\$global_clock")
+                                       current_always_clocked = true;
+                       }
        }
 
        int backup_width_hint = width_hint;