Skip to content

Commit 15fab24

Browse files
rename getter methods of PlacerContext
1 parent 34a680a commit 15fab24

15 files changed

+35
-35
lines changed

vpr/src/place/centroid_move_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ e_create_move CentroidMoveGenerator::propose_move(t_pl_blocks_to_be_moved& block
4444
const t_placer_opts& placer_opts,
4545
const PlacerCriticalities* /*criticalities*/) {
4646
auto& placer_ctx = placer_ctx_.get();
47-
const auto& block_locs = placer_ctx.get_block_locs();
47+
const auto& block_locs = placer_ctx.block_locs();
4848
const auto& device_ctx = g_vpr_ctx.device();
4949
const auto& cluster_ctx = g_vpr_ctx.clustering();
5050
auto& place_move_ctx = placer_ctx.mutable_move();

vpr/src/place/critical_uniform_move_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ e_create_move CriticalUniformMoveGenerator::propose_move(t_pl_blocks_to_be_moved
1313
const PlacerCriticalities* /*criticalities*/) {
1414
auto& cluster_ctx = g_vpr_ctx.clustering();
1515
auto& placer_ctx = placer_ctx_.get();
16-
const auto& block_locs = placer_ctx.get_block_locs();
16+
const auto& block_locs = placer_ctx.block_locs();
1717

1818
ClusterNetId net_from;
1919
int pin_from;

vpr/src/place/feasible_region_move_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ e_create_move FeasibleRegionMoveGenerator::propose_move(t_pl_blocks_to_be_moved&
1818
const auto& cluster_ctx = g_vpr_ctx.clustering();
1919
auto& placer_ctx = placer_ctx_.get();
2020
auto& place_move_ctx = placer_ctx.mutable_move();
21-
const auto& block_locs = placer_ctx.get_block_locs();
21+
const auto& block_locs = placer_ctx.block_locs();
2222
const auto& place_loc_vars = placer_ctx.place_loc_vars();
2323

2424
ClusterNetId net_from;

vpr/src/place/manual_move_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ e_create_move ManualMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
2929
auto& place_ctx = g_vpr_ctx.placement();
3030
auto& cluster_ctx = g_vpr_ctx.clustering();
3131
auto& device_ctx = g_vpr_ctx.device();
32-
auto& block_locs = placer_ctx_.get().get_block_locs();
32+
auto& block_locs = placer_ctx_.get().block_locs();
3333

3434
int block_id = -1;
3535
t_pl_loc to;

vpr/src/place/median_move_generator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
1616
const auto& device_ctx = g_vpr_ctx.device();
1717
auto& placer_ctx = placer_ctx_.get();
1818
auto& place_move_ctx = placer_ctx.mutable_move();
19-
const auto& block_locs = placer_ctx.get_block_locs();
19+
const auto& block_locs = placer_ctx.block_locs();
2020
const auto& place_loc_vars = placer_ctx.place_loc_vars();
2121

2222
//Find a movable block based on blk_type
@@ -199,7 +199,7 @@ void MedianMoveGenerator::get_bb_from_scratch_excluding_block(ClusterNetId net_i
199199
bool& skip_net) {
200200
//TODO: account for multiple physical pin instances per logical pin
201201
const auto& placer_ctx = placer_ctx_.get();
202-
const auto& block_locs = placer_ctx.get_block_locs();
202+
const auto& block_locs = placer_ctx.block_locs();
203203

204204
skip_net = true;
205205

vpr/src/place/move_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ ClusterBlockId pick_from_highly_critical_block(ClusterNetId& net_from,
672672
const PlacerContext& placer_ctx) {
673673
auto& cluster_ctx = g_vpr_ctx.clustering();
674674
auto& place_move_ctx = placer_ctx.move();
675-
auto& block_locs = placer_ctx.get_block_locs();
675+
auto& block_locs = placer_ctx.block_locs();
676676

677677
//Initialize critical net and pin to be invalid
678678
net_from = ClusterNetId::INVALID();
@@ -707,7 +707,7 @@ ClusterBlockId pick_from_highly_critical_block(ClusterNetId& net_from,
707707
const PlacerContext& placer_ctx) {
708708
auto& cluster_ctx = g_vpr_ctx.clustering();
709709
auto& place_move_ctx = placer_ctx.move();
710-
auto& block_locs = placer_ctx.get_block_locs();
710+
auto& block_locs = placer_ctx.block_locs();
711711

712712
//Initialize critical net and pin to be invalid
713713
net_from = ClusterNetId::INVALID();

vpr/src/place/net_cost_handler.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static void update_net_bb(const ClusterNetId net,
503503
const t_pl_moved_block& pl_moved_block) {
504504
const auto& cluster_ctx = g_vpr_ctx.clustering();
505505
const auto& placer_ctx = placer_ctx_ref->get();
506-
const auto& block_locs = placer_ctx.get_block_locs();
506+
const auto& block_locs = placer_ctx.block_locs();
507507

508508
if (cluster_ctx.clb_nlist.net_sinks(net).size() < SMALL_NET) {
509509
//For small nets brute-force bounding box update is faster
@@ -544,7 +544,7 @@ static void update_net_layer_bb(const ClusterNetId net,
544544
const t_pl_moved_block& pl_moved_block) {
545545
auto& cluster_ctx = g_vpr_ctx.clustering();
546546
const auto& placer_ctx = placer_ctx_ref->get();
547-
auto& block_locs = placer_ctx.get_block_locs();
547+
auto& block_locs = placer_ctx.block_locs();
548548

549549
if (cluster_ctx.clb_nlist.net_sinks(net).size() < SMALL_NET) {
550550
//For small nets brute-force bounding box update is faster
@@ -615,7 +615,7 @@ static void update_td_delta_costs(const PlaceDelayModel* delay_model,
615615
*/
616616
auto& cluster_ctx = g_vpr_ctx.clustering();
617617
auto& placer_ctx = placer_ctx_ref->get();
618-
auto& block_locs = placer_ctx.get_block_locs();
618+
auto& block_locs = placer_ctx.block_locs();
619619

620620
const auto& connection_delay = placer_ctx.timing().connection_delay;
621621
auto& connection_timing_cost = placer_ctx.mutable_timing().connection_timing_cost;
@@ -737,7 +737,7 @@ static void get_non_updatable_bb(ClusterNetId net_id,
737737
auto& cluster_ctx = g_vpr_ctx.clustering();
738738
auto& device_ctx = g_vpr_ctx.device();
739739
auto& placer_ctx = placer_ctx_ref->get();
740-
auto& block_locs = placer_ctx.get_block_locs();
740+
auto& block_locs = placer_ctx.block_locs();
741741

742742
ClusterBlockId bnum = cluster_ctx.clb_nlist.net_driver_block(net_id);
743743
int pnum = placer_ctx.place_loc_vars().net_pin_to_tile_pin_index(net_id, 0);
@@ -810,7 +810,7 @@ static void get_non_updatable_layer_bb(ClusterNetId net_id,
810810
auto& device_ctx = g_vpr_ctx.device();
811811
auto& cluster_ctx = g_vpr_ctx.clustering();
812812
auto& placer_ctx = placer_ctx_ref->get();
813-
auto& block_locs = placer_ctx.get_block_locs();
813+
auto& block_locs = placer_ctx.block_locs();
814814

815815
int num_layers = device_ctx.grid.get_num_layers();
816816
for (int layer_num = 0; layer_num < device_ctx.grid.get_num_layers(); layer_num++) {
@@ -1501,7 +1501,7 @@ static void get_bb_from_scratch(ClusterNetId net_id,
15011501
auto& device_ctx = g_vpr_ctx.device();
15021502
auto& grid = device_ctx.grid;
15031503
const auto& placer_ctx = placer_ctx_ref->get();
1504-
auto& block_locs = placer_ctx.get_block_locs();
1504+
auto& block_locs = placer_ctx.block_locs();
15051505

15061506
ClusterBlockId bnum = cluster_ctx.clb_nlist.net_driver_block(net_id);
15071507
t_pl_loc block_loc = block_locs[bnum].loc;
@@ -1622,7 +1622,7 @@ static void get_layer_bb_from_scratch(ClusterNetId net_id,
16221622
auto& cluster_ctx = g_vpr_ctx.clustering();
16231623
auto& grid = device_ctx.grid;
16241624
auto& placer_ctx = placer_ctx_ref->get();
1625-
auto& block_locs = placer_ctx.get_block_locs();
1625+
auto& block_locs = placer_ctx.block_locs();
16261626

16271627
const int num_layers = device_ctx.grid.get_num_layers();
16281628
std::vector<int> xmin(num_layers, OPEN);

vpr/src/place/place.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ void try_place(const Netlist<>& net_list,
459459

460460
if (!placer_opts.write_initial_place_file.empty()) {
461461
print_place(nullptr, nullptr, (placer_opts.write_initial_place_file + ".init.place").c_str(),
462-
placer_ctx.get_block_locs());
462+
placer_ctx.block_locs());
463463
}
464464

465465
#ifdef ENABLE_ANALYTIC_PLACE
@@ -1126,7 +1126,7 @@ static void placement_inner_loop(const t_annealing_state* state,
11261126
state->num_temps + 1, inner_placement_save_count);
11271127
VTR_LOG("Saving placement to file at temperature move %d / %d: %s\n",
11281128
inner_iter, state->move_lim, filename.c_str());
1129-
print_place(nullptr, nullptr, filename.c_str(), placer_ctx.get_block_locs());
1129+
print_place(nullptr, nullptr, filename.c_str(), placer_ctx.block_locs());
11301130
++inner_placement_save_count;
11311131
}
11321132
}
@@ -1279,7 +1279,7 @@ static e_move_result try_swap(const t_annealing_state* state,
12791279
* Returns whether the swap is accepted, rejected or aborted. *
12801280
* Passes back the new value of the cost functions. */
12811281

1282-
const auto& block_locs = placer_ctx.get_block_locs();
1282+
const auto& block_locs = placer_ctx.block_locs();
12831283

12841284
float rlim_escape_fraction = placer_opts.rlim_escape_fraction;
12851285
float timing_tradeoff = placer_opts.timing_tradeoff;
@@ -1486,7 +1486,7 @@ static e_move_result try_swap(const t_annealing_state* state,
14861486
g_vpr_ctx.placement().cube_bb);
14871487

14881488
/* Update clb data structures since we kept the move. */
1489-
commit_move_blocks(blocks_affected, placer_ctx.get_mutable_grid_blocks());
1489+
commit_move_blocks(blocks_affected, placer_ctx.mutable_grid_blocks());
14901490

14911491
if (proposed_action.logical_blk_type_index != -1) { //if the agent proposed the block type, then collect the block type stat
14921492
++move_type_stat.accepted_moves[proposed_action.logical_blk_type_index][(int)proposed_action.move_type];
@@ -1849,8 +1849,8 @@ static void alloc_and_load_placement_structs(float place_cost_exp,
18491849

18501850
const int num_layers = device_ctx.grid.get_num_layers();
18511851

1852-
auto& block_locs = placer_ctx.get_mutable_block_locs();
1853-
auto& grid_blocks = placer_ctx.get_mutable_grid_blocks();
1852+
auto& block_locs = placer_ctx.mutable_block_locs();
1853+
auto& grid_blocks = placer_ctx.mutable_grid_blocks();
18541854
init_placement_context(block_locs, grid_blocks);
18551855

18561856
int max_pins_per_clb = 0;
@@ -1993,13 +1993,13 @@ static void check_place(const t_placer_costs& costs,
19931993

19941994
error += check_placement_consistency(placer_ctx.place_loc_vars());
19951995
error += check_placement_costs(costs, delay_model, criticalities, place_algorithm, placer_ctx);
1996-
error += check_placement_floorplanning(placer_ctx.get_block_locs());
1996+
error += check_placement_floorplanning(placer_ctx.block_locs());
19971997

19981998
if (noc_opts.noc) {
19991999
// check the NoC costs during placement if the user is using the NoC supported flow
2000-
error += check_noc_placement_costs(costs, ERROR_TOL, noc_opts, placer_ctx.get_block_locs());
2000+
error += check_noc_placement_costs(costs, ERROR_TOL, noc_opts, placer_ctx.block_locs());
20012001
// make sure NoC routing configuration does not create any cycles in CDG
2002-
error += (int)noc_routing_has_cycle(placer_ctx.get_block_locs());
2002+
error += (int)noc_routing_has_cycle(placer_ctx.block_locs());
20032003
}
20042004

20052005
if (error == 0) {

vpr/src/place/place_checkpoint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void restore_best_placement(PlacerContext& placer_ctx,
5353
if (placement_checkpoint.cp_is_valid() && timing_info->least_slack_critical_path().delay() > placement_checkpoint.get_cp_cpd() && costs.bb_cost * 1.05 > placement_checkpoint.get_cp_bb_cost()) {
5454
//restore the latest placement checkpoint
5555

56-
costs = placement_checkpoint.restore_placement(placer_ctx.get_mutable_block_locs(), placer_ctx.get_mutable_grid_blocks());
56+
costs = placement_checkpoint.restore_placement(placer_ctx.mutable_block_locs(), placer_ctx.mutable_grid_blocks());
5757

5858
//recompute timing from scratch
5959
placer_criticalities.get()->set_recompute_required();
@@ -74,7 +74,7 @@ void restore_best_placement(PlacerContext& placer_ctx,
7474
* and need to be re-computed from scratch.
7575
*/
7676
if (noc_opts.noc) {
77-
reinitialize_noc_routing(costs, {}, placer_ctx.get_block_locs());
77+
reinitialize_noc_routing(costs, {}, placer_ctx.block_locs());
7878
}
7979

8080
VTR_LOG("\nCheckpoint restored\n");

vpr/src/place/place_delay_model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ void comp_td_connection_delays(const PlaceDelayModel* delay_model,
401401
PlacerContext& placer_ctx) {
402402
const auto& cluster_ctx = g_vpr_ctx.clustering();
403403
auto& p_timing_ctx = placer_ctx.mutable_timing();
404-
auto& block_locs = placer_ctx.get_block_locs();
404+
auto& block_locs = placer_ctx.block_locs();
405405
auto& connection_delay = p_timing_ctx.connection_delay;
406406

407407
for (ClusterNetId net_id : cluster_ctx.clb_nlist.nets()) {

vpr/src/place/place_timing_update.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static double comp_td_connection_cost(const PlaceDelayModel* delay_model,
355355
ClusterNetId net,
356356
int ipin) {
357357
const auto& p_timing_ctx = placer_ctx.timing();
358-
const auto& block_locs = placer_ctx.get_block_locs();
358+
const auto& block_locs = placer_ctx.block_locs();
359359

360360
VTR_ASSERT_SAFE_MSG(ipin > 0, "Shouldn't be calculating connection timing cost for driver pins");
361361

vpr/src/place/placer_context.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ class PlacerContext : public Context {
141141
inline const PlacerMoveContext& move() const { return move_; }
142142
inline PlacerMoveContext& mutable_move() { return move_; }
143143

144-
inline const vtr::vector_map<ClusterBlockId, t_block_loc>& get_block_locs() const { return loc_vars_.block_locs(); }
145-
inline vtr::vector_map<ClusterBlockId, t_block_loc>& get_mutable_block_locs() { return loc_vars_.mutable_block_locs(); }
144+
inline const vtr::vector_map<ClusterBlockId, t_block_loc>& block_locs() const { return loc_vars_.block_locs(); }
145+
inline vtr::vector_map<ClusterBlockId, t_block_loc>& mutable_block_locs() { return loc_vars_.mutable_block_locs(); }
146146

147-
inline const GridBlock& get_grid_blocks() const { return loc_vars_.grid_blocks(); }
148-
inline GridBlock& get_mutable_grid_blocks() { return loc_vars_.mutable_grid_blocks(); }
147+
inline const GridBlock& grid_blocks() const { return loc_vars_.grid_blocks(); }
148+
inline GridBlock& mutable_grid_blocks() { return loc_vars_.mutable_grid_blocks(); }
149149

150150
inline const vtr::vector_map<ClusterPinId, int>& physical_pins() const { return loc_vars_.physical_pins(); }
151151
inline vtr::vector_map<ClusterPinId, int>& mutable_physical_pins() { return loc_vars_.mutable_physical_pins(); }

vpr/src/place/uniform_move_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ e_create_move UniformMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks
1313
const PlacerCriticalities* /*criticalities*/) {
1414
const auto& cluster_ctx = g_vpr_ctx.clustering();
1515
const auto& placer_ctx = placer_ctx_.get();
16-
const auto& block_locs = placer_ctx.get_block_locs();
16+
const auto& block_locs = placer_ctx.block_locs();
1717
const auto& place_loc_vars = placer_ctx.place_loc_vars();
1818

1919
//Find a movable block based on blk_type

vpr/src/place/weighted_centroid_move_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ e_create_move WeightedCentroidMoveGenerator::propose_move(t_pl_blocks_to_be_move
1515
const auto& cluster_ctx = g_vpr_ctx.clustering();
1616
const auto& device_ctx = g_vpr_ctx.device();
1717
auto& placer_ctx = placer_ctx_.get();
18-
const auto& block_locs = placer_ctx.get_block_locs();
18+
const auto& block_locs = placer_ctx.block_locs();
1919
auto& place_move_ctx = placer_ctx.mutable_move();
2020
const auto& place_loc_vars = placer_ctx.place_loc_vars();
2121

vpr/src/place/weighted_median_move_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ e_create_move WeightedMedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved&
1717
const PlacerCriticalities* criticalities) {
1818
const auto& cluster_ctx = g_vpr_ctx.clustering();
1919
auto& placer_ctx = placer_ctx_.get();
20-
const auto& block_locs = placer_ctx.get_block_locs();
20+
const auto& block_locs = placer_ctx.block_locs();
2121
auto& place_move_ctx = placer_ctx.mutable_move();
2222
const auto& place_loc_vars = placer_ctx.place_loc_vars();
2323

0 commit comments

Comments
 (0)