mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Fix error handling for nested always/initial
This commit is contained in:
parent
1f6e8f86c5
commit
8364f509e3
|
@ -554,6 +554,8 @@ struct AST_INTERNAL::ProcessGenerator
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
// ast->dumpAst(NULL, "ast> ");
|
||||||
|
// current_ast_mod->dumpAst(NULL, "mod> ");
|
||||||
log_abort();
|
log_abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -401,6 +401,9 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
|
||||||
|
|
||||||
if (type == AST_ALWAYS || type == AST_INITIAL)
|
if (type == AST_ALWAYS || type == AST_INITIAL)
|
||||||
{
|
{
|
||||||
|
if (current_always != nullptr)
|
||||||
|
log_error("Invalid nesting of always blocks and/or initializations at %s:%d.\n", filename.c_str(), linenum);
|
||||||
|
|
||||||
current_always = this;
|
current_always = this;
|
||||||
current_always_clocked = false;
|
current_always_clocked = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue