grt: add prevent division by zero and overflow when computing resistance cost#10034
Conversation
…nce cost Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
|
@jfgava FYI. |
|
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Code Review
This pull request introduces safety checks in getWireCost and getViaCost to prevent division by zero and handle large resistance values. Feedback highlights a remaining risk of integer overflow when the divisor is a very small positive number and suggests calculating the cost as a double with explicit clamping to BIG_INT before casting to an integer.
|
Nice fix @eder-matheus Just one thing I noticed that if |
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
|
clang-tidy review says "All clean, LGTM! 👍" |
|
Is this for some sort of benchmark? It would be odd to have no layer resistance in a production pdk. |
I faced this issue on a private PDK I'm working on. I added this guard to prevent crash/errors on it. |
Summary
Check if
default_resistanceandfinal_resistancevalues are valid for the division performed later. This shouldn't impact any of our designs, but acts as a guard for cases where resistance is not defined for a specific routing/via layer.Type of Change
Impact
No impact on ORFS designs.
Verification
./etc/Build.sh).Related Issues
[Link issues here]