Open eactor opened 1 year ago
I got different message like the following
$ verilator --sc --top-module counter --pins-sc-uint counter.sv --Mdir C:/workspaces/verilator_workdir
%Error: Need $SYSTEMC_INCLUDE in environment or when Verilator configured,
and need $SYSTEMC_LIBDIR in environment or when Verilator configured
Probably System-C isn't installed, see http://www.systemc.org
Is it the right output? Could you make sure that antivirus software is not blocking the process by excluding msys2 installation directory in that software?
I am using same Windows 10 build 19045 and MINGW64. I have created the C:/workspaces/verilator_workdir
directory before running the verilator command.
Thanks for looking into the problem. Could you please replace --sc with --cc to create C++ output instead of SystemC. The error message only says that you don't have SystemC available.
replace --sc with --cc to create C++ output instead of SystemC.
After doing that, the command worked fine. No error or normal message output.
Oh, wait a sec. I missed the point "if perl is installed". After installing mingw-w64-x86_64-perl I got the same error as you got.
$ verilator --cc --top-module counter --pins-sc-uint counter.sv --Mdir C:/workspaces/verilator_workdir
The system cannot find the path specified.
%Error: Cannot write C\:/workspaces/verilator_workdir/Vcounter__Syms.cpp
I shall try to debug it.
hi guys i've got verilator to install and I used the command to compile the counter.sv file. I only have the msys-perl installed. all the counter files are written into the C:/workspaces/verilator_workdir. verilator.txt
The msys2 perl package does not create the issue which I did in first comment. This issue seems to happen only when mingw perl is installed.
I have found the cause. The file "verilator" is a perl script which has this shebang line #!/usr/bin/env perl
. The env perl
command returns /mingw64/bin/perl.exe
. If mingw perl is not installed the "verilator" perl script is interpreted by /usr/bin/perl.exe
without any issue. So, the main issue may be the difference between mingw perl and msys perl and their interpretation of Windows paths in that verilator script. Sadly, I am not familiar with perl language. @umarcor may provide some helpful info.
BTW, the verilator perl script executes verilator_bin which is the actual Win32 exe. So, the later one works.
$ verilator --cc --top-module counter --pins-sc-uint counter.sv --Mdir C:/workspaces/verilator_workdir
The system cannot find the path specified.
%Error: Cannot write C\:/workspaces/verilator_workdir/Vcounter__Syms.cpp
$ verilator_bin --cc --top-module counter --pins-sc-uint counter.sv --Mdir C:/workspaces/verilator_workdir
$ echo $?
0
This explains my observation that verilator always installs perl in other environments. As the msys perl is always installed as pacman dependency.
Description / Steps to reproduce the issue
Using a absolute path for the Mdir option in verilator fails if also mingw-w64-x86_64-perl is installed on the system. Reproduce:
Notes: Looking into other environments it seems verilator always has dependencies to perl which are installed, but not within msys2. Uninstalling perl fixes the issue as well but might not be an option. Last version that worked for me 4.106 stopped working 4.226 or earlier.
Simple System Verilog - Example:
Expected behavior
Run without error.
Actual behavior
XYZ@PC MINGW64 /c/workspace/sv_example $ verilator --version Verilator 5.002 2022-10-29 rev UNKNOWN.REV $ which verilator /mingw64/bin/verilator verilator --sc --top-module counter --pins-sc-uint counter.sv --Mdir C:/workspaces/verilator_workdir %Error: Cannot write C\:/workspaces/verilator_workdir//Vcounter__Syms.cpp
Verification
Windows Version
MINGW64_NT-10.0-19045
MINGW environments affected
Are you willing to submit a PR?
No response