-
Notifications
You must be signed in to change notification settings - Fork 217
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
Forbid implicit declarations #217
Comments
Couldn't agree more, would love to see this. (Have a horror story about this kind of issue...) |
b/138353038 |
There is a somewhat easy way to deal with this. At the top of a module file, you should set `default_nettype none This will cause an undeclared net to trigger a real error in whatever tool the user is using. A caveat: once you do this, any i/o wire have to be declared explicitly (many people just write A 2nd caveat: The default nettype persists across files after a compiler reads it, so you should to set default_nettype back to wire at the end of the file, as a lot of code assumes it. `default_nettype wire Now all that said, I would love there to be a lint rule to check if default_nettype is set to none at the start of a file and wire at the end, and that would be a lot easier to implement than trying to verify nets are declared. |
SystemVerilog allow implicit net declaration (language specification section 6.10). While useful for netlists, in traditional code it allows bugs to go undetected:
In both cases, the resulting code is legal and may be partly functional, making it hard to detect the issue.
I would like to see implicit net detected and reported in the linter.
The text was updated successfully, but these errors were encountered: