Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Transforms][circt-synth] Add HierarchicalRunner pass #8254

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

uenoku
Copy link
Member

@uenoku uenoku commented Feb 18, 2025

Add a new pass that allows running passes under hierarchy. This is useful when we want to run synthesis passes only on real designs.

This implementation is based on MLIR's upstream CompositePass and Inliner utilities. The pass takes a pipeline string and runs it on modules in the design hierarchy. It supports configurable options including the pipeline to run under hierarchy, the name of the top-level module, and whether to include bound instances in the hierarchy traversal.

The implementation updates circt-synth tool with the required library dependencies and necessary dialect and pass headers.

Add a new pass that allows running passes under hierarchy. This is useful when
we want to run synthesis passes only on real designs.

This implementation is based on MLIR's upstream CompositePass and Inliner utilities.
The pass takes a pipeline string and runs it on modules in the design hierarchy.
It supports configurable options including the pipeline to run under hierarchy,
the name of the top-level module, and whether to include bound instances in
the hierarchy traversal.

The implementation updates circt-synth tool with the required library
dependencies and necessary dialect and pass headers.
Copy link
Contributor

@Max-astro Max-astro left a comment

Choose a reason for hiding this comment

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

Running different passes by module hierarchy is a valuable feature, especially when a designer wants to ungroup (inline) certain kinds of modules by some rules. It's good to know you implemented this feature. Nice job!

Comment on lines +88 to +90
auto *node = worklist.pop_back_val();
if (!node)
continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious about the pop-out node. In what situation will it be nullptr?

for (auto *child : *node) {
auto childOp = child->getInstance();
if (!childOp ||
(!includeBoundInstances && childOp->hasAttr("doNotPrint")))
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the "doNotPrint" attribute have the same semantics as "set_dont_touch" in SDC?

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