Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@uenoku
Copy link
Member

@uenoku uenoku commented Aug 25, 2025

This is a follow-up to #8868.

This commit introduces a pass that performs technology-independent LUT mapping from logic network to generic lookup tables (comb.truth_table). The pass is primarily designed for benchmarking purposes and provides functionality equivalent to ABC's if -K 6 command for K-LUT mapping.

The pass supports configurable LUT sizes and uses a cut-based rewriting approach to efficiently map combinational logic from AIG nodes to truth tables. It includes options for maximum LUT size and maximum cuts per root node to control the mapping quality and compilation time. The implementation provides technology-independent LUT mapping with configurable K-LUT support (default K=6), cut enumeration with configurable limits, truth table generation for optimal LUT utilization, and seamless integration with the existing synthesis pipeline.

This commit introduces a new synthesis pass that performs technology-independent
LUT mapping from AIG representation to generic lookup tables.
The pass is primarily designed for benchmarking purposes and provides functionality
equivalent to ABC's `if -K 6` command for K-LUT mapping.

The pass supports configurable LUT sizes and uses a cut-based rewriting approach
to efficiently map combinational logic from AIG nodes to truth tables. It includes
options for maximum LUT size and maximum cuts per root node to control the mapping
quality and compilation time. The implementation provides technology-independent
LUT mapping with configurable K-LUT support (default K=6), cut enumeration with
configurable limits, truth table generation for optimal LUT utilization, and
seamless integration with the existing synthesis pipeline.

This enables efficient FPGA synthesis flows by providing a clean mapping from
optimized AIG representations to generic LUT structures that can be further
processed by technology-specific mappers, while also serving as a benchmarking
tool to compare synthesis results.
@uenoku uenoku force-pushed the dev/hidetou/lut-mapping branch from a7e4065 to 2076fe7 Compare August 25, 2025 08:23
Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! I love how lightweight the cut rewriter is 👍

Comment on lines +59 to +64
// LUT: hw.module @mul
// LUT: comb.truth_table
// LUT-NOT: aig.and_inv
// LUT-NOT: comb.and
// LUT-NOT: comb.xor
// LUT-NOT: hw.instance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love how much the LEC tool simplifies these synthesis tests 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah otherwise it's impossible to keep correctness...

Comment on lines +592 to +594
// If the pattern does not provide NPN classes, we use a special key
// to indicate that it should be considered for all cuts.
nonTruthTablePatterns.push_back(pattern.get());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever

@uenoku uenoku merged commit a04a76e into main Aug 25, 2025
7 checks passed
@uenoku uenoku deleted the dev/hidetou/lut-mapping branch August 25, 2025 19:03
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