-
Notifications
You must be signed in to change notification settings - Fork 894
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
LEC failed after yosys synthesis #3879
Comments
Fixes what seems to be a missing inversion of the xor output when the heueristic decides to use an inverted FA. Fixes YosysHQ#3879
I could reproduce this and found what I think is a missing inversion in extract_fa (see #3882) that seems to be the reason, but I'm not super confident that adding it there doesn't break another case. I suspect the windows version wasn't affected because the synth output was slightly different, thus using slightly different code paths in extract_fa. |
Thank you for the answer!
|
Version
up to 0.32
On which OS did this happen?
Linux
Reproduction Steps
Yosys makes wrong full adder extraction in the case of adding multiple bits. Minimal example of such behaviour is the sum of 4 bits. Initial RTL:
Simple script for Yosys, with extract_fa command:
I've analysed output file and graphical representation. It have obvious inequivalence to the initial RTL. But to be consistent, I've made a script for equivalence check:
Interesting part is that on LINUX builds I get this problem and wrong netlist. But then I tried to run this testcase on Windows pre-built binaries, and everything was fine - output netlist was correct, and equivalence was prooved. So in next sections I will submit Windows results like "Expected Behaviour", and Linux results like "Actual Behaviour".
Analysing wrong results you can verify that I[0] should be XOR of D[0], D[1], D[2], D[3]. But in resulted netlist we get I[0] as XOR of ~D[0], ~D[1], D[2], ~D[3]. It gets mismatch already on test vector (0, 0, 0, 0). Equivalence script expectedly indicates a mismatch.
In correct (windows) netlist we still have some unnecessary inversions, but logic functions are equivalent to RTL. For example I[0] = ~((~D[0])^(~D[1])^(~D[3]))^D[2] and it is equivalent to XOR of D[0], D[1], D[2], D[3]. Equivalence script indicates Induction step proven: SUCCESS!
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: