Skip to content

mpl: IOs abstraction adaptation to ORFS flow - second version (enhanced)#6820

Merged
eder-matheus merged 40 commits into
The-OpenROAD-Project:masterfrom
AcKoucher:mpl-io-constraints-regions
May 22, 2025
Merged

mpl: IOs abstraction adaptation to ORFS flow - second version (enhanced)#6820
eder-matheus merged 40 commits into
The-OpenROAD-Project:masterfrom
AcKoucher:mpl-io-constraints-regions

Conversation

@AcKoucher

@AcKoucher AcKoucher commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

Resolve #5669

Introductory Considerations

  • This is the second and final step of the enhancements to adapt the IOs abstraction inside MPL to ORFS flow.
  • Differently from the first version, in which we made simplifications w.r.t. dimensions of the constraints, this second version considers the actual dimensions of the constraints regions for pins, whether they are -exclude constraints or pins' constraints.

Goals

  1. Further improve QoR in terms of WL.
  2. Improve accuracy of the locations that can be occupied by macros w.r.t. pin access.

Main Changes

Modify Shapes of Clusters of Unplaced IO Pins

Instead of virtually constraining IOs to the edges of the die area, we now use the actual constraint region that comes from ODB. This results in:

  • A cluster of unplaced IOs have now the dimensions of the constraint region to which those pins are constrained to. I.e., pins are constrained to regions instead of boundaries.
  • The cluster of unplaced IOs without any constraint is a special case. The pins are constrained to all available regions for pins i.e., the regions that are not blocked. The shape of this cluster is the die area itself.

As we create these clusters, we populate a map that links them with their respective BoundaryRegion (the new object in MPL's framework to help handling constraint regions - for constrained pins' clusters - & available regions - for the unconstrained pins' cluster - inside SA and during orientation improvement).

Computation of Available Regions For Pins

When there are no constrained pins, but there are -exclude constraints set by the user, we use the blocked regions for pins which are stored in ODB to compute a list of available regions for pins (this is made by doing regions' subtraction across the edges of the die area, see HierRTLMP::computeAvailableRegions).

Pin Access

The alternatives for pin access blockages' generation are still the same as the first version. However, we now use the dimensions of constraint regions:

  • If there are constrained pins, we create blockages for the respective constraint regions.
  • If there are no constrained pins, but there are -exclude constraints set by the user, we use the available regions for pins to create the pin access blockages.
  • If there are no constraints at all - neither pins' constraints or -exclude constraints - we don't create pin access blockages to give more freedom to SA.

The depth now is limited by the dimensions of the die area. A horizontal blockage will have at max 20% of the die width; a vertical blockage will have at max 20% of the die height.

There is one important difference w.r.t the first version: We now consider the density of IOs when computing the depth of the blockages for constrained pins. Denser regions are deeper, i.e., have thicker blockages.

Cluster / Macro Placement (SA)

In the first version of the new IOs, WL was computed based on distance to the edges:

  • In the case of a cluster for constrained pins, the distance to its specific edge of constraint;
  • In the case of the cluster of unconstrained pins, the distance to the closest unblocked boundary.

Now, as the clusters of unplaced IOs are constrained to actual regions, we compute WL as:

  • In the case of a cluster of constrained pins, we compute the distance from the macro bundled pin to the nearest point inside the constraint region.
  • In the case of the cluster of unconstrained pins, we compute the distance from the macro bundled to the nearest point of the nearest available region for pins.

Obs: When initializing the SA Core, we create a cache of these regions offset w.r.t. current outline.
Obs2: The new WL computation is made in DBU, so the annealer needs a dbBlock* in order to allow us to perform unit conversion.

Boundary Pushing

As we now store the pin access blockages in a vector instead of a map Boundary -> Blockage, because we don't need the boundary data anymore, the Pusher receives this vector and, when working, computes overlap iterating the blockages of this vector.

Orientation Improvement

When computing HPWL for a certain orientation and iterating bterms of a net:

  • If the pin is constrained to a region, use the nearest point of this region.
  • If the pin is not constrained to any region, use the nearest point of the nearest available region for pins.

AcKoucher added 14 commits March 5, 2025 14:01
     1. Use constraint regions' shapes for clusters of unplaced ios and pin access blockages
     2. Add regression tests for different cases of blockage generation

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
    1) Improve comments
    2) Renaming
    3) Update regression tests results for:
        a. Snapper truncated value fix
        b. New spdlog default float type report
    4) Improve regression tests comment descriptions

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
  1. Change WL computation mechanism for IO clusters:
     a. Clusters of unplaced IOs are treated as usual fixed terminals
     b. Clusters of unconstrained IOs have WL computed based on the
        distance to the center of the closest available region for
        pins.
  2. Adapt graphics to the previous item;
  3. Collateral changes:
     a. Add API to Soft/Hard macros to allow check for unconstrained
        IOs cluster;
     b. Create function to compute distance between << micron points >>

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
     update test to correct overlap computation

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
…from master

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
  1. Simplify creation of clusters of unplaced IOs
  2. [Fix] Set root as parent clusters of unplaced IOs
  3. Some comment and critical message improvements

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
  1. Remove unused argument
  2. Improve comments
  3. Adpt function name
  4. TO DOs clean up

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
  1. Cache actual offset die area instead of just the half
     perimeter and use the cached die to compute the max
     dist for max cost.
  2. Some renaming.

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>

@github-actions github-actions 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.

clang-tidy made some suggestions

Comment thread src/mpl/src/clusterEngine.cpp Outdated
Comment thread src/mpl/src/hier_rtlmp.cpp Outdated
Comment thread src/mpl/src/hier_rtlmp.h Outdated
Comment thread src/mpl/src/hier_rtlmp.h Outdated
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
@maliberty

Copy link
Copy Markdown
Member

Nice description!

and update tests accordingly.

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
    1) Make fixed terminals points again as the new approach
       doesn't require that anymore when computing distance
       to region in WL computation.
    2) Format.

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
    1) Remove PPL calls from new tests.
    2) Adapt tests to be more concise.

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>

@github-actions github-actions 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.

clang-tidy made some suggestions

Comment thread src/mpl/src/hier_rtlmp.cpp Outdated
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

   1) Reordering of arguments for clarity;
   2) Minor refactor for readability;
   3) Removal of cached map cluster -> constraint for simplification;
   4) Avoid constraint region copy;
   5) Adapt names and comments to preserve concision.

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
@github-actions

github-actions Bot commented May 7, 2025

Copy link
Copy Markdown
Contributor

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

@AcKoucher AcKoucher marked this pull request as ready for review May 7, 2025 14:17
@AcKoucher

Copy link
Copy Markdown
Contributor Author

I adapted the implementation to avoid using the center of regions when computing WL and these changes are ready for a first round of review. I also updated the description accordingly so it should give a reasonable explanation of what is going on.

@maliberty

Copy link
Copy Markdown
Member

secure CI?

@AcKoucher

Copy link
Copy Markdown
Contributor Author

secure CI?

Running.

Comment thread src/mpl/src/util.h Outdated
Comment thread src/mpl/src/util.h Outdated
Comment thread src/mpl/src/util.h Outdated
Comment thread src/mpl/src/util.h Outdated
Comment thread src/mpl/src/util.h Outdated
Comment thread src/mpl/src/hier_rtlmp.cpp Outdated
Comment thread src/mpl/src/hier_rtlmp.cpp
Comment thread src/mpl/src/SimulatedAnnealingCore.h Outdated
Comment thread src/mpl/test/CMakeLists.txt
Comment thread src/mpl/src/clusterEngine.cpp
AcKoucher added 3 commits May 9, 2025 11:58
   1) Use enum class;
   2) Remove unused NONE enumeration;
   3) Remove all default cases from switch statements;
   4) Fix initial value of BoundaryRegion object;
   5) Reduce some verbosity.

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
   1) Avoid double-negative checking;
   2) Add tests to BUILD.

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
@github-actions

github-actions Bot commented May 9, 2025

Copy link
Copy Markdown
Contributor

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

@AcKoucher

Copy link
Copy Markdown
Contributor Author

Running new Secure-CI.

AcKoucher added 2 commits May 20, 2025 12:07
   1) Improve naming;
   2) Fix outline offset done in available regions for unconstrained pins.

Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
@AcKoucher

Copy link
Copy Markdown
Contributor Author

As I was addressing the last comment of the review I found a bug which is now fixed. I'm running a new Secure-CI.

@github-actions

Copy link
Copy Markdown
Contributor

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

@eder-matheus eder-matheus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Waiting on secure-CI to merge.

@AcKoucher

Copy link
Copy Markdown
Contributor Author

Secure-CI had some failures which are addressed in #3175.

@eder-matheus

Copy link
Copy Markdown
Member

I can't merge the PR without @maliberty's approval.

@maliberty maliberty enabled auto-merge May 21, 2025 19:15
@maliberty maliberty disabled auto-merge May 21, 2025 19:15
@maliberty

Copy link
Copy Markdown
Member

I've approved and will look more closely tomorrow's

@eder-matheus eder-matheus merged commit fa92de9 into The-OpenROAD-Project:master May 22, 2025
11 checks passed
@AcKoucher AcKoucher deleted the mpl-io-constraints-regions branch May 22, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use IO constraints kept by PPL inside MPL to improve QoR

3 participants