Skip to content
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

extract_fa: Fix xor3/xnor3 inversion bug #4691

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hovind
Copy link

@hovind hovind commented Oct 30, 2024

What are the reasons/motivation for this change?

The extract_fa pass seems to have issues when an odd number of inputs are inverted, this is previously reported in #3879 and #4573.

I think @eddiehung solved this is the xor2/xnor2 case in #1297, but I the xor3/xnor3 case lacks the equivalent logic.

Explain how this is achieved.

Similarly to how it is handled in the xor2/xnor2 case, we invert the xor3/xnor3 output if the majority3 has an odd number of inverted inputs.

If applicable, please suggest to reviewers how they can test the change.

I have tried to make this break using @jix's test case from #3882.

I don't have much confidence in my understanding of this code, and I hope that some discussion here will help clarify some things for me.

9421558 should perhaps be in a separate pull request (or probably just deleted). I left it in so I could ask if somebody could help clarify to me what the deleted code segment achieves.

84d0c8f I thought initially this was a bug fix, but I'm not sure invert_xy and f2i.inv_a ^ f2i.inv_b can be true at the same time?

Thanks for the amazing tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants