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

Convert power of 2 $pow cells to shift #4896

Open
georgerennie opened this issue Feb 12, 2025 · 0 comments
Open

Convert power of 2 $pow cells to shift #4896

georgerennie opened this issue Feb 12, 2025 · 0 comments

Comments

@georgerennie
Copy link
Collaborator

Feature Description

Yosys understandably doesn't bother trying to synthesize $pow cells as there is no sensible way of lowering them in a general way, but for the specific case of the first argument being a power of 2, it can be converted to a left shift in a standard optimization.

Although ideally users should try not to use ** in the synthesised part of their code, there are some real world examples where it is being used in this manner, and it would be good to be able to support them.

This probably should be a peepopt or opt_expr rule.

@georgerennie georgerennie changed the title Convert power of 2 $pow calls to shift Convert power of 2 $pow cells to shift Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant