Skip to content

Conversation

@openroad-ci
Copy link
Collaborator

This PR changes how blockages are treated inside MPL simulated annealing, going from special objects to fixed macros. This changes the behavior of blockages from a soft constraint to a hard constraint, but simplifies the use of blockages in general, since they are objects within the sequence pair of the annealer.

The change from soft to hard constraint required changes in the creation of pin access blockages too, since it was causing troubles in design such as mock-array due to lack of space to fit everything.

@github-actions
Copy link
Contributor

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

@joaomai joaomai requested a review from AcKoucher September 25, 2025 17:11
Comment on lines 556 to 557
return macro.getCluster() != nullptr
&& macro.getCluster()->isClusterOfUnplacedIOPins();
Copy link
Contributor

Choose a reason for hiding this comment

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

This way we're not skipping fixed terminals.

I think we should use the is_blockage_ flag and have something like:

if (macro.isBlockage()) {
  return false;
}

Cluster* cluster = macro.getCluster();
return !cluster || cluster->isClusterOfUnplacedIOPins();

void Graphics::setSoftMacroBrush(gui::Painter& painter,
const SoftMacro& soft_macro)
{
if (soft_macro.getCluster() == nullptr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

soft_macro.isBlockage()

if (macro_array->getNumMacro() % divider == 0) {
columns = macro_array->getNumMacro() / divider;
rows = divider;
const auto outline = tree_->root->getBBox();
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using auto.

const float proportional_min_width = min_depth_proportion * die.getWidth();
const float proportional_min_height = min_depth_proportion * die.getHeight();

const auto tiling = tree_->root->getTilings().front();
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using auto.

Comment on lines 1804 to 1820
// We model blockages as macro clusters (SoftMacros) constrained to fences.
// The rationale of this model comes from the fact that the area occupied
// by blockages should be empty, i.e., with neither macros or std cells.
void HierRTLMP::blockagesAsFixedSoftMacros(
const std::vector<Rect>& blockages,
std::map<std::string, int>& soft_macro_id_map,
std::vector<SoftMacro>& macros)
{
for (const Rect& blockage : blockages) {
const int macro_id = static_cast<int>(macros.size());
std::string macro_name = fmt::format("blockage_{}", macro_id);
soft_macro_id_map[macro_name] = macro_id;

macros.emplace_back(blockage, macro_name);
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. The comment is not accurate. We should remove it as the approach is reasonably simpler now.
  2. Blockages don't need to be part of soft_macro_id_map.
  3. I think that this function would be clearer if named as createSoftMacrosForBlockages()

// Interfaces with hard macro
Cluster* cluster_ = nullptr;
bool fixed_ = false; // if the macro is fixed
bool is_blockage_ = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is useful for debugging. See other comments.

@AcKoucher
Copy link
Contributor

Subsequent work:

  1. Treat placement blockages from odb as soft macros.
  2. Remove support for macro blockages overlap penalty when these changes are stable.

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

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

@joaomai joaomai requested a review from AcKoucher October 1, 2025 16:05
@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2025

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

@joaomai
Copy link
Contributor

joaomai commented Oct 1, 2025

Requires PR #3516 from ORFS.
CIs are green except GCDs from secure CI, failing with the same errors as master.

Comment on lines 1804 to 1806
// We model blockages as macro clusters (SoftMacros) constrained to fences.
// The rationale of this model comes from the fact that the area occupied
// by blockages should be empty, i.e., with neither macros or std cells.
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this comment is a leftover from the previous attempted approach. It is not accurate and should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please, add the rationale to the PR description.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

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

@joaomai joaomai requested a review from AcKoucher October 8, 2025 17:47
@AcKoucher AcKoucher requested a review from maliberty October 9, 2025 12:35
@AcKoucher
Copy link
Contributor

I'm not sure I understand the problem with clang-tidy.

@maliberty
Copy link
Member

Holding pending other metric updates in the queue. Will pair with The-OpenROAD-Project/OpenROAD-flow-scripts#3516

@github-actions
Copy link
Contributor

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

@joaomai
Copy link
Contributor

joaomai commented Oct 15, 2025

Should be paired with PR #3583 from ORFS.

@maliberty maliberty merged commit ca004a3 into The-OpenROAD-Project:master Oct 16, 2025
13 checks passed
@maliberty maliberty deleted the mpl-new-blockages branch October 16, 2025 04:10
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