Fix two bugs causing problems with &trace and boxes.#481
Merged
alanminko merged 1 commit intoberkeley-abc:masterfrom Feb 21, 2026
Merged
Fix two bugs causing problems with &trace and boxes.#481alanminko merged 1 commit intoberkeley-abc:masterfrom
alanminko merged 1 commit intoberkeley-abc:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix two bugs causing problems in &trace with boxes
Fork: jon-greene/abc
Branch: fix-req-time-with-boxes
Changed files:
src/aig/gia/giaSpeedup.c
src/aig/gia/giaAiger.c
BUG 1: Tim_ManGetCoRequired warning
Symptom:
When running &trace on designs with cascading boxes (two or more boxes
connected in series), the following warning is printed:
Tim_ManGetCoRequired(): Output required times of output 0 the box 1
are not up to date!
Cause:
In Gia_ManDelayTraceLut() (giaSpeedup.c), the box output CI level
correction loop reads the CO object level:
But the CO object level was set by Gia_ManLevelNum before the CI level
corrections ran. For a box input CO whose fanin is a previous box's
output CI, the CO object level is stale (based on the CI's pre-correction
level of 0).
Example with two cascading boxes: Box 0's output CI w1 gets corrected
to level 3, but Box 1's input CO for w1 still has object level 0.
Box 1's output CI w2 then gets level 1 (maxLevel 0 + 1) instead of
level 4. In Gia_ManOrderReverse, w2 at level 1 is processed after
CO(w1->box1) at fanin level 3, causing Tim_ManGetCoRequired to find
that w2's required time has not been set yet.
Fix:
Read the CO's fanin level instead of the CO object level:
The fanin level reflects any prior CI corrections, so cascading boxes
pick up the corrected levels and their output CIs are placed at high
enough levels in Gia_ManOrderReverse.
BUG 2: XAIG ReqTime sentinel value
Symptom:
The output XAIG file contains ReqTime = 1000000000 (TIM_ETERNITY) for
unconstrained outputs. Per the XAIG spec, unconstrained required times
should be written as -1.0.
Cause:
In Gia_AigerWriteSimple() (giaAiger.c), Tim_ManGetReqTimes() returns
raw float values which may contain TIM_ETERNITY (1000000000). The code
writes these directly to the file via fwrite without converting them
to the XAIG spec's -1.0 sentinel.
Fix:
Write side (extension "o"): After Tim_ManGetReqTimes() and before
fwrite(), convert any values >= TIM_ETERNITY to -1.0.
Read side (extension "o"): After reading the required time array,
convert any values < 0 back to TIM_ETERNITY for internal use.