Skip to content

drt: Unifiying Priority Vias Logic - #11175

Draft
bnmfw wants to merge 12 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:drt_num_cut
Draft

drt: Unifiying Priority Vias Logic#11175
bnmfw wants to merge 12 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:drt_num_cut

Conversation

@bnmfw

@bnmfw bnmfw commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the getPriorityViaDefs() function, which simply puts the logic of "The first two vias have priorities over all others in Pin Access" in a single place, instead of being independently in two places.

Users pushing PRs have built on top of the already faulty logic which lead to bad code. Putting this in one place makes things more concise and allows to in the future change this logic. The logic itself is kind of arbitrary, but I'm not changing it, just putting it in one place.

Also applies minor refactors:

  • deep_search renamed to try_all_vias
  • via_in_pin renamed to via_must_be_in_pin
  • hasViaDef noop refactor

Type of Change

Noop refactor

Impact

Pure refactor

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 signed my commits (DCO).

Related Issues

#10937

@bnmfw bnmfw self-assigned this Aug 18, 2026

@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 refactors the via selection and filtering logic in FlexPA by introducing the getPriorityViaDefs helper function, simplifying the via_defs vector representation, and renaming variables for clarity. The review feedback highlights several improvement opportunities, including resolving a signed/unsigned comparison warning in frAccess.h, marking the new query function as const while avoiding potential map insertion side-effects from operator[], preventing potential underflow/negative index issues when querying layer_num - 1, and fixing a typo in the variable name via_not_int_pin.

Comment thread src/drt/src/db/obj/frAccess.h Outdated
Comment thread src/drt/src/pa/FlexPA.h Outdated
Comment thread src/drt/src/pa/FlexPA_acc_point.cpp
Comment thread src/drt/src/pa/FlexPA_acc_point.cpp
Comment thread src/drt/src/pa/FlexPA_acc_point.cpp Outdated
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.

1 participant