drt: Unifiying Priority Vias Logic - #11175
Conversation
Signed-off-by: bnmfw <bernardoborgessandoval@gmail.com>
Signed-off-by: bnmfw <bernardoborgessandoval@gmail.com>
Signed-off-by: bnmfw <bernardoborgessandoval@gmail.com>
There was a problem hiding this comment.
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.
Signed-off-by: bnmfw <bernardoborgessandoval@gmail.com>
|
Secure and ISPD CI safe |
osamahammad21
left a comment
There was a problem hiding this comment.
In terms of correctness, The PR is clean. But I don't like the getPriorityViaDefs parameters already_collected and get_all. They are somewhat hard to decrypt. What if we instead define a parameter of the maximum number of vias allowed to be returned by that API? it feels easier to understand and push all that work to the caller instead.
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:
Type of Change
Noop refactor
Impact
Pure refactor
Verification
./etc/Build.sh).Related Issues
#10937