Skip to content

Add ABC9 command &lutabsorb - #616

Open
flyingfoxyy wants to merge 2 commits into
berkeley-abc:masterfrom
flyingfoxyy:feature/gia-lutabsorb
Open

flyingfoxyy wants to merge 2 commits into
berkeley-abc:masterfrom
flyingfoxyy:feature/gia-lutabsorb

Conversation

@flyingfoxyy

Copy link
Copy Markdown
Contributor

Adds &lutabsorb, the ABC9 counterpart of the Abc-network lutabsorb
command, for LUT-mapped GIAs.

Behavior

&lutabsorb absorbs a multi-fanout LUT u (2..M LUT fanouts) into all of
its fanout LUTs when every merged cut fits in K inputs. With a LUT library,
the removal must also reduce the total LUT area, using the same gain formula
as lutabsorb.

Options match lutabsorb:

  • -K num — max LUT size after absorption; giving -K disables the LUT library
  • -M num — max fanout count of a candidate LUT (default 8)
  • -R num — number of passes (default 1)
  • -v, -h

The library comes from Abc_FrameReadLibLut(), with default
K = min(6, LutMax).

Implementation

The command rewrites only vMapping; the AIG is untouched, so equivalence
holds by construction. LUT-level fanouts are the LUT roots whose cut leaves
contain u. Candidate LUTs driving COs or buffers are skipped. LUTs whose
cuts change lose their mux trailing annotation, while unchanged LUTs keep
it; a no-op run leaves the mapping and derived data (packing, cell mapping,
edges) intact.

Testing

  • test/gia_lutabsorb.sh covers default and custom LUT libraries,
    -K/-M/-R, CO-driver skipping, &put + cec equivalence, the
    no-mapping error, an &if smoke test, and no-op preservation of packing
    data. It is wired into both POSIX CI workflows.
  • QoR parity with the original lutabsorb: on 6 designs x 7 mapping flows
    (&if -K 6, &if -K 4, &if, &jf/&lf/&mf -K 6) and 3 designs x 2
    custom LUT libraries, the number of removed LUTs, the final network size
    after &put, and the area gain are identical to running &put; lutabsorb
    on the same mapped network.
  • The suite was also fuzzed over ~500 mapping/optimization flows with
    &put + cec and checked with valgrind; all equivalent and clean.

Add &lutabsorb for LUT-mapped GIAs, mirroring the Abc-network
lutabsorb: a multi-fanout LUT with 2..M LUT fanouts is absorbed into
every fanout when each merged cut fits in K inputs; with a LUT
library the removal must also reduce the total LUT area.

The command rewrites only vMapping; the AIG is untouched, so
equivalence holds by construction. Candidate LUTs driving COs or
buffers are skipped. LUTs whose cuts change lose their mux trailing
annotation, while unchanged LUTs keep it; a no-op run leaves the
mapping and the derived data (packing, cell mapping, edges) intact.

Options match lutabsorb: -K (disables the LUT library), -M, -R, -v.
The library comes from Abc_FrameReadLibLut(), with default
K = min(6, LutMax).

Add test/gia_lutabsorb.sh and wire it into both POSIX CI workflows.
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