Skip to content

Commit

Permalink
mpl2: remove unneeded argument
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Koucher <arthurckoucher@gmail.com>
  • Loading branch information
AcKoucher committed Nov 1, 2024
1 parent 2d84b13 commit 75d37bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions src/mpl2/src/SimulatedAnnealingCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ void SimulatedAnnealingCore<T>::fastSA()
const int max_num_restart = 2;

if (best_valid_result_ && isValid()) {
updateBestValidResult(best_valid_result_.get());
updateBestValidResult();
}

while (step <= max_num_step_) {
Expand All @@ -590,7 +590,7 @@ void SimulatedAnnealingCore<T>::fastSA()
= cost < pre_cost
|| best_valid_result_->sequence_pair.pos_sequence.empty();
if (isValid() && keep_result) {
updateBestValidResult(best_valid_result_.get());
updateBestValidResult();
}
}

Expand Down Expand Up @@ -639,19 +639,18 @@ void SimulatedAnnealingCore<T>::fastSA()
calPenalty();
}

// The same sequence pair can have macros with different shapes,
// so it may generate both valid/invalid floorplans. To ensure
// that a result is truly the one we're looking for, we need to
// also keep its shapes.
// The same sequence pair can represent different floorplan depending
// on the shape of each cluster, so, to ensure that a result is truly
// the one we're looking for, we need toalso keep its shapes.
template <class T>
void SimulatedAnnealingCore<T>::updateBestValidResult(Result* best_valid_result)
void SimulatedAnnealingCore<T>::updateBestValidResult()
{
best_valid_result->sequence_pair.pos_sequence = pos_seq_;
best_valid_result->sequence_pair.neg_sequence = neg_seq_;
best_valid_result_->sequence_pair.pos_sequence = pos_seq_;
best_valid_result_->sequence_pair.neg_sequence = neg_seq_;

for (const int macro_id : pos_seq_) {
T& macro = macros_[macro_id];
best_valid_result->macro_id_to_width[macro_id] = macro.getWidth();
best_valid_result_->macro_id_to_width[macro_id] = macro.getWidth();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/mpl2/src/SimulatedAnnealingCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class SimulatedAnnealingCore
};

void initSequencePair();
void updateBestValidResult(Result* best_valid_result);
void updateBestValidResult();

virtual float calNormCost() const = 0;
virtual void calPenalty() = 0;
Expand Down

0 comments on commit 75d37bb

Please sign in to comment.