Skip to content
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

Report column numbers and source text in error messages #1435

Closed
veripoolbot opened this issue May 13, 2019 · 4 comments
Closed

Report column numbers and source text in error messages #1435

veripoolbot opened this issue May 13, 2019 · 4 comments
Labels
area: lint Issue involves SystemVerilog lint checking resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Todd Strader (@toddstrader)
Original Redmine Issue: 1435 from https://www.veripool.org


Re: Wilson's suggestion in issue #1305, we should report column numbers and source text in error messages like gcc does:

%Error: project/fc/fx.v:1234:23: Illegal bit or array select; type does not have a bit range, or bad dimension: type is real
    source_error_line = realvar[bad_select];
                               ^~~~
%Error:                        : In instance top.fc.roc.foowrap.foo.ctl.csr.shim

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-05-13T22:46:39Z


Are you interested in making the column/source printing change? Here's some notes.

I'd think two separate patch sets, one for source printing and one for columns, probably source printing first unless only one interests you.

For source printing FileLineSingleton tracks language and filename for each file letter, probably refactor that into each letter tracking a class and have the filename/language/lines as an array in that class. Then add appropriate accessors. We'd save the results out of the preprocessed code.

Might need some cleanup needed in the preprocessor and elsewhere to preserve columns where it can (i.e. amount of whitespace).

For columns this describes getting columns out of flex: https://stackoverflow.com/questions/656703/how-does-flex-support-bison-location-exactly

we'd then spit the lex'ed columns into the FileLine and rest is easyish.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Todd Strader (@toddstrader)
Original Date: 2019-05-14T21:53:14Z


Sure, sign me up. However, I've got a lot of irons in the Verilator fire right now so this may take a while to get to. Also, I suspect this is related to issue #1439. So I'd like to make sure whatever I'm doing will service both issues.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-07-15T01:46:49Z


Fixed in git towards 4.017. Also added suggestions, which are arguably even more useful.

 %Error: t/t_var_suggest_bad.v:12: Can't find definition of variable: 'foobat'
                                  : ... Suggested alternative: 'foobar'
       if (foobat) $stop;
           ^~~~~~

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-08-29T23:15:42Z


In 4.018.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: lint Issue involves SystemVerilog lint checking resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

1 participant