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
Support old format $display ($time, "...") #467
Comments
Original Redmine Comment Obviously Verilator currently expects a format string. |
Original Redmine Comment Another example:
|
Original Redmine Comment More $display() cases that don't work with verilator:
verilator output:
Another case:
|
Original Redmine Comment See also #�. Patches are welcome; at one point the code didn't discriminate between a user-string "..." and a number which just happened to print as a string, so it couldn't know if $display("foo") should print as a number or string. Some of that is now better, but it's likely still a problem in some places. Also it's better to make a large format string than to break it up, because Verilator knows how to constant propagate into displays, so ideally a large $display will become in the output just a constant string. This doesn't work across multiple displays. |
Original Redmine Comment I've started working on this. I see what you mean about constant propagation into display statements. One question I have is how to tell if one of the arguments (other than the first) is a string. I have this as input:
The dtype for the node for the ">" dumps:
Is there some clue that this was a string? |
Original Redmine Comment My current plan is to extend the format string in LinkResolveVisitor with appropriate format % operators for the extra nodes. |
Original Redmine Comment Found V3Number::isFromString(), answering my own question. |
Original Redmine Comment Attached is a work in progress to address this issue. I'll remove all the chatter from the final patch. As I append strings found in the argument list to the format string, I need to remove those strings from the argument list. Is argp->unlinkFrBack() the right thing to call? I'll work on some tests and then clean it up. |
Original Redmine Comment Generally very good. Just a few nits.
|
Original Redmine Comment Thanks for the feedback. Attached is the updated patch. |
Original Redmine Comment One more update which supersedes the last patch. |
Original Redmine Comment Great, pushed to git towards 3.878. (Made one trivial change to add a dataByte() accessor to V3Number, which seemed cleaner.) |
Original Redmine Comment In 3.878. |
Original Redmine Comment Hi Guys- Sorry, but from reading this exchange it's difficult for me to tell what's been fixed. Is the following now supported? I ask since similar things in altera_mf.v don't seem to work in the latest master. (This appears to be the last barrier to altera_mf.v parsing!) ~John |
Original Redmine Comment The $display($time) is fixed in git towards 3.891. |
Original Redmine Comment Excellent! Thanks |
Author Name: Alex Solomatnikov
Original Redmine Issue: 467 from https://www.veripool.org
Code:
error:
The text was updated successfully, but these errors were encountered: