vscode-terosHDL icon indicating copy to clipboard operation
vscode-terosHDL copied to clipboard

verilator linter does not run on Windows (MSYS2/mingw64)

Open iva2k-asic opened this issue 3 months ago • 1 comments

Describe the bug Verilator linter does not show any issues or warnings n Verilog or SystemVerilog files.

To Reproduce

  • Install verilator under MSYS2/Mingw64 on Windows
  • Enable Linter Settings > Verilog/SV Linter: Verilator in TerosHDL Global Config
  • Open any verilog .v file in VSCode
  • Check Output > TerosHDL: Debug, it shows:
2025-09-27 18:35:31.309 [info] Linting with command: verilator --lint-only -Wall -bbox-sys --bbox-unsup -DGLBL -Irtl/verilog/lib -Iverif/lib "c:\dev\hdl\rtl\verilog\fp16\fp16_add.v" 
2025-09-27 18:35:31.422 [info] c:\dev\hdl\rtl\verilog\fp16\fp16_add.v || 'verilator' is not recognized as an internal or external command, operable program or batch file.

Code Any verilog file

Please complete the following information:

  • OS: Windows 11
  • VSCode version version 1.104.2

Additional context Copy-pasting the listed command to git bash terminal runs fine.

verilator --lint-only -Wall -bbox-sys --bbox-unsup -DGLBL -Irtl/verilog/lib -Iverif/lib "c:\dev\hdl\rtl\verilog\fp16\fp16_add.v" 

%Warning-WIDTHTRUNC: c:\dev\hdl\rtl\verilog\fp16\fp16_add.v:191:27: Operator ASSIGN expects 6 bits on the Assign RHS, but Assign RHS's SUB generates 32 bits.
                                                                  : ... note: In instance 'fp16_add'
  191 |                 shift_val = 24 - msb_pos;
      |                           ^
                     ... For warning description see https://verilator.org/warn/WIDTHTRUNC?v=5.040
                     ... Use "/* verilator lint_off WIDTHTRUNC */" and lint_on around source to disable this message.

It works ok and lists issues and warnings it can find in Verilog code.

However, Windows CMD does not run that same command, probably because verilator is a Perl wrapper over verilator_bin.exe and Windows has no idea how to execute it. I suspect it is the core of the problem for TerosHDL.

iva2k-asic avatar Sep 28 '25 01:09 iva2k-asic

Can't really complain it's Teros's issue since Verilator has little support for Windows to begin with, quoting this issue:

I encourage use of WSL instead of windows, or native Linux, not just because of this bug, but as EDA chip industry usage generally uses Linux.

Unlikely to support windows native any time soon so just closing.

Getting cocotb to work with Verilator on Windows is also a nightmare. Basically, if you ask any EDA-related dev team about their projects' Windows compatibility, they will either tell you to

just use WSL if you really want to stick with Windows

or to

switch to Linux sooner than later because nobody in the industry uses Windows to do the job

hiroshi-ya avatar Oct 20 '25 06:10 hiroshi-ya