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
Wrong simulation result with adders and single-bit exclusive or gates #4709
Comments
There's a lot of code there to look at.
|
Thank you for your fast response! I found a significantly simpler occurrence in the meanwhile. I'll go through the steps that you said and will let you know shortly 👍 |
Hi @wsnyder, thank you again for your instructions. Verilog only: The bug happens as well with a sv testbench instead of C++. Case reduction: Here is a far smaller test case with a similar issue:
where the input is set to 0x5b85eb56. Results of optimizer deactivations: The results are super interesting.
Please note that running with traces enabled also produces a wrong result in that case, and different from without traces. Thanks! |
Hi there!
Summary
I found a bug where Verilator produces a wrong simulation result in a circuit made of XOR gates and adders.
One output bit is erroneous (
out_data[160]
in the specific case below) for some specific inputs.Reproducing
You can find here a repository for helping you reproduce the issue.
This Docker image runs the same simulation with and without traces and gives different results. Icarus Verilog agrees with the result of Verilator with traces.
In
inputs.txt
, you will find some inputs that cause a mismatch on bitout_data[160]
.I'm using the latest Verilator version
Verilator 5.019 devel rev v5.018-44-gb8417abee
on Ubuntu 20.04.Please let me know if you need more information.
Thanks!
Flavien
The text was updated successfully, but these errors were encountered: