Skip to content

Conversation

uenoku
Copy link
Member

@uenoku uenoku commented Jul 3, 2025

This commit adds boilerplates for Python bindings for the AIG dialect.

The implementation includes an AIG C API header with dialect registration and an AIG C API implementation with pass registration. It adds an AIG Python dialect TableGen file and Python dialect module. The AIG Python module C++ bindings are implemented using nanobind.

The implementation follows the standard pattern used by other CIRCT dialects

This commit adds comprehensive Python bindings for the AIG (And-Inverter Graph) dialect.

The implementation includes an AIG C API header with dialect registration and an AIG C API implementation with pass registration.
It adds an AIG Python dialect TableGen file and Python dialect module. The AIG Python module C++ bindings are implemented using nanobind.

The implementation follows the pattern used by other CIRCT dialects
and enables Python users to work with AIG operations like and_inv through the
circt.dialects.aig module.
@uenoku uenoku force-pushed the dev/hidetou/aig-python branch from e8c80ca to efd727f Compare July 3, 2025 03:41
Copy link
Member

@maerhart maerhart left a comment

Choose a reason for hiding this comment

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

LGTM


/// Populate the aig python module.
void circt::python::populateDialectAIGSubmodule(nb::module_ &m) {
m.doc() = "AIG dialect Python native extension";
Copy link
Member

Choose a reason for hiding this comment

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

I guess you are planning to add some type/attr definitions here in a future PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, my plan is to add a binding for LongestPathAnalysis.

@uenoku uenoku merged commit 8fbefed into main Jul 3, 2025
7 checks passed
@uenoku uenoku deleted the dev/hidetou/aig-python branch July 3, 2025 16:04
TaoBi22 pushed a commit to TaoBi22/circt that referenced this pull request Jul 17, 2025
This commit adds comprehensive Python bindings for the AIG (And-Inverter Graph) dialect.

The implementation includes an AIG C API header with dialect registration and an AIG C API implementation with pass registration.
It adds an AIG Python dialect TableGen file and Python dialect module. The AIG Python module C++ bindings are implemented using nanobind.

The implementation follows the pattern used by other CIRCT dialects
and enables Python users to work with AIG operations like and_inv through the
circt.dialects.aig module.
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