Skip to content

gpl: modify default initial position of instances to use ODB - #9353

Merged
maliberty merged 20 commits into
The-OpenROAD-Project:masterfrom
gudeh:gpl-odb-initial-pos
Jan 30, 2026
Merged

maliberty merged 20 commits into
The-OpenROAD-Project:masterfrom
gudeh:gpl-odb-initial-pos

Conversation

@gudeh

@gudeh gudeh commented Jan 26, 2026 •

Copy link
Copy Markdown
Contributor

This PR modifies the default behavior of the initial position of instances in GPL.

Now if an instance has an existing odb position, does not have a region and -force_center_initial_place is not used, GPL will initiate with the position from the odb. Otherwise it will initiate the instance on the core center or region center.

Previously GPL would only initiate instances from the positions given by the odb if skip_io option was used, which is non intuitive.

Notice that the initial position of instances is independent of the initial placement run, which uses the conjugate gradient methodology, and is followed by the main nesterov run.

We can think of GPL run in three steps:

  1. Initial position of instances.
  2. Run initial placement with conjugate gradient method.
  3. Run the main nesterov run.

Where step 1. has three options that can be set by:

  • Having an exisiting odb position set for the instance when GPL is run (default)
  • Using the new TCL parameter: -force_center_initial_place.
  • Having a region associated with the instance.
    And step 2. can be skipped with -skip_initial_place.

Now the user has more ability to control GPL behavior depending on his desires. Now he can use -skip_initial_place, plus modifying the position of instances as given by the previous run in the flow (for example, a previous GPL run itself), and have the main nesterov run (step 3) to initiate as he wishes.

gudeh added 15 commits January 14, 2026 15:41
some users try to run gpl twice and expect it to initiate instances with the positions available at odb,
also include a new TCL parameter to force use core/region center location (similar to previous default)"

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
more emphasis to main objects being initialized and starting of execution of intial placement versus nesterov

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>

@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 introduces a sensible change to the initial placement logic in GPL, making the use of existing ODB positions the default behavior. This is more intuitive and provides users with greater control. The new -force_center_initial_place flag is a good addition for maintaining the previous behavior when desired. The code changes are clean, and the refactoring of function names and log messages for major steps significantly improves readability and consistency. I have one suggestion to improve consistency in coordinate calculations.

Comment on lines 158 to 159
inst->setCenterLocation(region_x_max - (region_x_max - region_x_min) / 2,
region_y_max - (region_y_max - region_y_min) / 2);

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.

medium

The calculation for the region's center is a bit unusual and inconsistent with how odb::Rect::xCenter() calculates it, which is used in the else if branch below. Using (min + max) / 2 is more standard, readable, and consistent. This would prevent subtle off-by-one differences in placement for regions with odd-numbered dimensions.

Suggested change
inst->setCenterLocation(region_x_max - (region_x_max - region_x_min) / 2,
region_y_max - (region_y_max - region_y_min) / 2);
inst->setCenterLocation((region_x_min + region_x_max) / 2,
(region_y_min + region_y_max) / 2);

@github-actions

Copy link
Copy Markdown
Contributor

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

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

@gudeh

gudeh commented Jan 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks to @dbekatli for a detailed exploration of GPL behavior and exposing this limitation!

@maliberty

Copy link
Copy Markdown
Member

Various tests fail under bazel.

What was the detailed explanation?

@gudeh

gudeh commented Jan 26, 2026 •

Copy link
Copy Markdown
Contributor Author

If we wish to maintain the previous behavior we have to use the new TCL parameter -force_center_initial_place. Otherwise we are now using the initial position from the ODB (as given from the input test file).

In other words, tests failed because we used the initial position from ODB instead of starting positions all on center which was the previous default.

@gudeh

gudeh commented Jan 26, 2026

Copy link
Copy Markdown
Contributor Author

Ah! I just noticed I should have updated tests from other tools. I will update the tests. I also made some small changes on log messages.

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

@gudeh

gudeh commented Jan 26, 2026

Copy link
Copy Markdown
Contributor Author

@maliberty I expect tests to be green after they finish this time. There is also an ORFS PR that should follow: The-OpenROAD-Project/OpenROAD-flow-scripts#3838 (comment)

…ances to odb location

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

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

@gudeh
gudeh requested a review from maliberty January 27, 2026 11:55
@gudeh

gudeh commented Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

I see this on the error for bazel: There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.

@maliberty

Copy link
Copy Markdown
Member

That is more informational, the real problem is

[ERROR] Failed to open file: bazel-out/k8-opt/bin/test/orfs/ram_8x7/logs/asap7/ram_8x7/base/5_1_grt.log

@maliberty
maliberty merged commit 69c1719 into The-OpenROAD-Project:master Jan 30, 2026
10 checks passed
@gudeh
gudeh deleted the gpl-odb-initial-pos branch January 30, 2026 11:58
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.

2 participants