Skip to content

Mark visited nodes in Abc_NtkDontCareWinAddMissing_rec - #569

Merged
aletempiac merged 1 commit into
berkeley-abc:masterfrom
calewis:fix-odc-window-travid
Sep 23, 2026
Merged

aletempiac merged 1 commit into
berkeley-abc:masterfrom
calewis:fix-odc-window-travid

Conversation

@calewis

@calewis calewis commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

While running some abc fuzzing on a saved design I found out that

abc -c 'read_blif input.blif; strash; balance -l; resub -K 6 -F 2 -l'

was exceptionally slow. This one line fix seems to solve the problem.

@calewis

calewis commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Some more testing:

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"

git checkout HEAD~1                && make -j$(nproc) >/dev/null && cp abc abc_unfixed
git checkout fix-odc-window-travid && make -j$(nproc) >/dev/null && cp abc abc_fixed

curl -fsSL https://raw.githubusercontent.com/lsils/benchmarks/master/random_control/mem_ctrl.blif -o /tmp/mem_ctrl.blif

status=0
for f in $(git ls-files '*.aig') /tmp/mem_ctrl.blif /tmp/my_failure.blif; do
  no_f=$(./abc_fixed  -c "read $f; strash; balance -l; resub -K 6 -l; ps"      | tail -n 1 | sed 's/.*: *//')
  fix_f=$(./abc_fixed -c "read $f; strash; balance -l; resub -K 6 -F 2 -l; ps" | tail -n 1 | sed 's/.*: *//')

  echo "=== $f ==="
  echo "  no -F          : $no_f"
  echo "  -F 2 (fixed)   : $fix_f"

  if [[ "$no_f" == "$fix_f" ]]; then
    echo "  [FAIL] Condition 1 failed: -F 2 did not change ps output vs no -F"
    status=1
    continue
  fi

  set +e
  unfix_out=$(timeout 10s ./abc_unfixed -c "read $f; strash; balance -l; resub -K 6 -F 2 -l; ps" 2>&1)
  rc=$?
  set -e

  if [[ $rc -eq 124 ]]; then
    echo "  -F 2 (unfixed) : <TIMED OUT after 10s>"
    echo "  [PASS] (-F 2 differs from no -F) AND (fixed finishes in <0.1s while unfixed hangs!)"
  elif [[ $rc -ne 0 ]]; then
    echo "  [FAIL] abc_unfixed exited with error code $rc"
    status=1
  else
    unfix_f=$(echo "$unfix_out" | tail -n 1 | sed 's/.*: *//')
    echo "  -F 2 (unfixed) : $unfix_f"
    if [[ "$fix_f" != "$unfix_f" ]]; then
      echo "  [FAIL] Condition 2 failed: fixed and unfixed -F 2 ps outputs differ!"
      status=1
    else
      echo "  [PASS] (-F 2 differs from no -F) AND (fixed -F 2 == unfixed -F 2)"
    fi
  fi
done

if [[ $status -eq 0 ]]; then
  echo "OVERALL: ALL CHECKS PASSED"
else
  echo "OVERALL: FAILED"
  exit 1
fi

Gives:

=== i10.aig ===
  no -F          : i/o =  257/  224  lat =    0  and =   2211  lev = 38
  -F 2 (fixed)   : i/o =  257/  224  lat =    0  and =   2164  lev = 38
  -F 2 (unfixed) : i/o =  257/  224  lat =    0  and =   2164  lev = 38
  [PASS] (-F 2 differs from no -F) AND (fixed -F 2 == unfixed -F 2)
=== /tmp/mem_ctrl.blif ===
  no -F          : i/o = 1204/ 1231  lat =    0  and =  46680  lev =114
  -F 2 (fixed)   : i/o = 1204/ 1231  lat =    0  and =  46607  lev =114
  -F 2 (unfixed) : i/o = 1204/ 1231  lat =    0  and =  46607  lev =114
  [PASS] (-F 2 differs from no -F) AND (fixed -F 2 == unfixed -F 2)
=== /tmp/my_failure.blif ===
  no -F          : i/o =  135/  107  lat =    0  and =   1759  lev =100
  -F 2 (fixed)   : i/o =  135/  107  lat =    0  and =   1748  lev =100
  -F 2 (unfixed) : <TIMED OUT after 10s>
  [PASS] (-F 2 differs from no -F) AND (fixed finishes in <0.1s while unfixed hangs!)
OVERALL: ALL CHECKS PASSED

@aletempiac
aletempiac merged commit ccd050b into berkeley-abc:master Sep 23, 2026
9 checks passed
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