-
Notifications
You must be signed in to change notification settings - Fork 159
Fix an assert violation and a SIGSEGV in emap
#683
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
base: master
Are you sure you want to change the base?
Conversation
… from a missing value reset and floating-point type mismatch, and the latter stemming from an overlooked corner case in arrival time propagation
|
I see that my changes cause |
|
Hi Marcel, Thank you for reporting this, could you share the stack trace and how to reproduce? One thing that I notice is that in method should be Let me know if this alone fixes the bug. Thanks, |
|
Hi Alessandro, Many thanks for the quick feedback. I'll run your fix through my test cases and will report back on how it went. I'll see if I can even condense them into a test case for mockturtle to reproduce the issue first-hand. Thanks again! |
|
@aletempiac, as promised, I added a failing test case that triggers the assertions (and throws a I want to emphasize that my changes could very well cause other unintended behavior that I'm simply not aware of, as I do not know the code as well as you do. I'm looking forward to hearing what you think and how to best proceed. |
|
Hi Marcel, I can see that one problem is related to the library not defining the XOR cell. If you use an XAG as a representation {AND2, XOR2, and INV} must be present in the library. Else, I suggest using an AIG. This would solve the problem. Alternatively, you might add an if statement around the assertions testing that Best, |
|
Thanks for the insight, Alessandro! Is there any way to test whether the library is complete for the given initial network type prior to performing the tech mapping? That would enable a smoother integration into user-facing code because it could fail gracefully with meaningful error messages. |
|
What if you check that each primitive is available in the library up to output negation (e.g, AIG: AND2 and INV; XAG: AND2, XOR2, INV). You can add a check over the genlib library matching by truth table. |
|
Thank you, Alessandro. That's how I currently handle it as well. I was kinda hoping that there was a more elegant solution. But if you'd recommend this path instead of code adjustments to |
This PR fixes an
assertviolation and aSIGSEGVin theemaptechnology mapper. The former resulted from a missing value reset and a floating-point type mismatch, and the latter stemmed from an overlooked corner case in arrival time propagation.The two assert statements (lines 1666-1667)
could be triggered because the arrival and required times of
node_dataandnode_matchwere not always correctly re-initialized.Furthermore (line 2364),
could cause a
SIGSEGVwhen neither phase has a best gate. These cases must be skipped.The proposed changes fix these issues.