Fix assertion failure in Abc_AigUpdateLevelR_int during refactor/rewrite/resub
#458
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a long-standing assertion failure that occurs during logic synthesis commands such as
refactor,rewrite, andresub. The crash happens when updating the reverse level of nodes.Fixes Issues:
issue #271
issue #451
issue #457
Error Log
When running specific benchmarks, the tool aborts with the following assertion error:
Root Cause
The issue is located in the
Abc_AigUpdateLevelR_intfunction. During the recursive update of reverse levels for fanin nodes, the function attempts to process all reachable nodes. However, it failed to filter out constant nodes.When the traversal encounters a constant node, the assertion
Abc_ObjIsNode(pNode)fails because a constant is not considered a standard logic node in this context. The fix ensures that constant nodes are skipped during the reverse level update.Reproduction Steps
The crash can be reproduced using the test cases provided in the related issues (files available here).
Case 1:
./abc -c "read int2float-24.aig; refactor"Case 2:
./abc -c "read RISC.aig; rewrite"Case 3:
./abc -c "read crash_retcode_case.blif; rewrite"Solution
Modified the traversal logic in
Abc_AigUpdateLevelR_intto explicitly check for and skip constant nodes before attempting to access/update their reverse levels.