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

Speed up simplemap_mux by 9.6x. #3968

Merged
merged 3 commits into from
Oct 2, 2023
Merged

Conversation

rmlarsen
Copy link
Contributor

@rmlarsen rmlarsen commented Sep 29, 2023

This is accomplished by directly inserting the cell source attribute in the new object's 'attributes' map instead of creating a new attribute pool and then copying that. Based on a suggestion by Martin Poviser in a comment on #3959

Topdown view before:
image

Topdown view after:
image

… attribute in the new object's 'attributes' map instead of calling set_attr_pool to create a new pool and then copying that. Based on a suggestion by Martin Poviser in a comment on YosysHQ#3959
@rmlarsen rmlarsen changed the title Speed up simplemap_map by 11.6x. Speed up simplemap_mux by 11.6x. Sep 29, 2023
@rmlarsen
Copy link
Contributor Author

Formatting PR in #3969

@Ravenslofty
Copy link
Collaborator

I'm inclined to believe this should not be reformatted; it's a two line patch with 250 lines of unrelated changes, which makes it much more difficult to review.

Perhaps we can start by splitting "the patch" as a commit from the reformatting.

@povik
Copy link
Member

povik commented Sep 29, 2023

It's a two line patch with 250 lines of unrelated changes, which makes it much more difficult to review.

FWIW it's more than a two-line patch since Rasmus seems to have gone through other occurrences of the same pattern. Of course that not being obvious is even more of an argument for splitting the formatting from other changes.

Rasmus, I understand there may be frustration from on one hand being told not to include any extra whitespace changes in your patches and on the other hand seeing pushback on #3969. I feel like how we approach formatting is something that would benefit from a bit of discussion among Yosys maintainers.

@povik
Copy link
Member

povik commented Sep 29, 2023

Not sure what the CI failure is about:

 make[1]: *** [macc.sh] Error 255

Let's see if I can trigger a re-run.

@rmlarsen
Copy link
Contributor Author

rmlarsen commented Sep 29, 2023

It's a two line patch with 250 lines of unrelated changes, which makes it much more difficult to review.

FWIW it's more than a two-line patch since Rasmus seems to have gone through other occurrences of the same pattern. Of course that not being obvious is even more of an argument for splitting the formatting from other changes.

Rasmus, I understand there may be frustration from on one hand being told not to include any extra whitespace changes in your patches and on the other hand seeing pushback on #3969. I feel like how we approach formatting is something that would benefit from a bit of discussion among Yosys maintainers.

Yup, I'd appreciate some clear guidance, one way or the other.

@rmlarsen
Copy link
Contributor Author

FWIW, contributing to Yosys is nowhere close to my day job, so I am trying to find the most friction-less way to land these improvements.

@rmlarsen
Copy link
Contributor Author

Let me back the formatting changes out of this PR for now.

@povik
Copy link
Member

povik commented Sep 29, 2023

So it seems the CI failure is not a fluke. I wonder what could have changed to be at fault here.

@rmlarsen
Copy link
Contributor Author

rmlarsen commented Sep 29, 2023

@povik let's see if it still fails after I roll back the formatting changes. Hang on...

@rmlarsen
Copy link
Contributor Author

rmlarsen commented Sep 29, 2023

@povik @Ravenslofty PTAL

@rmlarsen
Copy link
Contributor Author

rmlarsen commented Sep 29, 2023

Hmm the test still fails on macOS. I'm afraid I don't understand how to debug this effectively.

@whitequark
Copy link
Member

Also on Linux, with a similar error: https://github.com/YosysHQ/yosys/actions/runs/6356727207/job/17266798637

@rmlarsen
Copy link
Contributor Author

@whitequark thanks. I'm able to replicate here, after installing iverilog.

@rmlarsen
Copy link
Contributor Author

Reverted changes to techmap.cc, which had no significant impact on timing anyway. PTAL.

@rmlarsen rmlarsen changed the title Speed up simplemap_mux by 11.6x. Speed up simplemap_mux by 9.6x. Sep 29, 2023
@rmlarsen
Copy link
Contributor Author

OK, it did have a small impact on timing. The speedup drops from 11.6x to 9.6x. I can live with that. :-)

Copy link
Collaborator

@Ravenslofty Ravenslofty left a comment

Choose a reason for hiding this comment

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

I'm happy to merge this if someone else is.

@povik
Copy link
Member

povik commented Oct 2, 2023

Go ahead!

@Ravenslofty Ravenslofty merged commit 1bbc12f into YosysHQ:master Oct 2, 2023
15 checks passed
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.

4 participants