Skip to content

lutabsorb: use the LUT library for K limits and area gain - #592

Open
flyingfoxyy wants to merge 1 commit into
berkeley-abc:masterfrom
flyingfoxyy:lutabsorb
Open

flyingfoxyy wants to merge 1 commit into
berkeley-abc:masterfrom
flyingfoxyy:lutabsorb

Conversation

@flyingfoxyy

Copy link
Copy Markdown
Contributor

Summary

fabsorb removed a multi-fanout LUT whenever every fanout still fit in K inputs, implicitly assuming that removing one LUT always saves one LUT. When a LUT library is installed, LUT area depends on its input count, so that assumption can increase area.

This PR renames the command to lutabsorb and makes it library-aware:

  • Effective K is capped by the library's LutMax. The default is min(6, LutMax); an explicit -K above LutMax is truncated with a warning.
  • A candidate is absorbed only when area(u) + sum(area(v_old)) - sum(area(v_new)) > 0, using pLutAreas[fanin_count] from the installed library. The total area gain is reported.
  • Candidates involving nodes with more fanins than LutMax are skipped, since the library cannot price them.

The rename covers the command, the Abc_NtkLutAbsorb API, the source file, and the build lists. With the default 4-input library (unit areas) the gain equals the number of removed LUTs, so existing behavior is preserved.

Tests

  • make -j$(nproc) succeeds.
  • Integration cases cover K truncation (default and 6-input libraries), negative/positive area gain, and default K = min(6, LutMax).
  • r i10.aig; if -K 4; lutabsorb; cec and read_lut (6-input area lib); r i10.aig; if; lutabsorb; cec both remain equivalent.
  • The CI smoke command and test/mf_maprefs_overflow.sh pass.

Rename the fabsorb command, API, and source file to lutabsorb, and use
the installed LUT library when deciding what to absorb:

- Default K is min(6, LutMax); an explicit -K above LutMax is truncated
  to LutMax with a warning.
- Absorb a multi-fanout LUT only when the removal reduces total LUT area
  computed from the library's area table, and report the area gain.
- Skip candidates involving nodes with more fanins than LutMax, where
  the area table cannot be queried.

The default 4-input library has unit areas, so its gain equals the
number of removed LUTs.
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.

1 participant