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
$value$plusargs requires a string instead of an expression #1165
Comments
Original Redmine Comment I've tried to implement this myself, but I got lost in the various output forms that use an AstNode. It does not seem too hard to do for someone more familiar with the code base. The format parsing stuff in EmitC.visit just needs to be moved to VL_VALUEPLUSARGS_IW, where it almost already exists anyway. |
Original Redmine Comment I've set up an issue in the rocketchip repository that links to this issue. chipsalliance/rocket-chip#752 |
Original Redmine Comment Basically, yes, but lots of details involved, as this dates back to before Verilator had true string support. Anyhow, fixed in git towards 3.903. |
Original Redmine Comment Firstly, thanks a lot for taking a look into fixing this! I noticed that $value$plusargs is returning a 32-bit value and not a boolean. I get this warning: When compiling this line: I can work around this easily, but it is behaviour that differs from the other tools I use. |
Original Redmine Comment Ok. I've figured it out. The return value of $value$plusargs MUST be inspected, otherwise the call is optimized away to nothing. Presumably it should be marked as having side-effects, since it modifies it's second argument. So there are two problems remaining: |
Original Redmine Comment The spec says it's an integer return, so the warning is technically correct, but silly. I committed to suppress it when comparing it as one bit. The internal attributes to not optimize look correct, please modify the test_regress/t/t_sys_plusargs.v example as needed to show the other problem. |
Original Redmine Comment In 3.904. |
Author Name: Wesley Terpstra (@terpstra)
Original Redmine Issue: 1165 from https://www.veripool.org
In src/verilog.y there is this:
| yD_VALUEPLUSARGS '(' str ',' expr ')' { $$ = new AstValuePlusArgs($1,*$3,$5); }
This makes it impossible to obtain anything other than hard-coded command-line arguments. vcs/incisive/questa all support expressions like {NAME, "=%d"} or similar for the first argument.
The text was updated successfully, but these errors were encountered: