-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial implementation of elaboration system tasks #983
Conversation
(IEEE1800-2017 section 20.11) This PR allows us to use $info/$warning/$error/$fatal **at elaboration time** within a generate block. This is very useful to stop a synthesis of a parametrized block when an illegal combination of parameters is chosen.
@cliffordwolf , can you please take a look at this? verilog_parser.y and verilog_lexer.l are the target of many PR's and the longer you delay looking at this, means more PR's will get out of sync. I have several potential PR's to advance the state of SV language input I would like to write and submit, but they all modify the parser & lexer, so I have no wish to work on multiple PR's in parallel. However, when my PR is not looked at for a long time, nor even acknowledged with message such as "saw your PR, too busy to comment right now, will take a look next week/month/whatever", The more this delayed, the higher the chance other PRs will cause conflicts for my PR - in fact, it already does - it did not conflict when I submitted it. |
I would like to support the addition of these features, I tried to use them recently and was saddened to find out they didn't work. @ZipCPU eventually suggested the following work around version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments JFYI. See #1077 for fixed and updated version.
va_start(ap, format); | ||
std::string prefix = stringf("%s:%d: Info: ", | ||
filename.c_str(), lineno); | ||
logv_warning_with_prefix(prefix.c_str(), format, ap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think $info
should be printed as warning.
@@ -1146,7 +1146,8 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, | |||
|
|||
if (type == AST_GENFOR) { | |||
for (size_t i = 0; i < buf->children.size(); i++) { | |||
buf->children[i]->simplify(false, false, false, stage, -1, false, false); | |||
if (!buf->children[i]->check_elab_tasks()) | |||
buf->children[i]->simplify(false, false, false, stage, -1, false, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not the right thing to do this. Consider the following example:
module test;
$info({"foo", "bar"});
endmodule
(IEEE1800-2017 section 20.11)
This PR allows us to use $info/$warning/$error/$fatal at elaboration time within a generate block.
This is very useful to stop a synthesis of a parametrized block when an illegal combination of parameters is chosen.
Some notes regarding this PR:
Known limitations:
Please see corresponding Verilator bug:
https://www.veripool.org/issues/1429-Verilator-Feature-request-elaboration-tasks