-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
Fix simulation failure with Verilator v5.x on Windows #1618
base: dev
Are you sure you want to change the base?
Conversation
So, the assumption is that sh.exe is installed in the environment. |
This PR is not the first to introduce sh.exe, it has been used by spinalHDL to run verilatorScript.sh for a long time. If it worked before, it should not be a problem here. |
Ahhh right sh.exe is alread used when generating the cache, should be all good then. All good for merge @Readon ? |
Unfortunately, I could not make it work on MSYS2 environment.
However, in dev branch it works. |
So I find that when this PR is applied, then VERILATOR_ROOT should not be set. |
Yes, in this way the original documentation still applies. Forget about any additional operations from the issue. The only problem is, the simulation task won't exit on my machine. Is that reproducible on yours? This only happens for Verilator v5.x. |
In some cases, it would not stop too. That's why I always recommand do not use the version 5. |
Closes #1572
Context, Motivation & Description
Simulation with verilator v5.x on Windows will fail with the following error:
It is caused by invoking
verilator_bin.exe
directly to get its version:SpinalHDL/sim/src/main/scala/spinal/sim/VerilatorBackend.scala
Line 576 in fb2a8df
However, since verilator v5.x, the
verilator_bin.exe
file in/mingw64/bin
installed with the MSYS2 package is actually a perl script. It runs as a normal perl script in the Unix-like MSYS2 shell, but will fail if run directly on Windows.So it might be better to specify the shell, just like how spinalHDL runs
verilatorScript.sh
later:SpinalHDL/sim/src/main/scala/spinal/sim/VerilatorBackend.scala
Lines 688 to 691 in fb2a8df
This way we can also use a single
val verilatorBinFilename = "verilator"
for both Windows and Linux.Impact on code generation
No impact, ideally.
Checklist
/** */
?No changes to unit tests or API.
Additional Contents
It works for simple cases on my machine. But there are still two problems: