OpenROAD icon indicating copy to clipboard operation
OpenROAD copied to clipboard

odb: derating relocation from GRT to dbTechLayer

Open gudeh opened this issue 1 year ago • 16 comments

  • Implemented the insertion of derating (layer adjustment) into RUDY, using an average value from the routing layers. - Note: RUDY does not have access to layer information. Instead, derating values for each layer are set within GRT.
  • Moved derating from GRT to dbTechLayer through the use of a code generator.

gudeh avatar Jan 22 '24 23:01 gudeh

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Jan 23 '24 16:01 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Jan 23 '24 16:01 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Jan 23 '24 18:01 github-actions[bot]

mock array should be quite readily predicted. I'm wondering why rudy w/weight-avg is showing >100% congestion.

maliberty avatar Jan 23 '24 23:01 maliberty

There are two things that influence the > 100% values: the derating itself, and the fact that RUDY is considering the presence of 2 nets per tile per blockage on the macros. Here you can see the case with 0 derating for reference. Notice RUDY values are actually lower when derating is 0.

RUDY: image

GRT: image

There are other examples where RUDY overestimates congestion due to derating, in the current format. I thought of a condition, prior to derating adjustment, to not add too much if the value is already high, but seems strange to do that, any ideas?

gudeh avatar Jan 24 '24 00:01 gudeh

When you consider the macro for track usage do you consider derating? If the macro blocks all the tracks, it should be blocking all the derated tracks not the underated tracks

maliberty avatar Jan 24 '24 18:01 maliberty

When you consider the macro for track usage do you consider derating? If the macro blocks all the tracks, it should be blocking all the derated tracks not the underated tracks

If you look at RUDYCalculator::calculateRUDY() you will notice I first calculate RUDY for the nets (different methods for supply versus signal nets), afterwards I loop over the instances to process the macros. Then only afterwards I adjust every tile based on the derating at dbTechLayer.

So, the derating and the macro blockages are processed separately. First, the blockages are handled, and then the derating is applied to all tiles, considering that RUDY values are stored on the tiles.

gudeh avatar Jan 24 '24 18:01 gudeh

I tried using a sigmoid function to reduce the derating addition on values that are already high. Some examples look better: -IBEX ibex_core-nangate45-rudy_ibex_core-nangate45-grt

-Mock-array MockArray-asap7-rudy_MockArray-asap7-grt

I am executing more examples right now.

You can see here how IBEX was overestimating without this new sigmoid function.

gudeh avatar Jan 24 '24 18:01 gudeh

@eder-matheus please advise on how derating and macros are handled in grt

maliberty avatar Jan 24 '24 19:01 maliberty

@eder-matheus please advise on how derating and macros are handled in grt

Regarding user-defined derating, GRT iterates through every tile of the gcell grid and applies the reduction percentage over the current resource value. With that, we avoid over-reducing the tile resources because it doesn't reduce anymore when it reaches zero.

For the macro obstructions, it iterates over every macro obstruction, gets the tiles overlapping with the obstruction, and sets the resources to zero when it is completely blocked. GRT will estimate how many tracks are blocked to define the reduction value when it is partially blocked.

eder-matheus avatar Jan 24 '24 20:01 eder-matheus

@eder-matheus do you think we can share the code/logic with rudy so there is one way to handle macros?

maliberty avatar Jan 24 '24 21:01 maliberty

@eder-matheus do you think we can share the code/logic with rudy so there is one way to handle macros?

I think @gudeh can explain better, but I understand that rudy doesn't see resources. It only considers the congestion in the tiles. Also, GRT looks at layers, while rudy doesn't have this capability.

I suggested to @gudeh to check if the tile already has 100% congestion and avoid adding the user-defined reductions to these tiles. This is what we do in GRT.

eder-matheus avatar Jan 24 '24 21:01 eder-matheus

For future reference, we have decided during a sync meeting to implement a generic function in ODB that can be called by GRT, RUDY, or any other process. This approach will provide us with a unified method for calculating congestion for the power grid, macro obstructions, and derating.

The difference among RUDY and GRT should be only for signal nets.

gudeh avatar Jan 24 '24 22:01 gudeh

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Jan 25 '24 15:01 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Jan 25 '24 15:01 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Feb 15 '24 15:02 github-actions[bot]

I think this is obsolete in light of #4927 - close?

maliberty avatar Apr 09 '24 16:04 maliberty

I think this is obsolete in light of #4927 - close?

I believe you are correct. With the new code structure I see no reason to relocate derating to odb.

gudeh avatar Apr 09 '24 16:04 gudeh