Skip to content

lutabsorb: make -K disable the LUT library - #608

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

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

Conversation

@flyingfoxyy

Copy link
Copy Markdown
Contributor

Summary

lutabsorb let the installed LUT library override an explicit -K: the default LUT size was computed as min(6, LutMax), and when -K exceeded LutMax it was truncated to LutMax with only a warning. Since ABC installs a built-in 4-input LUT library at startup (If_Init), lutabsorb -K 6 actually ran with K=4 and skipped every candidate node with more than 4 fanins.

This makes -K behave the same way as in the if command: when -K is given, the LUT library is disabled and the requested LUT size is honored exactly. When -K is not given, the library is still used for the default LUT size and the area check. Without a library there is no area model, so the verbose per-round line and the final summary no longer print an area gain.

Test

Without -K, the default library is still used (K = 4 with the built-in library). With -K 6 the size is honored:

abc 01> if -K 6 -a
abc 02> lutabsorb -v -K 6
Round 1: removed 3 nodes.
lutabsorb: K=6 M=8 R=1  nodes 569 -> 566 (-3)

With a library (built-in or read with read_lut), the area gain is still reported:

abc 01> read_lut lut6.txt
abc 02> lutabsorb -v
Round 1: removed 3 nodes, area gain 3.00.
lutabsorb: K=6 M=8 R=1  nodes 569 -> 566 (-3)  area gain 3.00

test/issues/issue70.sh passes.

An explicit -K now takes precedence over the LUT library, matching the
behavior of the if command. Without a library no area gain is printed.
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