From: Clifford Wolf Date: Sat, 2 Dec 2017 17:52:05 +0000 (+0100) Subject: Fix error handling for nested always/initial X-Git-Tag: yosys-0.8~263 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8364f509e31c187351bbc193a351aad90480c725;p=yosys.git Fix error handling for nested always/initial --- diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc index 6c2eafacd..3b08fc28d 100644 --- a/frontends/ast/genrtlil.cc +++ b/frontends/ast/genrtlil.cc @@ -554,6 +554,8 @@ struct AST_INTERNAL::ProcessGenerator break; default: + // ast->dumpAst(NULL, "ast> "); + // current_ast_mod->dumpAst(NULL, "mod> "); log_abort(); } } diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 74e7b4675..f61f7cf7c 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -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 (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_clocked = false;