@@ -317,7 +317,8 @@ static void generate_post_place_timing_reports(const t_placer_opts& placer_opts,
317
317
const t_analysis_opts& analysis_opts,
318
318
const SetupTimingInfo& timing_info,
319
319
const PlacementDelayCalculator& delay_calc,
320
- bool is_flat);
320
+ bool is_flat,
321
+ const BlkLocRegistry& blk_loc_registry);
321
322
322
323
// calculate the agent's reward and the total process outcome
323
324
static void calculate_reward_and_process_outcome (const t_placer_opts& placer_opts,
@@ -437,7 +438,7 @@ void try_place(const Netlist<>& net_list,
437
438
438
439
PlacerContext placer_ctx;
439
440
auto & place_move_ctx = placer_ctx.mutable_move ();
440
- auto & place_loc_vars = placer_ctx.mutable_blk_loc_registry ();
441
+ auto & blk_loc_registry = placer_ctx.mutable_blk_loc_registry ();
441
442
const auto & p_timing_ctx = placer_ctx.timing ();
442
443
const auto & p_runtime_ctx = placer_ctx.runtime ();
443
444
@@ -453,7 +454,7 @@ void try_place(const Netlist<>& net_list,
453
454
normalize_noc_cost_weighting_factor (const_cast <t_noc_opts&>(noc_opts));
454
455
}
455
456
456
- initial_placement (placer_opts, placer_opts.constraints_file .c_str (), noc_opts, place_loc_vars );
457
+ initial_placement (placer_opts, placer_opts.constraints_file .c_str (), noc_opts, blk_loc_registry );
457
458
458
459
// create the move generator based on the chosen strategy
459
460
auto [move_generator, move_generator2] = create_move_generators (placer_ctx, placer_opts, move_lim, noc_opts.noc_centroid_weight );
@@ -470,18 +471,18 @@ void try_place(const Netlist<>& net_list,
470
471
* Most of anneal is disabled later by setting initial temperature to 0 and only further optimizes in quench
471
472
*/
472
473
if (placer_opts.enable_analytic_placer ) {
473
- AnalyticPlacer{place_loc_vars }.ap_place ();
474
+ AnalyticPlacer{blk_loc_registry }.ap_place ();
474
475
}
475
476
476
477
#endif /* ENABLE_ANALYTIC_PLACE */
477
478
478
479
// Update physical pin values
479
480
for (const ClusterBlockId block_id : cluster_ctx.clb_nlist .blocks ()) {
480
- place_sync_external_block_connections (block_id, place_loc_vars );
481
+ place_sync_external_block_connections (block_id, blk_loc_registry );
481
482
}
482
483
483
484
const int width_fac = placer_opts.place_chan_width ;
484
- init_draw_coords ((float )width_fac, place_loc_vars );
485
+ init_draw_coords ((float )width_fac, blk_loc_registry );
485
486
486
487
/* Allocated here because it goes into timing critical code where each memory allocation is expensive */
487
488
IntraLbPbPinLookup pb_gpin_lookup (device_ctx.logical_block_types );
@@ -654,7 +655,7 @@ void try_place(const Netlist<>& net_list,
654
655
std::string filename = vtr::string_fmt (" placement_%03d_%03d.place" , 0 ,
655
656
0 );
656
657
VTR_LOG (" Saving initial placement to file: %s\n " , filename.c_str ());
657
- print_place (nullptr , nullptr , filename.c_str (), place_loc_vars .block_locs ());
658
+ print_place (nullptr , nullptr , filename.c_str (), blk_loc_registry .block_locs ());
658
659
}
659
660
660
661
int first_move_lim = get_initial_move_lim (placer_opts, annealing_sched);
@@ -759,7 +760,7 @@ void try_place(const Netlist<>& net_list,
759
760
760
761
if (placer_opts.place_checkpointing
761
762
&& agent_state == e_agent_state::LATE_IN_THE_ANNEAL) {
762
- save_placement_checkpoint_if_needed (place_loc_vars .block_locs (),
763
+ save_placement_checkpoint_if_needed (blk_loc_registry .block_locs (),
763
764
placement_checkpoint,
764
765
timing_info, costs, critical_path.delay ());
765
766
}
@@ -891,7 +892,7 @@ void try_place(const Netlist<>& net_list,
891
892
std::string filename = vtr::string_fmt (" placement_%03d_%03d.place" ,
892
893
state.num_temps + 1 , 0 );
893
894
VTR_LOG (" Saving final placement to file: %s\n " , filename.c_str ());
894
- print_place (nullptr , nullptr , filename.c_str (), place_loc_vars .block_locs ());
895
+ print_place (nullptr , nullptr , filename.c_str (), blk_loc_registry .block_locs ());
895
896
}
896
897
897
898
// TODO:
@@ -905,7 +906,7 @@ void try_place(const Netlist<>& net_list,
905
906
906
907
// Update physical pin values
907
908
for (const ClusterBlockId block_id : cluster_ctx.clb_nlist .blocks ()) {
908
- place_sync_external_block_connections (block_id, place_loc_vars );
909
+ place_sync_external_block_connections (block_id, blk_loc_registry );
909
910
}
910
911
911
912
check_place (costs,
@@ -940,8 +941,8 @@ void try_place(const Netlist<>& net_list,
940
941
*timing_info, debug_tnode);
941
942
}
942
943
943
- generate_post_place_timing_reports (placer_opts, analysis_opts,
944
- *timing_info, * placement_delay_calc, is_flat);
944
+ generate_post_place_timing_reports (placer_opts, analysis_opts, *timing_info,
945
+ *placement_delay_calc, is_flat, blk_loc_registry );
945
946
946
947
/* Print critical path delay metrics */
947
948
VTR_LOG (" \n " );
@@ -968,14 +969,14 @@ void try_place(const Netlist<>& net_list,
968
969
969
970
update_screen (ScreenUpdatePriority::MAJOR, msg, PLACEMENT, timing_info);
970
971
// Print out swap statistics
971
- print_resources_utilization (place_loc_vars );
972
+ print_resources_utilization (blk_loc_registry );
972
973
973
974
print_placement_swaps_stats (state, swap_stats);
974
975
975
976
print_placement_move_types_stats (move_type_stat);
976
977
977
978
if (noc_opts.noc ) {
978
- write_noc_placement_file (noc_opts.noc_placement_file_name , place_loc_vars .block_locs ());
979
+ write_noc_placement_file (noc_opts.noc_placement_file_name , blk_loc_registry .block_locs ());
979
980
}
980
981
981
982
free_placement_structs (placer_opts, noc_opts, placer_ctx);
@@ -992,7 +993,7 @@ void try_place(const Netlist<>& net_list,
992
993
p_runtime_ctx.f_update_td_costs_sum_nets_elapsed_sec ,
993
994
p_runtime_ctx.f_update_td_costs_total_elapsed_sec );
994
995
995
- copy_locs_to_global_state (place_loc_vars );
996
+ copy_locs_to_global_state (blk_loc_registry );
996
997
}
997
998
998
999
/* Function to update the setup slacks and criticalities before the inner loop of the annealing/quench */
@@ -2051,15 +2052,15 @@ static int check_placement_costs(const t_placer_costs& costs,
2051
2052
return error;
2052
2053
}
2053
2054
2054
- static int check_placement_consistency (const BlkLocRegistry& place_loc_vars ) {
2055
- return check_block_placement_consistency (place_loc_vars ) + check_macro_placement_consistency (place_loc_vars );
2055
+ static int check_placement_consistency (const BlkLocRegistry& blk_loc_registry ) {
2056
+ return check_block_placement_consistency (blk_loc_registry ) + check_macro_placement_consistency (blk_loc_registry );
2056
2057
}
2057
2058
2058
- static int check_block_placement_consistency (const BlkLocRegistry& place_loc_vars ) {
2059
+ static int check_block_placement_consistency (const BlkLocRegistry& blk_loc_registry ) {
2059
2060
auto & cluster_ctx = g_vpr_ctx.clustering ();
2060
2061
auto & device_ctx = g_vpr_ctx.device ();
2061
- const auto & block_locs = place_loc_vars .block_locs ();
2062
- const auto & grid_blocks = place_loc_vars .grid_blocks ();
2062
+ const auto & block_locs = blk_loc_registry .block_locs ();
2063
+ const auto & grid_blocks = blk_loc_registry .grid_blocks ();
2063
2064
2064
2065
int error = 0 ;
2065
2066
@@ -2139,10 +2140,10 @@ static int check_block_placement_consistency(const BlkLocRegistry& place_loc_var
2139
2140
return error;
2140
2141
}
2141
2142
2142
- int check_macro_placement_consistency (const BlkLocRegistry& place_loc_vars ) {
2143
+ int check_macro_placement_consistency (const BlkLocRegistry& blk_loc_registry ) {
2143
2144
const auto & pl_macros = g_vpr_ctx.placement ().pl_macros ;
2144
- const auto & block_locs = place_loc_vars .block_locs ();
2145
- const auto & grid_blocks = place_loc_vars .grid_blocks ();
2145
+ const auto & block_locs = blk_loc_registry .block_locs ();
2146
+ const auto & grid_blocks = blk_loc_registry .grid_blocks ();
2146
2147
2147
2148
int error = 0 ;
2148
2149
@@ -2204,12 +2205,13 @@ static void generate_post_place_timing_reports(const t_placer_opts& placer_opts,
2204
2205
const t_analysis_opts& analysis_opts,
2205
2206
const SetupTimingInfo& timing_info,
2206
2207
const PlacementDelayCalculator& delay_calc,
2207
- bool is_flat) {
2208
+ bool is_flat,
2209
+ const BlkLocRegistry& blk_loc_registry) {
2208
2210
auto & timing_ctx = g_vpr_ctx.timing ();
2209
2211
auto & atom_ctx = g_vpr_ctx.atom ();
2210
2212
2211
- VprTimingGraphResolver resolver (atom_ctx.nlist , atom_ctx.lookup ,
2212
- *timing_ctx. graph , delay_calc, is_flat);
2213
+ VprTimingGraphResolver resolver (atom_ctx.nlist , atom_ctx.lookup , *timing_ctx. graph ,
2214
+ delay_calc, is_flat, blk_loc_registry );
2213
2215
resolver.set_detail_level (analysis_opts.timing_report_detail );
2214
2216
2215
2217
tatum::TimingReporter timing_reporter (resolver, *timing_ctx.graph ,
@@ -2288,10 +2290,10 @@ static void print_place_status(const t_annealing_state& state,
2288
2290
fflush (stdout);
2289
2291
}
2290
2292
2291
- static void print_resources_utilization (const BlkLocRegistry& place_loc_vars ) {
2293
+ static void print_resources_utilization (const BlkLocRegistry& blk_loc_registry ) {
2292
2294
const auto & cluster_ctx = g_vpr_ctx.clustering ();
2293
2295
const auto & device_ctx = g_vpr_ctx.device ();
2294
- const auto & block_locs = place_loc_vars .block_locs ();
2296
+ const auto & block_locs = blk_loc_registry .block_locs ();
2295
2297
2296
2298
int max_block_name = 0 ;
2297
2299
int max_tile_name = 0 ;
@@ -2429,18 +2431,18 @@ static void calculate_reward_and_process_outcome(const t_placer_opts& placer_opt
2429
2431
}
2430
2432
}
2431
2433
2432
- static void copy_locs_to_global_state (const BlkLocRegistry& place_loc_vars ) {
2434
+ static void copy_locs_to_global_state (const BlkLocRegistry& blk_loc_registry ) {
2433
2435
auto & place_ctx = g_vpr_ctx.mutable_placement ();
2434
2436
2435
2437
// the placement location variables should be unlocked before being accessed
2436
2438
place_ctx.unlock_loc_vars ();
2437
2439
2438
2440
// copy the local location variables into the global state
2439
- auto & global_place_loc_vars = place_ctx.mutable_blk_loc_registry ();
2440
- global_place_loc_vars = place_loc_vars ;
2441
+ auto & global_blk_loc_registry = place_ctx.mutable_blk_loc_registry ();
2442
+ global_blk_loc_registry = blk_loc_registry ;
2441
2443
2442
2444
#ifndef NO_GRAPHICS
2443
2445
// update the graphics' reference to placement location variables
2444
- set_graphics_blk_loc_registry_ref (global_place_loc_vars );
2446
+ set_graphics_blk_loc_registry_ref (global_blk_loc_registry );
2445
2447
#endif
2446
2448
}
0 commit comments