-
Notifications
You must be signed in to change notification settings - Fork 199
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
linter cannot find macro defined in a different file #2173
Comments
Could you perhaps share a minimal reproducer and the version of verible you're using? |
ok I think the problem is a bit different than what I described. Let me illustrate. Say I have an example.sv containing a macro definition and usage. Calling verible-verilog-lint identifies the always-ff-non-blocking issue on line 4 :
if I introduce a syntax error on line 5, it is detected correctly :
Now I move the macro to a different file and call the tool again passing both files:
So far so good.
Here I would expect to get the same error as before which was |
Thanks for the detailed explanation. I had hoped it would be a simple configuration error in the LSP. verible doesn't work all that well with macros. I think it was originally intended to handle already preprocessed code. I'll have a look just in case this can be easily fixed, but I'm not sure it will. Thanks for the report :) Edit: Self-notes: preprocessing always fails if there is no definition
I think the issue is: linter fails parsing due to the syntax error, and then tries to parse it again with preprocessing. Preprocessing fails due to no macro definition Seems related to #1542 |
I have a mymodule.sv file which uses a simple macro that's defined in another file (say macros.sv).
define iw(fp) $bits(fp.iw)
calling
verible-verilog-lint mymodule.sv
results in:preprocessing error at token "`iw" : Error expanding macro identifier, might not be defined before.
As far as I can tell there is no way to pass macros.sv to the linter so it knows where to find the macro.
But that seems hard to believe since 99% of the time people define their macros all over the place.
The language server seems to have a way to pass a list of files, but even when that's done, the same error appears via the language server:
The text was updated successfully, but these errors were encountered: