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

rsz: Add option for Steiner tree amending in net repair #5487

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

povik
Copy link
Contributor

@povik povik commented Jul 31, 2024

Note: This is up so that it can be discussed. There are no plans to get it merged at the moment.

Add an option -amend_tree to repair_design for requesting
timing-aware amending of the Steiner trees used in the repair process.

The buffers inserted by repair_design dictate much of the final buffer
tree topology. The intent with -amend_tree is for repair_design to
place its buffers in a way that has less of a chance of constraining us
into a buffering topology which would be a timing bottleneck later on.

Add an option `-amend_tree` to `repair_design` for requesting
timing-aware amending of the Steiner trees used in the repair process.

The buffers inserted by `repair_design` dictate much of the final buffer
tree topology. The intent with `-amend_tree` is for `repair_design` to
place its buffers in a way that has less of a chance of constraining us
into a buffering topology which would be a timing bottleneck later on.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 50. Check the log or trigger a new build to see more.

BufferedNetPtr pairing_candidate_;
std::vector<BufferedNetPtr> pending_candidates_;

BufferedNet *place_ = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use nullptr [modernize-use-nullptr]

Suggested change
BufferedNet *place_ = NULL;
BufferedNet *place_ = nullptr;


BufferedNet *place_ = NULL;

BufferedNet *upstream_ = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use nullptr [modernize-use-nullptr]

Suggested change
BufferedNet *upstream_ = NULL;
BufferedNet *upstream_ = nullptr;

@@ -141,6 +141,87 @@ int RepairSetup::rebuffer(const Pin* drvr_pin)
return inserted_buffer_count;
}

int RepairSetup::rebuffer(const Pin* drvr_pin, BufferedNetPtr bnet)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'bnet' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
int RepairSetup::rebuffer(const Pin* drvr_pin, BufferedNetPtr bnet)
int RepairSetup::rebuffer(const Pin* drvr_pin, const BufferedNetPtr& bnet)

src/rsz/src/RepairSetup.hh:195:

-   int rebuffer(const Pin* drvr_pin, BufferedNetPtr bnet);
+   int rebuffer(const Pin* drvr_pin, const BufferedNetPtr& bnet);

{
init();
resizer_->incrementalParasiticsBegin();
inserted_buffer_count_ = rebuffer(drvr_pin, bnet);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: parameter 'bnet' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]

src/rsz/src/Rebuffer.cc:35:

- #include "BufferedNet.hh"
+ #include <utility>
+ 
+ #include "BufferedNet.hh"
Suggested change
inserted_buffer_count_ = rebuffer(drvr_pin, bnet);
inserted_buffer_count_ = rebuffer(drvr_pin, std::move(bnet));

copyState(sta_);
}

void dumpBranch(std::ostream &f, BufferedNetPtr net, float scale, int level=0)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'net' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
void dumpBranch(std::ostream &f, BufferedNetPtr net, float scale, int level=0)
void dumpBranch(std::ostream &f, const BufferedNetPtr& net, float scale, int level=0)

left = std::make_shared<BufferedNet>(
BufferedNetType::wire, loc, BufferedNet::null_layer,
left, corner_, resizer_);
if (loc != right->location())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [google-readability-braces-around-statements]

Suggested change
if (loc != right->location())
if (loc != right->location()) {

src/rsz/src/TreeAmending.cc:224:

-             right, corner_, resizer_);
+             right, corner_, resizer_);
+ }

right,
resizer_);

if (loc != net->location())
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [google-readability-braces-around-statements]

Suggested change
if (loc != net->location())
if (loc != net->location()) {

src/rsz/src/TreeAmending.cc:237:

-         else
+         } else

Comment on lines +238 to +239
else
return junc;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: do not use 'else' after 'return' [readability-else-after-return]

Suggested change
else
return junc;
return junc;

return std::make_shared<BufferedNet>(
BufferedNetType::wire, net->location(), BufferedNet::null_layer,
junc, corner_, resizer_);
else
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: statement should be inside braces [google-readability-braces-around-statements]

        else
            ^

this fix will not be applied because it overlaps with another fix

BufferedNetPtr seed = root->pairing_candidate_;
BufferedNet *place = seed->place_;

place->pairing_candidate_ = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use nullptr [modernize-use-nullptr]

Suggested change
place->pairing_candidate_ = NULL;
place->pairing_candidate_ = nullptr;

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.

1 participant