gpl: memoize signal pin counts per cell master during initialization - #11073
Open
oharboe wants to merge 2 commits into
Open
gpl: memoize signal pin counts per cell master during initialization#11073oharboe wants to merge 2 commits into
oharboe wants to merge 2 commits into
Conversation
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request optimizes the average pin density calculation in PlacerBaseCommon::init by memoizing master signal pin counts using a flat map. However, the implementation changes the pin count types from int to double. The review feedback recommends reverting these types back to int to maintain semantic correctness and consistency with the codebase, while ensuring that proper static casts to double are used during division to avoid integer division bugs.
…teger pin counts Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Collaborator
Author
|
Applied all Gemini review suggestions in commit b9f6571 (using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
During
PlacerBaseCommon::init(), instance pin density calculations previously invokeddbInst::getITerms()andcount_signal_pins()for every instance. On large designs (e.g. 2.4 million instances), this caused millions of (N)$dbNetITermItr::size()linked-list traversals across ODB database structures.Since an instance's pin count is defined by its LEF cell master (
dbMaster), this change memoizes signal pin counts per cell master using a localboost::unordered_flat_mapduringPlacerBaseCommon::init().Benefits & Performance
getMTerms()evaluations from (\text{instances})$ (e.g., 2.4 million) to (\text{unique masters})$ (e.g., ~200).getITerms()iteration overhead during GPL initialization without altering any central ODB structures.bazelisk test //src/gpl/test:simple01-skip-io-tcl_test //src/gpl/test:gpl_messages_txt_check-py_test.