@@ -227,6 +227,9 @@ PlacementAnnealer::PlacementAnnealer(const t_placer_opts& placer_opts,
227
227
, congestion_modeling_started_(false ) {
228
228
const auto & device_ctx = g_vpr_ctx.device ();
229
229
230
+ congestion_factor_ = placer_opts_.congestion_factor ;
231
+ placer_opts_.congestion_factor = 0 .;
232
+
230
233
float first_crit_exponent;
231
234
if (placer_opts.place_algorithm .is_timing_driven ()) {
232
235
first_crit_exponent = placer_opts.td_place_exp_first ; /* this will be modified when rlim starts to change */
@@ -467,7 +470,7 @@ e_move_result PlacementAnnealer::try_swap_(MoveGenerator& move_generator,
467
470
placer_opts_.timing_tradeoff ,
468
471
timing_delta_c,
469
472
costs_.timing_cost_norm );
470
- delta_c = (1 - placer_opts_.timing_tradeoff ) * bb_delta_c * costs_.bb_cost_norm
473
+ delta_c = (1 - placer_opts_.timing_tradeoff - placer_opts_. congestion_factor ) * bb_delta_c * costs_.bb_cost_norm
471
474
+ placer_opts_.timing_tradeoff * timing_delta_c * costs_.timing_cost_norm
472
475
+ placer_opts_.congestion_factor * congestion_delta_c * costs_.congestion_cost_norm ;
473
476
} else if (place_algorithm == e_place_algorithm::SLACK_TIMING_PLACE) {
@@ -672,9 +675,20 @@ void PlacementAnnealer::outer_loop_update_timing_info() {
672
675
}
673
676
674
677
if (congestion_modeling_started_
675
- || (placer_stats_. success_rate < placer_opts_.congestion_acceptance_rate_trigger && placer_stats_. av_cost != 0 .) ) {
678
+ || (annealing_state_. rlim / MoveGenerator::first_rlim) < placer_opts_.congestion_acceptance_rate_trigger ) {
676
679
costs_.congestion_cost = net_cost_handler_.estimate_routing_chann_util ();
677
- congestion_modeling_started_ = true ;
680
+
681
+
682
+ if (!congestion_modeling_started_) {
683
+ VTR_LOG (" Congestion modeling started. %f %f\n " , placer_opts_.congestion_factor , placer_opts_.timing_tradeoff );
684
+ placer_opts_.congestion_factor = congestion_factor_;
685
+ placer_opts_.congestion_factor /= 1 .f + congestion_factor_;
686
+ // placer_opts_.congestion_factor /= 1.f + placer_opts_.congestion_factor;
687
+ placer_opts_.timing_tradeoff /= 1 .f + congestion_factor_;
688
+ VTR_LOG (" Congestion modeling started. %f %f\n " , placer_opts_.congestion_factor , placer_opts_.timing_tradeoff );
689
+ congestion_modeling_started_ = true ;
690
+ }
691
+
678
692
}
679
693
680
694
// Update the cost normalization factors
@@ -760,11 +774,6 @@ void PlacementAnnealer::placement_inner_loop() {
760
774
// Calculate the success_rate and std_dev of the costs.
761
775
placer_stats_.calc_iteration_stats (costs_, annealing_state_.move_lim );
762
776
763
- if (congestion_modeling_started_ || placer_stats_.success_rate < placer_opts_.congestion_acceptance_rate_trigger ) {
764
- net_cost_handler_.estimate_routing_chann_util ();
765
- congestion_modeling_started_ = true ;
766
- }
767
-
768
777
// update the RL agent's state
769
778
if (!quench_started_) {
770
779
if (placer_opts_.place_algorithm .is_timing_driven () && placer_opts_.place_agent_multistate && agent_state_ == e_agent_state::EARLY_IN_THE_ANNEAL) {
0 commit comments