Closed WeneneW closed 1 month ago
I will note that using verific
instead of read_verilog
gives identical outputs for vvp_yosys and vvp_identity, meaning this is due to the verilog parsing rather than the synthesis; but trying to identify exactly where the bug is coming from is difficult given the nature of the source provided. Having a quick look at the code, it seems the read_verilog
path has optimised out forvar5
and reg23
which looks like the difference might be coming from the interpretation of if ({(wire2[(1'h1):(1'h0)] ^~ "")})
.
It would be great if you could cut this down to a Minimal, Complete, and Verifiable Example (MCVE) in order to make this easier to identify where the difference is coming from (whether that is a bug, or a different interpretation of the verilog standard and how to treat e.g. strings not assigned a type).
Version
Yosys 0.39+165
On which OS did this happen?
Linux
Reproduction Steps
I encountered an issue of inconsistent simulation before and after synthesis in Yosys. In the original verilog design
rtl. v
, I tested it usingidentity.testbench.v
and outputted its results using the iverilog and vvp commands. Specifically, the command is as follows:The output result is![0142910c5b18098977453acaf354aaf0](https://github.com/YosysHQ/yosys/assets/168843330/9957e61b-dc46-4d09-8be9-86de4d885b1f)
Afterwards, I used yosys to synthesize it, and the command is as follows:
Similarly, simulate the synthesized file with the following command:
The output result is![030769f173f5fe27333d757a6d22a3cb](https://github.com/YosysHQ/yosys/assets/168843330/b8981ec1-3ff7-410c-b769-9da77e604596)
For the convenience of reproduction, I have written a script where you only need to run
bash run_sim.sh
to view the simulation output of vvp in the corresponding folder (you can synthesize syn_yosys. v again to replace the existing one)yosys_5_4.zip
Expected Behavior
Consistent output before and after synthesis In order to eliminate interference, I also simulated the Verilog file synthesized by Vivado, and the results were consistent with those before synthesis![9ee1591bcfe98874c6587685d0fcfce2](https://github.com/YosysHQ/yosys/assets/168843330/de690e20-5118-4336-ac95-7118e6f77b04)
Actual Behavior
Inconsistent output before and after synthesis