imc-trading / svlangserver

MIT License
95 stars 13 forks source link

Fix verilator linting for missing modules #4

Closed henry-hsieh closed 2 years ago

henry-hsieh commented 2 years ago

Currently, Verilator can't find module having different name to the filename unless the file is set to library file (adding -v flag prior to the file). Therefore, it can be fixed by changing every indexed file to library file. The feature may be used when a file contains multiple cell modules used by other modules.

kkanhere commented 2 years ago

Thanks for looking at this!

What I am observing though, with this change, is that all the files get linted every time. This causes

  1. Duplicate module/interface/.. declaration warnings for the modules/interfaces/... contained in the file being linted.
  2. Very slow run times on large repos. On my current repo the linting time of a module goes up to 20 secs from 5 secs.

So I am not in favor of this change right now. But suggestions to improve/fix this are very welcome. Right now, in such cases, I would recommend users to edit their verilator command settings and add these options there.

henry-hsieh commented 2 years ago

How about adding a new property systemverilog.libraryIndexing to let users adding their library files? Or simply add a hint in README to remind users adding their library files with -v flag. I'm OK with later option because the library files may not be shared by different projects.

kkanhere commented 2 years ago

Both sound good to me. The new property is slightly involved so I would have to request you to create a pull request for that, if you prefer to go that route. Otherwise I can take care of the documentation in next release.

Thanks!

henry-hsieh commented 2 years ago

OK. I'll create a new pull request for the new property. It may take some time to figure out how to do that. Maybe we can use both of options for now. After the new property is done, the hint of -v flag could be deleted. Thanks!