Open ghost opened 2 years ago
This might require more than just syntactic analysis to get correct, e.g. actual design elaboration. Most lint rules today perform only shallow syntax tree analysis. Today, the linter is limited to single-file analysis, and since you depend on module definitions (for signal direction) that could live in a different file, this falls in the domain of whole-project analysis/linting.
It might be possible to get away with a more approximate analysis using static symbol table analysis.
The symbol table builder attempts to resolve symbol references to definitions and declarations.
It would just have to track usages, which would look like outbound edges.
Related #217 which needs to use the symbol table for implicit declarations, the opposite of unused signals.
Summary Removing unassigned output or detecting unused input ports is an efficient and clean way to code. This could be part of lint checks.
If you can point me to a lint rule that does something similar, then I can try and contribute to this feature.