Skip to content

Commit ab58031

Browse files
committed
mpl: remove flip perturbations
Signed-off-by: João Mai <[email protected]>
1 parent 5d0d0fb commit ab58031

File tree

4 files changed

+3
-28
lines changed

4 files changed

+3
-28
lines changed

src/mpl/src/SACoreHardMacro.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ SACoreHardMacro::SACoreHardMacro(PhysicalHierarchy* tree,
2929
float neg_swap_prob,
3030
float double_swap_prob,
3131
float exchange_prob,
32-
float flip_prob,
3332
// Fast SA hyperparameter
3433
float init_prob,
3534
int max_num_step,
@@ -54,7 +53,6 @@ SACoreHardMacro::SACoreHardMacro(PhysicalHierarchy* tree,
5453
logger,
5554
block)
5655
{
57-
flip_prob_ = flip_prob;
5856
}
5957

6058
void SACoreHardMacro::run()
@@ -104,13 +102,6 @@ void SACoreHardMacro::calPenalty()
104102
}
105103
}
106104

107-
void SACoreHardMacro::flipAllMacros()
108-
{
109-
for (auto& macro_id : pos_seq_) {
110-
macros_[macro_id].flip(false);
111-
}
112-
}
113-
114105
void SACoreHardMacro::perturb()
115106
{
116107
if (macros_.empty()) {
@@ -133,12 +124,9 @@ void SACoreHardMacro::perturb()
133124
action_id_ = 3;
134125
doubleSeqSwap(); // Swap two macros in pos_seq_ and
135126
// other two macros in neg_seq_
136-
} else if (op <= action_prob_4) {
127+
} else {
137128
action_id_ = 4;
138129
exchangeMacros(); // exchange two macros in the sequence pair
139-
} else {
140-
action_id_ = 5;
141-
flipAllMacros();
142130
}
143131

144132
// update the macro locations based on Sequence Pair

src/mpl/src/SACoreHardMacro.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class SACoreHardMacro : public SimulatedAnnealingCore<HardMacro>
3030
float neg_swap_prob,
3131
float double_swap_prob,
3232
float exchange_prob,
33-
float flip_prob,
3433
// Fast SA hyperparameter
3534
float init_prob,
3635
int max_num_step,
@@ -57,10 +56,6 @@ class SACoreHardMacro : public SimulatedAnnealingCore<HardMacro>
5756
void perturb() override;
5857
void saveState() override;
5958
void restoreState() override;
60-
// actions used
61-
void flipAllMacros();
62-
63-
float flip_prob_ = 0.0;
6459
};
6560

6661
} // namespace mpl

src/mpl/src/hier_rtlmp.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ void HierRTLMP::resetSAParameters()
299299
neg_swap_prob_ = 0.2;
300300
double_swap_prob_ = 0.2;
301301
exchange_swap_prob_ = 0.2;
302-
flip_prob_ = 0.2;
303302
resize_prob_ = 0.0;
304303

305304
placement_core_weights_.fence = 0.0;
@@ -727,7 +726,6 @@ void HierRTLMP::calculateMacroTilings(Cluster* cluster)
727726
neg_swap_prob_ / action_sum,
728727
double_swap_prob_ / action_sum,
729728
exchange_swap_prob_ / action_sum,
730-
0.0, // no flip
731729
init_prob_,
732730
max_num_step_,
733731
num_perturb_per_step,
@@ -782,7 +780,6 @@ void HierRTLMP::calculateMacroTilings(Cluster* cluster)
782780
neg_swap_prob_ / action_sum,
783781
double_swap_prob_ / action_sum,
784782
exchange_swap_prob_ / action_sum,
785-
0.0,
786783
init_prob_,
787784
max_num_step_,
788785
num_perturb_per_step,
@@ -2459,14 +2456,12 @@ void HierRTLMP::placeMacros(Cluster* cluster)
24592456

24602457
// set the action probabilities (summation to 1.0)
24612458
const float action_sum = pos_swap_prob_ * 10 + neg_swap_prob_ * 10
2462-
+ double_swap_prob_ + exchange_swap_prob
2463-
+ flip_prob_;
2459+
+ double_swap_prob_ + exchange_swap_prob;
24642460

24652461
float pos_swap_prob = pos_swap_prob_ * 10 / action_sum;
24662462
float neg_swap_prob = neg_swap_prob_ * 10 / action_sum;
24672463
float double_swap_prob = double_swap_prob_ / action_sum;
24682464
exchange_swap_prob = exchange_swap_prob / action_sum;
2469-
float flip_prob = flip_prob_ / action_sum;
24702465

24712466
const int macros_to_place = static_cast<int>(hard_macros.size());
24722467

@@ -2481,8 +2476,7 @@ void HierRTLMP::placeMacros(Cluster* cluster)
24812476
pos_swap_prob = 0.0f;
24822477
neg_swap_prob = 0.0f;
24832478
double_swap_prob = 0.0f;
2484-
exchange_swap_prob = 0.95;
2485-
flip_prob = 0.05;
2479+
exchange_swap_prob = 1.0f;
24862480

24872481
// Large arrays need more steps to properly converge.
24882482
if (num_perturb_per_step > macros_to_place) {
@@ -2520,7 +2514,6 @@ void HierRTLMP::placeMacros(Cluster* cluster)
25202514
neg_swap_prob,
25212515
double_swap_prob,
25222516
exchange_swap_prob,
2523-
flip_prob,
25242517
init_prob_,
25252518
max_num_step_,
25262519
num_perturb_per_step,

src/mpl/src/hier_rtlmp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ class HierRTLMP
301301
float neg_swap_prob_ = 0.2;
302302
float double_swap_prob_ = 0.2;
303303
float exchange_swap_prob_ = 0.2;
304-
float flip_prob_ = 0.4;
305304
float resize_prob_ = 0.4;
306305

307306
// since we convert from the database unit to the micrometer

0 commit comments

Comments
 (0)