Skip to content

Revert "Undo the pad changes and save them for later"#10314

Merged
gadfort merged 6 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:bzl-rdl
Jun 8, 2026
Merged

Revert "Undo the pad changes and save them for later"#10314
gadfort merged 6 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:bzl-rdl

Conversation

@openroad-ci

Copy link
Copy Markdown
Collaborator

This reverts commit d7e11c6.

Summary

Make rdl more deterministic

Type of Change

  • Bug fix

Impact

Makes the tests pass in bazel and cmake

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have included tests to prevent regressions.
  • I have signed my commits (DCO).

Related Issues

[Link issues here]

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request improves the stability and determinism of the RDL router by incorporating lexicographical comparisons (names and IDs) into sorting logic and map keys. It also introduces a tie-breaking direction bias in edge weight calculations. Review feedback focuses on performance optimizations, specifically recommending the use of std::string_view instead of std::string to avoid unnecessary heap allocations during frequent comparisons. Additionally, it is suggested to replace a hardcoded magic number in the edge weight logic with a named constant and provide a clarifying comment regarding the heuristic rationale.

Comment thread src/pad/src/RDLRoute.cpp Outdated
Comment thread src/pad/src/RDLRoute.cpp Outdated
Comment thread src/pad/src/RDLRoute.cpp Outdated
Comment thread src/pad/src/RDLRouter.cpp Outdated
Comment thread src/pad/src/RDLRouter.cpp Outdated
Comment thread src/pad/src/RDLRouter.cpp
Comment thread src/pad/src/RDLRouter.h Outdated
Comment thread src/pad/src/RDLRouter.h Outdated
@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@gadfort gadfort left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure why the string compares are needed (seems very expensive vs comparing the DB IDs).
Also in all cases if the names match the id's will also match correct?

Comment thread src/pad/src/RDLRoute.cpp Outdated
Comment thread src/pad/src/RDLRoute.cpp Outdated
Comment thread src/pad/src/RDLRouter.cpp Outdated
Comment thread src/pad/src/RDLRouter.cpp Outdated
Comment thread src/pad/src/RDLRouter.h Outdated
Comment thread src/pad/src/RDLRouter.h Outdated
maliberty added 3 commits June 7, 2026 03:15
This reverts commit d7e11c6.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
dbITerm::getName() returns std::string by value (constructed on the
fly), so binding the result to std::string_view leaves the view
aliasing a destroyed temporary at the next statement. Switch the two
sort/compare sites in RDLRoute to const std::string& -- lifetime
extension of the temporary keeps the reference valid -- and apply the
same const-ref form to the DbNetPtrLess / DbITermPtrLess comparators in
RDLRouter.h to avoid an unnecessary copy. Drop the now-unused <map>
include from RDLRoute.h and the <string_view>/<tuple> includes from
RDLRoute.cpp.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@openroad-ci openroad-ci requested a review from a team as a code owner June 7, 2026 03:26
@openroad-ci openroad-ci requested a review from maliberty June 7, 2026 03:26
@maliberty

maliberty commented Jun 7, 2026

Copy link
Copy Markdown
Member

@gadfort I've rebased, please review.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>

@gadfort gadfort left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are two of the tests listed as pass/fail?

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty

Copy link
Copy Markdown
Member

Why are two of the tests listed as pass/fail?

The both check for an expected failure.

@gadfort

gadfort commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

@maliberty but why the need to change them for bazel? We have other tests that check to failures.

@maliberty

Copy link
Copy Markdown
Member

@maliberty but why the need to change them for bazel? We have other tests that check to failures.

The change is for both cmake & bazel. They don't have to be changed but they are essentially pass/fail tests so I assume the AI switched them to match others. If you prefer I can change them back.

@gadfort

gadfort commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

@maliberty those changes are not needed, it seems like reverting them back would be nice.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@gadfort gadfort merged commit 165b849 into The-OpenROAD-Project:master Jun 8, 2026
16 checks passed
@openroad-ci openroad-ci deleted the bzl-rdl branch June 8, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants