Skip to content

Commit 0c576c5

Browse files
rename remaining place_loc_vars to blk_loc_registry
1 parent 6db42e9 commit 0c576c5

20 files changed

+204
-204
lines changed

vpr/src/base/place_and_route.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,10 @@ static float comp_width(t_chan* chan, float x, float separation) {
575575
void post_place_sync() {
576576
/* Go through each block */
577577
const auto& cluster_ctx = g_vpr_ctx.clustering();
578-
auto& place_loc_vars = g_vpr_ctx.mutable_placement().mutable_blk_loc_registry();
578+
auto& blk_loc_registry = g_vpr_ctx.mutable_placement().mutable_blk_loc_registry();
579579

580580
// Cluster-based netlist is used for placement
581581
for (const ClusterBlockId block_id : cluster_ctx.clb_nlist.blocks()) {
582-
place_sync_external_block_connections(block_id, place_loc_vars);
582+
place_sync_external_block_connections(block_id, blk_loc_registry);
583583
}
584584
}

vpr/src/base/read_place.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ static void read_place_header(std::ifstream& placement_file,
2222
const DeviceGrid& grid);
2323

2424
static std::string read_place_body(std::ifstream& placement_file,
25-
BlkLocRegistry& place_loc_vars,
25+
BlkLocRegistry& blk_loc_registry,
2626
const char* place_file,
2727
bool is_place_file);
2828

2929
std::string read_place(const char* net_file,
3030
const char* place_file,
31-
BlkLocRegistry& place_loc_vars,
31+
BlkLocRegistry& blk_loc_registry,
3232
bool verify_file_digests,
3333
const DeviceGrid& grid) {
3434
std::ifstream fstream(place_file);
@@ -44,7 +44,7 @@ std::string read_place(const char* net_file,
4444
VTR_LOG("\n");
4545

4646
read_place_header(fstream, net_file, place_file, verify_file_digests, grid);
47-
std::string placement_id = read_place_body(fstream, place_loc_vars, place_file, is_place_file);
47+
std::string placement_id = read_place_body(fstream, blk_loc_registry, place_file, is_place_file);
4848

4949
VTR_LOG("Successfully read %s.\n", place_file);
5050
VTR_LOG("\n");
@@ -53,7 +53,7 @@ std::string read_place(const char* net_file,
5353
}
5454

5555
void read_constraints(const char* constraints_file,
56-
BlkLocRegistry& place_loc_vars) {
56+
BlkLocRegistry& blk_loc_registry) {
5757
std::ifstream fstream(constraints_file);
5858
if (!fstream) {
5959
VPR_FATAL_ERROR(VPR_ERROR_PLACE_F,
@@ -66,7 +66,7 @@ void read_constraints(const char* constraints_file,
6666
VTR_LOG("Reading %s.\n", constraints_file);
6767
VTR_LOG("\n");
6868

69-
read_place_body(fstream, place_loc_vars, constraints_file, is_place_file);
69+
read_place_body(fstream, blk_loc_registry, constraints_file, is_place_file);
7070

7171
VTR_LOG("Successfully read constraints file %s.\n", constraints_file);
7272
VTR_LOG("\n");
@@ -206,12 +206,12 @@ static void read_place_header(std::ifstream& placement_file,
206206
* or a constraints file (is_place_file = false).
207207
*/
208208
static std::string read_place_body(std::ifstream& placement_file,
209-
BlkLocRegistry& place_loc_vars,
209+
BlkLocRegistry& blk_loc_registry,
210210
const char* place_file,
211211
bool is_place_file) {
212212
auto& cluster_ctx = g_vpr_ctx.clustering();
213213
auto& atom_ctx = g_vpr_ctx.atom();
214-
auto& block_locs = place_loc_vars.mutable_block_locs();
214+
auto& block_locs = blk_loc_registry.mutable_block_locs();
215215

216216
std::string line;
217217
int lineno = 0;
@@ -314,7 +314,7 @@ static std::string read_place_body(std::ifstream& placement_file,
314314
blk_id, loc.x, loc.y, loc.layer, loc.sub_tile, constraint_loc.x, constraint_loc.y, constraint_loc.layer, constraint_loc.sub_tile);
315315
}
316316
}
317-
set_block_location(blk_id, loc, place_loc_vars);
317+
set_block_location(blk_id, loc, blk_loc_registry);
318318
}
319319

320320
//need to lock down blocks if it is a constraints file

vpr/src/draw/draw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
4646

4747
//Initializes the drawing locations.
4848
//FIXME: Currently broken if no rr-graph is loaded
49-
void init_draw_coords(float clb_width, const BlkLocRegistry& place_loc_vars);
49+
void init_draw_coords(float clb_width, const BlkLocRegistry& blk_loc_registry);
5050

5151
/* Sets the static show_graphics and gr_automode variables to the *
5252
* desired values. They control if graphics are enabled and, if so, *

vpr/src/draw/draw_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ struct t_draw_coords {
397397

398398
private:
399399
float tile_width;
400-
friend void init_draw_coords(float width_val, const BlkLocRegistry& place_loc_vars);
400+
friend void init_draw_coords(float width_val, const BlkLocRegistry& blk_loc_registry);
401401
};
402402

403403
#endif // NO_GRAPHICS

vpr/src/place/analytic_placer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class AnalyticPlacer {
123123
* To tune these parameters, change directly in constructor
124124
*/
125125
AnalyticPlacer() = delete;
126-
explicit AnalyticPlacer(BlkLocRegistry& place_loc_vars);
126+
explicit AnalyticPlacer(BlkLocRegistry& blk_loc_registry);
127127

128128
/*
129129
* @brief main function of analytic placement

vpr/src/place/initial_noc_placement.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,34 +31,34 @@ static bool accept_noc_swap(double delta_cost, double prob);
3131
* @brief Places a constrained NoC router within its partition region.
3232
*
3333
* @param router_blk_id NoC router cluster block ID
34-
* @param place_loc_vars Placement block location information. To be
34+
* @param blk_loc_registry Placement block location information. To be
3535
* filled with the location where pl_macro is placed.
3636
*/
3737
static void place_constrained_noc_router(ClusterBlockId router_blk_id,
38-
BlkLocRegistry& place_loc_vars);
38+
BlkLocRegistry& blk_loc_registry);
3939

4040
/**
4141
* @brief Randomly places unconstrained NoC routers.
4242
*
4343
* @param unfixed_routers Contains the cluster block ID for all unconstrained
4444
* NoC routers.
4545
* @param seed Used for shuffling NoC routers.
46-
* @param place_loc_vars Placement block location information. To be filled
46+
* @param blk_loc_registry Placement block location information. To be filled
4747
* with the location where pl_macro is placed.
4848
*/
4949
static void place_noc_routers_randomly(std::vector<ClusterBlockId>& unfixed_routers,
5050
int seed,
51-
BlkLocRegistry& place_loc_vars);
51+
BlkLocRegistry& blk_loc_registry);
5252

5353
/**
5454
* @brief Runs a simulated annealing optimizer for NoC routers.
5555
*
5656
* @param noc_opts Contains weighting factors for NoC cost terms.
57-
* @param place_loc_vars Placement block location information.
57+
* @param blk_loc_registry Placement block location information.
5858
* To be filled with the location where pl_macro is placed.
5959
*/
6060
static void noc_routers_anneal(const t_noc_opts& noc_opts,
61-
BlkLocRegistry& place_loc_vars);
61+
BlkLocRegistry& blk_loc_registry);
6262

6363
static bool accept_noc_swap(double delta_cost, double prob) {
6464
if (delta_cost <= 0.0) {
@@ -78,7 +78,7 @@ static bool accept_noc_swap(double delta_cost, double prob) {
7878
}
7979

8080
static void place_constrained_noc_router(ClusterBlockId router_blk_id,
81-
BlkLocRegistry& place_loc_vars) {
81+
BlkLocRegistry& blk_loc_registry) {
8282
auto& cluster_ctx = g_vpr_ctx.clustering();
8383
const auto& floorplanning_ctx = g_vpr_ctx.floorplanning();
8484

@@ -94,11 +94,11 @@ static void place_constrained_noc_router(ClusterBlockId router_blk_id,
9494

9595
bool macro_placed = false;
9696
for (int i_try = 0; i_try < MAX_NUM_TRIES_TO_PLACE_MACROS_RANDOMLY && !macro_placed; i_try++) {
97-
macro_placed = try_place_macro_randomly(pl_macro, pr, block_type, e_pad_loc_type::FREE, place_loc_vars);
97+
macro_placed = try_place_macro_randomly(pl_macro, pr, block_type, e_pad_loc_type::FREE, blk_loc_registry);
9898
}
9999

100100
if (!macro_placed) {
101-
macro_placed = try_place_macro_exhaustively(pl_macro, pr, block_type, e_pad_loc_type::FREE, place_loc_vars);
101+
macro_placed = try_place_macro_exhaustively(pl_macro, pr, block_type, e_pad_loc_type::FREE, blk_loc_registry);
102102
}
103103

104104
if (!macro_placed) {
@@ -108,12 +108,12 @@ static void place_constrained_noc_router(ClusterBlockId router_blk_id,
108108

109109
static void place_noc_routers_randomly(std::vector<ClusterBlockId>& unfixed_routers,
110110
int seed,
111-
BlkLocRegistry& place_loc_vars) {
111+
BlkLocRegistry& blk_loc_registry) {
112112
const auto& compressed_grids = g_vpr_ctx.placement().compressed_block_grids;
113113
const auto& noc_ctx = g_vpr_ctx.noc();
114114
const auto& cluster_ctx = g_vpr_ctx.clustering();
115115
const auto& device_ctx = g_vpr_ctx.device();
116-
const GridBlock& grid_blocks = place_loc_vars.grid_blocks();
116+
const GridBlock& grid_blocks = blk_loc_registry.grid_blocks();
117117

118118
/*
119119
* Unconstrained NoC routers are placed randomly, then NoC cost is optimized using simulated annealing.
@@ -166,7 +166,7 @@ static void place_noc_routers_randomly(std::vector<ClusterBlockId>& unfixed_rout
166166
t_pl_macro pl_macro;
167167
pl_macro.members.push_back(macro_member);
168168

169-
bool legal = try_place_macro(pl_macro, loc, place_loc_vars);
169+
bool legal = try_place_macro(pl_macro, loc, blk_loc_registry);
170170
if (!legal) {
171171
VPR_FATAL_ERROR(VPR_ERROR_PLACE, "Could not place a router cluster into an empty physical router.");
172172
}
@@ -180,9 +180,9 @@ static void place_noc_routers_randomly(std::vector<ClusterBlockId>& unfixed_rout
180180
}
181181

182182
static void noc_routers_anneal(const t_noc_opts& noc_opts,
183-
BlkLocRegistry& place_loc_vars) {
183+
BlkLocRegistry& blk_loc_registry) {
184184
auto& noc_ctx = g_vpr_ctx.noc();
185-
const auto& block_locs = place_loc_vars.block_locs();
185+
const auto& block_locs = blk_loc_registry.block_locs();
186186

187187
// Only NoC related costs are considered
188188
t_placer_costs costs;
@@ -237,10 +237,10 @@ static void noc_routers_anneal(const t_noc_opts& noc_opts,
237237
blocks_affected.clear_move_blocks();
238238
// Shrink the range limit over time
239239
float r_lim_decayed = 1.0f + (N_MOVES - i_move) * (max_r_lim / N_MOVES);
240-
e_create_move create_move_outcome = propose_router_swap(blocks_affected, r_lim_decayed, place_loc_vars);
240+
e_create_move create_move_outcome = propose_router_swap(blocks_affected, r_lim_decayed, blk_loc_registry);
241241

242242
if (create_move_outcome != e_create_move::ABORT) {
243-
apply_move_blocks(blocks_affected, place_loc_vars);
243+
apply_move_blocks(blocks_affected, blk_loc_registry);
244244

245245
NocCostTerms noc_delta_c;
246246
find_affected_noc_routers_and_update_noc_costs(blocks_affected, noc_delta_c, block_locs);
@@ -251,31 +251,31 @@ static void noc_routers_anneal(const t_noc_opts& noc_opts,
251251

252252
if (move_accepted) {
253253
costs.cost += delta_cost;
254-
commit_move_blocks(blocks_affected, place_loc_vars.mutable_grid_blocks());
254+
commit_move_blocks(blocks_affected, blk_loc_registry.mutable_grid_blocks());
255255
commit_noc_costs();
256256
costs += noc_delta_c;
257257
// check if the current placement is better than the stored checkpoint
258258
if (costs.cost < checkpoint.get_cost() || !checkpoint.is_valid()) {
259259
checkpoint.save_checkpoint(costs.cost, block_locs);
260260
}
261261
} else { // The proposed move is rejected
262-
revert_move_blocks(blocks_affected, place_loc_vars);
262+
revert_move_blocks(blocks_affected, blk_loc_registry);
263263
revert_noc_traffic_flow_routes(blocks_affected, block_locs);
264264
}
265265
}
266266
}
267267

268268
if (checkpoint.get_cost() < costs.cost) {
269-
checkpoint.restore_checkpoint(costs, place_loc_vars);
269+
checkpoint.restore_checkpoint(costs, blk_loc_registry);
270270
}
271271
}
272272

273273
void initial_noc_placement(const t_noc_opts& noc_opts,
274274
const t_placer_opts& placer_opts,
275-
BlkLocRegistry& place_loc_vars) {
275+
BlkLocRegistry& blk_loc_registry) {
276276
vtr::ScopedStartFinishTimer timer("Initial NoC Placement");
277277
auto& noc_ctx = g_vpr_ctx.noc();
278-
const auto& block_locs = place_loc_vars.block_locs();
278+
const auto& block_locs = blk_loc_registry.block_locs();
279279

280280
// Get all the router clusters
281281
const std::vector<ClusterBlockId>& router_blk_ids = noc_ctx.noc_traffic_flows_storage.get_router_clusters_in_netlist();
@@ -290,20 +290,20 @@ void initial_noc_placement(const t_noc_opts& noc_opts,
290290
}
291291

292292
if (is_cluster_constrained(router_blk_id)) {
293-
place_constrained_noc_router(router_blk_id, place_loc_vars);
293+
place_constrained_noc_router(router_blk_id, blk_loc_registry);
294294
} else {
295295
unfixed_routers.push_back(router_blk_id);
296296
}
297297
}
298298

299299
// Place unconstrained NoC routers randomly
300-
place_noc_routers_randomly(unfixed_routers, placer_opts.seed, place_loc_vars);
300+
place_noc_routers_randomly(unfixed_routers, placer_opts.seed, blk_loc_registry);
301301

302302
// populate internal data structures to maintain route, bandwidth usage, and latencies
303303
initial_noc_routing({}, block_locs);
304304

305305
// Run the simulated annealing optimizer for NoC routers
306-
noc_routers_anneal(noc_opts, place_loc_vars);
306+
noc_routers_anneal(noc_opts, blk_loc_registry);
307307

308308
// check if there is any cycles
309309
bool has_cycle = noc_routing_has_cycle(block_locs);

vpr/src/place/initial_noc_placment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
*
1212
* @param noc_opts NoC-related options. Used to calculate NoC-related costs.
1313
* @param placer_opts Contain the placement algorithm options including the seed.
14-
* @param place_loc_vars Placement block location information. To be filled
14+
* @param blk_loc_registry Placement block location information. To be filled
1515
* with the location where pl_macro is placed.
1616
*/
1717
void initial_noc_placement(const t_noc_opts& noc_opts,
1818
const t_placer_opts& placer_opts,
19-
BlkLocRegistry& place_loc_vars);
19+
BlkLocRegistry& blk_loc_registry);
2020

2121
#endif //VTR_INITIAL_NOC_PLACMENT_H

0 commit comments

Comments
 (0)