Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/mpl/src/SACoreSoftMacro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ void SACoreSoftMacro::resizeOneCluster()
if (option <= 0.25) {
// Change the width of soft block to Rb = e.x2 - b.x1
float e_x2 = outline_.getWidth();
for (const auto& macro : macros_) {
for (const int macro_id : pos_seq_) {
SoftMacro& macro = macros_[macro_id];
const float cur_x2 = macro.getX() + macro.getWidth();
if (cur_x2 > ux && cur_x2 < e_x2) {
e_x2 = cur_x2;
Expand All @@ -782,7 +783,8 @@ void SACoreSoftMacro::resizeOneCluster()
src_macro.setWidth(e_x2 - lx);
} else if (option <= 0.5) {
float d_x2 = lx;
for (const auto& macro : macros_) {
for (const int macro_id : pos_seq_) {
SoftMacro& macro = macros_[macro_id];
const float cur_x2 = macro.getX() + macro.getWidth();
if (cur_x2 < ux && cur_x2 > d_x2) {
d_x2 = cur_x2;
Expand All @@ -795,7 +797,8 @@ void SACoreSoftMacro::resizeOneCluster()
} else if (option <= 0.75) {
// change the height of soft block to Tb = a.y2 - b.y1
float a_y2 = outline_.getHeight();
for (const auto& macro : macros_) {
for (const int macro_id : pos_seq_) {
SoftMacro& macro = macros_[macro_id];
const float cur_y2 = macro.getY() + macro.getHeight();
if (cur_y2 > uy && cur_y2 < a_y2) {
a_y2 = cur_y2;
Expand All @@ -805,7 +808,8 @@ void SACoreSoftMacro::resizeOneCluster()
} else {
// Change the height of soft block to Bb = c.y2 - b.y1
float c_y2 = ly;
for (const auto& macro : macros_) {
for (const int macro_id : pos_seq_) {
SoftMacro& macro = macros_[macro_id];
const float cur_y2 = macro.getY() + macro.getHeight();
if (cur_y2 < uy && cur_y2 > c_y2) {
c_y2 = cur_y2;
Expand Down
Loading