Skip to content

Commit 1ed4704

Browse files
rename place_loc_vars args to blk_loc_registry
1 parent ee1448e commit 1ed4704

27 files changed

+110
-110
lines changed

vpr/src/base/read_place.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ struct t_block_loc;
1717
*/
1818
std::string read_place(const char* net_file,
1919
const char* place_file,
20-
BlkLocRegistry& place_loc_vars,
20+
BlkLocRegistry& blk_loc_registry,
2121
bool verify_file_hashes,
2222
const DeviceGrid& grid);
2323

2424
/**
2525
* This function is used to read a constraints file that specifies the desired locations of blocks.
2626
*/
2727
void read_constraints(const char* constraints_file,
28-
BlkLocRegistry& place_loc_vars);
28+
BlkLocRegistry& blk_loc_registry);
2929

3030
/**
3131
* This function prints out a place file.

vpr/src/base/vpr_context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ struct PackingMultithreadingContext : public Context {
385385
struct PlacementContext : public Context {
386386
private:
387387
/**
388-
* Determines if place_loc_vars_ can be accessed by calling getter methods.
388+
* Determines if blk_loc_registry_ can be accessed by calling getter methods.
389389
* This flag should be set to false at the beginning of the placement stage,
390390
* and set to true at the end of placement. This ensures that variables that
391391
* are subject to change during placement are kept local to the placement stage.
@@ -410,7 +410,7 @@ struct PlacementContext : public Context {
410410
const BlkLocRegistry& blk_loc_registry() const { VTR_ASSERT_SAFE(loc_vars_are_accessible_); return blk_loc_registry_; }
411411

412412
/**
413-
* @brief Makes place_loc_vars_ inaccessible through the getter methods.
413+
* @brief Makes blk_loc_registry_ inaccessible through the getter methods.
414414
*
415415
* This method should be called at the beginning of the placement stage to
416416
* guarantee that the placement stage code does not access block location variables
@@ -419,7 +419,7 @@ struct PlacementContext : public Context {
419419
void lock_loc_vars() { VTR_ASSERT_SAFE(loc_vars_are_accessible_); loc_vars_are_accessible_ = false; }
420420

421421
/**
422-
* @brief Makes place_loc_vars_ accessible through the getter methods.
422+
* @brief Makes blk_loc_registry_ accessible through the getter methods.
423423
*
424424
* This method should be called at the end of the placement stage to
425425
* make the block location information accessible for subsequent stages.

vpr/src/draw/draw.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ void free_draw_structs() {
570570
#endif /* NO_GRAPHICS */
571571
}
572572

573-
void init_draw_coords(float width_val, const BlkLocRegistry& place_loc_vars) {
573+
void init_draw_coords(float width_val, const BlkLocRegistry& blk_loc_registry) {
574574
#ifndef NO_GRAPHICS
575575
/* Load the arrays containing the left and bottom coordinates of the clbs *
576576
* forming the FPGA. tile_width_val sets the width and height of a drawn *
@@ -583,7 +583,7 @@ void init_draw_coords(float width_val, const BlkLocRegistry& place_loc_vars) {
583583
/* Store a reference to block location variables so that other drawing
584584
* functions can access block location information without accessing
585585
* the global placement state, which is inaccessible during placement.*/
586-
set_graphics_place_loc_vars_ref(place_loc_vars);
586+
set_graphics_blk_loc_registry_ref(blk_loc_registry);
587587

588588
if (!draw_state->show_graphics && !draw_state->save_graphics
589589
&& draw_state->graphics_commands.empty())
@@ -642,7 +642,7 @@ void init_draw_coords(float width_val, const BlkLocRegistry& place_loc_vars) {
642642
* draw_height});
643643
#else
644644
(void)width_val;
645-
(void)place_loc_vars;
645+
(void)blk_loc_registry;
646646
#endif /* NO_GRAPHICS */
647647
}
648648

@@ -1008,7 +1008,7 @@ static void highlight_blocks(double x, double y) {
10081008
}
10091009

10101010
auto& cluster_ctx = g_vpr_ctx.clustering();
1011-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
1011+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
10121012

10131013
VTR_ASSERT(clb_index != EMPTY_BLOCK_ID);
10141014

@@ -1052,7 +1052,7 @@ ClusterBlockId get_cluster_block_id_from_xy_loc(double x, double y) {
10521052
ClusterBlockId clb_index = EMPTY_BLOCK_ID;
10531053
auto& device_ctx = g_vpr_ctx.device();
10541054
auto& cluster_ctx = g_vpr_ctx.clustering();
1055-
const auto& grid_blocks = get_graphics_place_loc_vars_ref().grid_blocks();
1055+
const auto& grid_blocks = get_graphics_blk_loc_registry_ref().grid_blocks();
10561056

10571057
/// determine block ///
10581058
ezgl::rectangle clb_bbox;

vpr/src/draw/draw_basic.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void drawplace(ezgl::renderer* g) {
103103
t_draw_coords* draw_coords = get_draw_coords_vars();
104104
auto& device_ctx = g_vpr_ctx.device();
105105
auto& cluster_ctx = g_vpr_ctx.clustering();
106-
const auto& grid_blocks = get_graphics_place_loc_vars_ref().grid_blocks();
106+
const auto& grid_blocks = get_graphics_blk_loc_registry_ref().grid_blocks();
107107

108108
ClusterBlockId bnum;
109109
int num_sub_tiles;
@@ -230,7 +230,7 @@ void drawnets(ezgl::renderer* g) {
230230

231231
ClusterBlockId b1, b2;
232232
auto& cluster_ctx = g_vpr_ctx.clustering();
233-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
233+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
234234

235235
float transparency_factor;
236236
float NET_ALPHA = draw_state->net_alpha;
@@ -804,7 +804,7 @@ void draw_placement_macros(ezgl::renderer* g) {
804804
t_draw_coords* draw_coords = get_draw_coords_vars();
805805

806806
auto& place_ctx = g_vpr_ctx.placement();
807-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
807+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
808808

809809
for (const t_pl_macro& pl_macro : place_ctx.pl_macros) {
810810

@@ -1187,7 +1187,7 @@ void draw_crit_path_elements(const std::vector<tatum::TimingPath>& paths, const
11871187
}
11881188

11891189
int get_timing_path_node_layer_num(tatum::NodeId node) {
1190-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
1190+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
11911191
auto& atom_ctx = g_vpr_ctx.atom();
11921192

11931193
AtomPinId atom_pin = atom_ctx.lookup.tnode_atom_pin(node);
@@ -1420,7 +1420,7 @@ void draw_block_pin_util() {
14201420

14211421
auto& device_ctx = g_vpr_ctx.device();
14221422
auto& cluster_ctx = g_vpr_ctx.clustering();
1423-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
1423+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
14241424

14251425
std::map<t_physical_tile_type_ptr, size_t> total_input_pins;
14261426
std::map<t_physical_tile_type_ptr, size_t> total_output_pins;

vpr/src/draw/draw_global.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static t_draw_coords draw_coords;
2929
/**
3030
* @brief Stores a reference to a PlaceLocVars to be used in the graphics code.
3131
*/
32-
static std::optional<std::reference_wrapper<const BlkLocRegistry>> place_loc_vars_ref;
32+
static std::optional<std::reference_wrapper<const BlkLocRegistry>> blk_loc_registry_ref;
3333

3434
/*********************** Accessor Subroutines Definition ********************/
3535

@@ -45,12 +45,12 @@ t_draw_state* get_draw_state_vars() {
4545
return &draw_state;
4646
}
4747

48-
void set_graphics_place_loc_vars_ref(const BlkLocRegistry& place_loc_vars) {
49-
place_loc_vars_ref = std::ref(place_loc_vars);
48+
void set_graphics_blk_loc_registry_ref(const BlkLocRegistry& blk_loc_registry) {
49+
blk_loc_registry_ref = std::ref(blk_loc_registry);
5050
}
5151

52-
const BlkLocRegistry& get_graphics_place_loc_vars_ref() {
53-
return place_loc_vars_ref->get();
52+
const BlkLocRegistry& get_graphics_blk_loc_registry_ref() {
53+
return blk_loc_registry_ref->get();
5454
}
5555

5656
#endif // NO_GRAPHICS

vpr/src/draw/draw_global.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ t_draw_state* get_draw_state_vars();
3535
* global stage in place_ctx until the end of placement. After the placement is
3636
* done, the reference should point to the global state stored in place_ctx.
3737
*
38-
* @param place_loc_vars The PlaceLocVars that the reference will point to.
38+
* @param blk_loc_registry The PlaceLocVars that the reference will point to.
3939
*/
40-
void set_graphics_place_loc_vars_ref(const BlkLocRegistry& place_loc_vars);
40+
void set_graphics_blk_loc_registry_ref(const BlkLocRegistry& blk_loc_registry);
4141

4242
/**
4343
* @brief Returns the reference to placement block location variables.
4444
* @return A const reference to placement block location variables.
4545
*/
46-
const BlkLocRegistry& get_graphics_place_loc_vars_ref();
46+
const BlkLocRegistry& get_graphics_blk_loc_registry_ref();
4747

4848
#endif // NO_GRAPHICS
4949

vpr/src/draw/draw_searchbar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void draw_highlight_blocks_color(t_logical_block_type_ptr type,
110110

111111
t_draw_state* draw_state = get_draw_state_vars();
112112
auto& cluster_ctx = g_vpr_ctx.clustering();
113-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
113+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
114114

115115
for (k = 0; k < type->pb_type->num_pins; k++) { /* Each pin on a CLB */
116116
ClusterNetId net_id = cluster_ctx.clb_nlist.block_net(blk_id, k);

vpr/src/draw/draw_types.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
ezgl::color t_draw_state::block_color(ClusterBlockId blk) const {
1515
if (use_default_block_color_[blk]) {
1616
auto& cluster_ctx = g_vpr_ctx.clustering();
17-
const auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
17+
const auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
1818

1919
t_physical_tile_type_ptr tile_type = nullptr;
2020
if (block_locs.empty()) { //No placement, pick best match
@@ -87,7 +87,7 @@ float t_draw_coords::get_tile_height() {
8787
}
8888

8989
ezgl::rectangle t_draw_coords::get_pb_bbox(ClusterBlockId clb_index, const t_pb_graph_node& pb_gnode) {
90-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
90+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
9191
auto& cluster_ctx = g_vpr_ctx.clustering();
9292

9393
return get_pb_bbox(block_locs[clb_index].loc.layer,
@@ -152,7 +152,7 @@ ezgl::rectangle t_draw_coords::get_absolute_pb_bbox(const ClusterBlockId clb_ind
152152
}
153153

154154
ezgl::rectangle t_draw_coords::get_absolute_clb_bbox(const ClusterBlockId clb_index, const t_logical_block_type_ptr block_type) {
155-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
155+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
156156

157157
t_pl_loc loc = block_locs[clb_index].loc;
158158
return get_pb_bbox(loc.layer, loc.x, loc.y, loc.sub_tile, block_type);

vpr/src/draw/intra_logic_block.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void draw_internal_draw_subblk(ezgl::renderer* g) {
152152
}
153153
auto& device_ctx = g_vpr_ctx.device();
154154
auto& cluster_ctx = g_vpr_ctx.clustering();
155-
const auto& grid_blocks = get_graphics_place_loc_vars_ref().grid_blocks();
155+
const auto& grid_blocks = get_graphics_blk_loc_registry_ref().grid_blocks();
156156

157157
int total_layer_num = device_ctx.grid.get_num_layers();
158158

@@ -273,7 +273,7 @@ draw_internal_calc_coords(int type_descrip_index, t_pb_graph_node* pb_graph_node
273273
float sub_tile_x, sub_tile_y;
274274
float child_width, child_height;
275275
auto& device_ctx = g_vpr_ctx.device();
276-
const auto& grid_blocks = get_graphics_place_loc_vars_ref().grid_blocks();
276+
const auto& grid_blocks = get_graphics_blk_loc_registry_ref().grid_blocks();
277277

278278
// get the bbox for this pb type
279279
ezgl::rectangle& pb_bbox = get_draw_coords_vars()->blk_info.at(type_descrip_index).get_pb_bbox_ref(*pb_graph_node);
@@ -341,7 +341,7 @@ static void draw_internal_pb(const ClusterBlockId clb_index, t_pb* pb, const ezg
341341
t_draw_coords* draw_coords = get_draw_coords_vars();
342342
t_draw_state* draw_state = get_draw_state_vars();
343343

344-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
344+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
345345

346346
t_selected_sub_block_info& sel_sub_info = get_selected_sub_block_info();
347347

@@ -559,7 +559,7 @@ void draw_logical_connections(ezgl::renderer* g) {
559559
t_draw_state* draw_state = get_draw_state_vars();
560560

561561
auto& atom_ctx = g_vpr_ctx.atom();
562-
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
562+
auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
563563

564564
g->set_line_dash(ezgl::line_dash::none);
565565

@@ -652,7 +652,7 @@ void find_pin_index_at_model_scope(const AtomPinId pin_id, const AtomBlockId blk
652652
int atom_port_index = atom_ctx.nlist.pin_port_bit(pin_id);
653653

654654
//The index of this pin in the model is the pins counted so-far
655-
//(i.e. accross previous ports) plus the index in the port
655+
//(i.e. across previous ports) plus the index in the port
656656
*pin_index = pin_cnt + atom_port_index;
657657
}
658658

vpr/src/draw/manual_moves.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void calculate_cost_callback(GtkWidget* /*widget*/, GtkWidget* grid) {
149149
bool is_manual_move_legal(ClusterBlockId block_id, t_pl_loc to) {
150150
auto& cluster_ctx = g_vpr_ctx.clustering();
151151
auto& device_ctx = g_vpr_ctx.device();
152-
const auto& grid_blocks = get_graphics_place_loc_vars_ref().grid_blocks();
152+
const auto& grid_blocks = get_graphics_blk_loc_registry_ref().grid_blocks();
153153

154154
//if the block is not found
155155
if ((!cluster_ctx.clb_nlist.valid_block_id(ClusterBlockId(block_id)))) {
@@ -175,14 +175,14 @@ bool is_manual_move_legal(ClusterBlockId block_id, t_pl_loc to) {
175175
//If the destination block is user constrained, abort this swap
176176
ClusterBlockId b_to = grid_blocks.block_at_location(to);
177177
if (b_to != INVALID_BLOCK_ID && b_to != EMPTY_BLOCK_ID) {
178-
if (get_graphics_place_loc_vars_ref().block_locs()[b_to].is_fixed) {
178+
if (get_graphics_blk_loc_registry_ref().block_locs()[b_to].is_fixed) {
179179
invalid_breakpoint_entry_window("Block is fixed");
180180
return false;
181181
}
182182
}
183183

184184
//If the block requested is already in that location.
185-
t_pl_loc current_block_loc = get_graphics_place_loc_vars_ref().block_locs()[block_id].loc;
185+
t_pl_loc current_block_loc = get_graphics_blk_loc_registry_ref().block_locs()[block_id].loc;
186186
if (to.x == current_block_loc.x && to.y == current_block_loc.y && to.sub_tile == current_block_loc.sub_tile) {
187187
invalid_breakpoint_entry_window("The block is currently in this location");
188188
return false;

vpr/src/draw/search_bar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void auto_zoom_rr_node(RRNodeId rr_node_id) {
283283
void highlight_cluster_block(ClusterBlockId clb_index) {
284284
char msg[vtr::bufsize];
285285
auto& cluster_ctx = g_vpr_ctx.clustering();
286-
const auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
286+
const auto& block_locs = get_graphics_blk_loc_registry_ref().block_locs();
287287

288288
/// determine block ///
289289
ezgl::rectangle clb_bbox;

vpr/src/place/analytic_placer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ constexpr int HEAP_STALLED_ITERATIONS_STOP = 15;
129129
* Placement & device info is accessed via g_vpr_ctx
130130
*/
131131

132-
AnalyticPlacer::AnalyticPlacer(BlkLocRegistry& place_loc_vars)
133-
: placer_loc_vars_ref_(place_loc_vars) {
132+
AnalyticPlacer::AnalyticPlacer(BlkLocRegistry& blk_loc_registry)
133+
: placer_loc_vars_ref_(blk_loc_registry) {
134134
//Eigen::initParallel();
135135

136136
// TODO: PlacerHeapCfg should be externally configured & supplied

vpr/src/place/centroid_move_generator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ e_create_move CentroidMoveGenerator::propose_move(t_pl_blocks_to_be_moved& block
4949
const auto& device_ctx = g_vpr_ctx.device();
5050
const auto& cluster_ctx = g_vpr_ctx.clustering();
5151
const auto& place_move_ctx = placer_ctx.move();
52-
const auto& place_loc_vars = placer_ctx.blk_loc_registry();
52+
const auto& blk_loc_registry = placer_ctx.blk_loc_registry();
5353

5454
// Find a movable block based on blk_type
5555
ClusterBlockId b_from = propose_block_to_move(placer_opts,
@@ -84,17 +84,17 @@ e_create_move CentroidMoveGenerator::propose_move(t_pl_blocks_to_be_moved& block
8484
t_pl_loc to, centroid;
8585

8686
/* Calculate the centroid location*/
87-
calculate_centroid_loc(b_from, false, centroid, nullptr, noc_attraction_enabled_, noc_attraction_w_, place_loc_vars);
87+
calculate_centroid_loc(b_from, false, centroid, nullptr, noc_attraction_enabled_, noc_attraction_w_, blk_loc_registry);
8888

8989
// Centroid location is not necessarily a valid location, and the downstream location expects a valid
9090
// layer for the centroid location. So if the layer is not valid, we set it to the same layer as from loc.
9191
centroid.layer = (centroid.layer < 0) ? from.layer : centroid.layer;
9292
/* Find a location near the weighted centroid_loc */
93-
if (!find_to_loc_centroid(cluster_from_type, from, centroid, range_limiters, to, b_from, place_loc_vars)) {
93+
if (!find_to_loc_centroid(cluster_from_type, from, centroid, range_limiters, to, b_from, blk_loc_registry)) {
9494
return e_create_move::ABORT;
9595
}
9696

97-
e_create_move create_move = ::create_move(blocks_affected, b_from, to, place_loc_vars);
97+
e_create_move create_move = ::create_move(blocks_affected, b_from, to, blk_loc_registry);
9898

9999
//Check that all the blocks affected by the move would still be in a legal floorplan region after the swap
100100
if (!floorplan_legal(blocks_affected)) {

vpr/src/place/critical_uniform_move_generator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ e_create_move CriticalUniformMoveGenerator::propose_move(t_pl_blocks_to_be_moved
1515
auto& cluster_ctx = g_vpr_ctx.clustering();
1616
const auto& placer_ctx = placer_ctx_.get();
1717
const auto& block_locs = placer_ctx.block_locs();
18-
const auto& place_loc_vars = placer_ctx.blk_loc_registry();
18+
const auto& blk_loc_registry = placer_ctx.blk_loc_registry();
1919

2020
ClusterNetId net_from;
2121
int pin_from;
@@ -41,11 +41,11 @@ e_create_move CriticalUniformMoveGenerator::propose_move(t_pl_blocks_to_be_moved
4141

4242
t_pl_loc to;
4343
to.layer = from.layer;
44-
if (!find_to_loc_uniform(cluster_from_type, rlim, from, to, b_from, place_loc_vars)) {
44+
if (!find_to_loc_uniform(cluster_from_type, rlim, from, to, b_from, blk_loc_registry)) {
4545
return e_create_move::ABORT;
4646
}
4747

48-
e_create_move create_move = ::create_move(blocks_affected, b_from, to, place_loc_vars);
48+
e_create_move create_move = ::create_move(blocks_affected, b_from, to, blk_loc_registry);
4949

5050
//Check that all the blocks affected by the move would still be in a legal floorplan region after the swap
5151
if (!floorplan_legal(blocks_affected)) {

0 commit comments

Comments
 (0)