Skip to content

Comments

mpl: refactor placeChildren#8216

Merged
maliberty merged 11 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:mpl-refactor-place-children
Sep 4, 2025
Merged

mpl: refactor placeChildren#8216
maliberty merged 11 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:mpl-refactor-place-children

Conversation

@openroad-ci
Copy link
Collaborator

This PR refactors code from placeChildren and placeChildrenUsingMinimumUtil, focusing on de-duplicating the code.
Sections that used to always write to files were also moved to separate functions and called only if debug is enabled.

Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
@joaomai
Copy link
Contributor

joaomai commented Sep 3, 2025

Closes #8143

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

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

Signed-off-by: João Mai <jmai@precisioninno.com>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

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

Copy link
Contributor

@AcKoucher AcKoucher left a comment

Choose a reason for hiding this comment

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

I really like that we're finally refactoring this.

// be very hard to generate a valid tiling for the clusters.
// Here, we may want to try setting the area of all standard-cell clusters to 0.
// This should be only be used in mixed clusters.
void HierRTLMP::placeChildren(Cluster* parent, bool minimum_target_util)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that it would be clearer to have this bool named ignore_std_cell_area.

// be very hard to generate a valid tiling for the clusters.
// Here, we may want to try setting the area of all standard-cell clusters to 0.
// This should be only be used in mixed clusters.
void HierRTLMP::placeChildren(Cluster* parent, bool minimum_target_util)
Copy link
Contributor

Choose a reason for hiding this comment

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

With the new naming and refactoring the comment is not needed anymore.

Comment on lines 1536 to 1537
target_utils.push_back(1.6);
target_dead_spaces.push_back(0.99999);
Copy link
Contributor

Choose a reason for hiding this comment

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

These values should be constexpr.

Also 1.6 --> 1e6.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can see a case for creating a const variable for 1e6 and 0.99999, but not constexpr. In the end, both target_utils and target_dead_spaces aren't constexpr (and they're only used to build the utils list and dead spaces lists too), so I don't feel like there's much to gain.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure. It's more of a stylistic matter. There are usages of constexpr in MPL for magic numbers to make them somewhat more evident.

@maliberty Would you have some opinion?

Copy link
Member

Choose a reason for hiding this comment

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

Is there some meaningful information about these values we can convey in either comments or a variable name?

Comment on lines 1686 to 1704
debugPrint(logger_,
MPL,
"hierarchical_macro_placement",
1,
"SA Summary for cluster {}",
parent->getName());

for (auto i = 0; i < sa_containers.size(); i++) {
debugPrint(logger_,
MPL,
"hierarchical_macro_placement",
1,
"sa_id: {}, target_util: {}, target_dead_space: {}",
i,
target_util_list[i],
target_dead_space_list[i]);

sa_containers[i]->printResults();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think these are useful at all.

Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

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

@joaomai joaomai requested a review from AcKoucher September 4, 2025 13:49
Copy link
Contributor

@AcKoucher AcKoucher left a comment

Choose a reason for hiding this comment

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

LGTM!

@AcKoucher
Copy link
Contributor

@joaomai Secure-CI?

@joaomai
Copy link
Contributor

joaomai commented Sep 4, 2025

CIs are green.

@AcKoucher AcKoucher requested a review from maliberty September 4, 2025 17:44
@maliberty maliberty enabled auto-merge September 4, 2025 19:45
@maliberty maliberty merged commit c5f3f12 into The-OpenROAD-Project:master Sep 4, 2025
11 checks passed
@maliberty maliberty deleted the mpl-refactor-place-children branch September 4, 2025 20:01
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.

4 participants