-
Notifications
You must be signed in to change notification settings - Fork 867
grt: Implement timing-driven net sorting for incremental CUGR #9828
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
Changes from all commits
2965e01
5758666
a0bb38d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| exports_files([ | ||
| "bzl_fmt_test.sh", | ||
| "bzl_lint_test.sh", | ||
| "bzl_tidy.sh", | ||
| ]) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| # Capture absolute path BEFORE changing directories | ||
| BUILDIFIER_BIN=$(realpath "$1") | ||
|
|
||
| if [ -n "$BUILD_WORKSPACE_DIRECTORY" ]; then | ||
| cd "$BUILD_WORKSPACE_DIRECTORY" | ||
| fi | ||
|
|
||
| "$BUILDIFIER_BIN" -r -mode=check -lint=off . |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| BUILDIFIER_BIN=$(realpath "$1") | ||
|
|
||
| if [ -n "$BUILD_WORKSPACE_DIRECTORY" ]; then | ||
| cd "$BUILD_WORKSPACE_DIRECTORY" | ||
| fi | ||
|
|
||
| "$BUILDIFIER_BIN" -r -mode=check -lint=warn . |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| BUILDIFIER_BIN=$(realpath "$1") | ||
|
|
||
| if [ -z "$BUILD_WORKSPACE_DIRECTORY" ]; then | ||
| echo "Error: This script must be run via 'bazelisk run'" | ||
| exit 1 | ||
| fi | ||
|
|
||
| cd "$BUILD_WORKSPACE_DIRECTORY" | ||
| "$BUILDIFIER_BIN" -r -mode=fix -lint=fix . | ||
| echo "Buildifier tidy complete!" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| bazelisk run //:tidy_bzl |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -656,6 +656,22 @@ void CUGR::updateNet(odb::dbNet* db_net) | |
| updated_nets_.insert(db_net); | ||
| } | ||
|
|
||
| void CUGR::removeRouteUsage(odb::dbNet* db_net) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where's this function used? I believe the first lines of the |
||
| { | ||
| auto it = db_net_map_.find(db_net); | ||
| if (it != db_net_map_.end()) { | ||
| GRNet* gr_net = it->second; | ||
| if (gr_net->getRoutingTree()) { | ||
| grid_graph_->removeTreeUsage(gr_net->getRoutingTree()); | ||
| } | ||
| } else { | ||
| logger_->warn(GRT, | ||
| 601, | ||
| "Net {} not found in CUGR for rip-up.", | ||
| db_net->getConstName()); | ||
| } | ||
| } | ||
|
|
||
| void CUGR::startIncremental() | ||
| { | ||
| incremental_mode_ = true; | ||
|
|
@@ -664,11 +680,26 @@ void CUGR::startIncremental() | |
|
|
||
| void CUGR::rerouteNets(std::vector<int>& net_indices) | ||
| { | ||
| // Combined loop for rip-up and slack querying for performance optimization | ||
| for (const int idx : net_indices) { | ||
| if (gr_nets_[idx]->getRoutingTree()) { | ||
| grid_graph_->removeTreeUsage(gr_nets_[idx]->getRoutingTree()); | ||
| GRNet* gr_net = gr_nets_[idx].get(); | ||
| if (gr_net->getRoutingTree()) { | ||
| grid_graph_->removeTreeUsage(gr_net->getRoutingTree()); | ||
| } | ||
|
|
||
| if (sta_ != nullptr) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need this sta_ check (here and below). |
||
| odb::dbNet* db_net = gr_net->getDbNet(); | ||
| float slack = getNetSlack(db_net); | ||
| gr_net->setSlack(slack); | ||
| } | ||
| } | ||
|
|
||
| // 3. Sort: Most negative slack (critical) nets go FIRST | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment seems a bit out of place - where are steps |
||
| if (sta_ != nullptr) { | ||
| sortNetIndices(net_indices); | ||
| } | ||
|
Comment on lines
684
to
+700
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For better performance, the loop for ripping up nets and the loop for querying slacks can be merged into a single loop. This avoids iterating over for (const int idx : net_indices) {
GRNet* gr_net = gr_nets_[idx];
if (gr_net->getRoutingTree()) {
grid_graph_->removeTreeUsage(gr_net->getRoutingTree());
}
if (sta_ != nullptr) {
odb::dbNet* db_net = gr_net->getDbNet();
float slack = getNetSlack(db_net);
gr_net->setSlack(slack);
}
}
// 3. Sort if timing is available
if (sta_ != nullptr) {
// Sort: Most negative slack (critical) nets go FIRST
sortNetIndices(net_indices);
}References
|
||
|
|
||
| // 4. Run the routing stages in prioritized order | ||
| patternRoute(net_indices); | ||
| patternRouteWithDetours(net_indices); | ||
| mazeRoute(net_indices); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: out-of-line definition of 'removeRouteUsage' does not match any declaration in 'grt::CUGR' [clang-diagnostic-error]