Skip to content

[InferReadWrite] Update the heuristic to infer the enable signal #6862

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

prithayan
Copy link
Contributor

This commit updates the heuristic to infer the enable signal drivers. Since temporary wires can be introduced by circt passes, the immediate getConnectSrc is not enough to infer the enable signal that might also drive the wmode.
Traverse the assignment chain to get all the temporary wires that can potentially drive the enable. Use the set to simplify the write mode expression.

Comment on lines +424 to +432
void getEnableDrivers(Value enable, llvm::SmallDenseSet<Value> &enableSet) {
while (auto src = getConnectSrc(enable)) {
if (!enableSet.insert(src).second)
return;
if (!isa_and_nonnull<WireOp>(src.getDefiningOp()))
return;
enable = src;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is almost identical to what firrtl::getModuleScopedDriver provides. Can we use/extend that helper function?

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