@@ -31,34 +31,34 @@ static bool accept_noc_swap(double delta_cost, double prob);
31
31
* @brief Places a constrained NoC router within its partition region.
32
32
*
33
33
* @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
35
35
* filled with the location where pl_macro is placed.
36
36
*/
37
37
static void place_constrained_noc_router (ClusterBlockId router_blk_id,
38
- BlkLocRegistry& place_loc_vars );
38
+ BlkLocRegistry& blk_loc_registry );
39
39
40
40
/* *
41
41
* @brief Randomly places unconstrained NoC routers.
42
42
*
43
43
* @param unfixed_routers Contains the cluster block ID for all unconstrained
44
44
* NoC routers.
45
45
* @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
47
47
* with the location where pl_macro is placed.
48
48
*/
49
49
static void place_noc_routers_randomly (std::vector<ClusterBlockId>& unfixed_routers,
50
50
int seed,
51
- BlkLocRegistry& place_loc_vars );
51
+ BlkLocRegistry& blk_loc_registry );
52
52
53
53
/* *
54
54
* @brief Runs a simulated annealing optimizer for NoC routers.
55
55
*
56
56
* @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.
58
58
* To be filled with the location where pl_macro is placed.
59
59
*/
60
60
static void noc_routers_anneal (const t_noc_opts& noc_opts,
61
- BlkLocRegistry& place_loc_vars );
61
+ BlkLocRegistry& blk_loc_registry );
62
62
63
63
static bool accept_noc_swap (double delta_cost, double prob) {
64
64
if (delta_cost <= 0.0 ) {
@@ -78,7 +78,7 @@ static bool accept_noc_swap(double delta_cost, double prob) {
78
78
}
79
79
80
80
static void place_constrained_noc_router (ClusterBlockId router_blk_id,
81
- BlkLocRegistry& place_loc_vars ) {
81
+ BlkLocRegistry& blk_loc_registry ) {
82
82
auto & cluster_ctx = g_vpr_ctx.clustering ();
83
83
const auto & floorplanning_ctx = g_vpr_ctx.floorplanning ();
84
84
@@ -94,11 +94,11 @@ static void place_constrained_noc_router(ClusterBlockId router_blk_id,
94
94
95
95
bool macro_placed = false ;
96
96
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 );
98
98
}
99
99
100
100
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 );
102
102
}
103
103
104
104
if (!macro_placed) {
@@ -108,12 +108,12 @@ static void place_constrained_noc_router(ClusterBlockId router_blk_id,
108
108
109
109
static void place_noc_routers_randomly (std::vector<ClusterBlockId>& unfixed_routers,
110
110
int seed,
111
- BlkLocRegistry& place_loc_vars ) {
111
+ BlkLocRegistry& blk_loc_registry ) {
112
112
const auto & compressed_grids = g_vpr_ctx.placement ().compressed_block_grids ;
113
113
const auto & noc_ctx = g_vpr_ctx.noc ();
114
114
const auto & cluster_ctx = g_vpr_ctx.clustering ();
115
115
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 ();
117
117
118
118
/*
119
119
* 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
166
166
t_pl_macro pl_macro;
167
167
pl_macro.members .push_back (macro_member);
168
168
169
- bool legal = try_place_macro (pl_macro, loc, place_loc_vars );
169
+ bool legal = try_place_macro (pl_macro, loc, blk_loc_registry );
170
170
if (!legal) {
171
171
VPR_FATAL_ERROR (VPR_ERROR_PLACE, " Could not place a router cluster into an empty physical router." );
172
172
}
@@ -180,9 +180,9 @@ static void place_noc_routers_randomly(std::vector<ClusterBlockId>& unfixed_rout
180
180
}
181
181
182
182
static void noc_routers_anneal (const t_noc_opts& noc_opts,
183
- BlkLocRegistry& place_loc_vars ) {
183
+ BlkLocRegistry& blk_loc_registry ) {
184
184
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 ();
186
186
187
187
// Only NoC related costs are considered
188
188
t_placer_costs costs;
@@ -237,10 +237,10 @@ static void noc_routers_anneal(const t_noc_opts& noc_opts,
237
237
blocks_affected.clear_move_blocks ();
238
238
// Shrink the range limit over time
239
239
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 );
241
241
242
242
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 );
244
244
245
245
NocCostTerms noc_delta_c;
246
246
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,
251
251
252
252
if (move_accepted) {
253
253
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 ());
255
255
commit_noc_costs ();
256
256
costs += noc_delta_c;
257
257
// check if the current placement is better than the stored checkpoint
258
258
if (costs.cost < checkpoint.get_cost () || !checkpoint.is_valid ()) {
259
259
checkpoint.save_checkpoint (costs.cost , block_locs);
260
260
}
261
261
} else { // The proposed move is rejected
262
- revert_move_blocks (blocks_affected, place_loc_vars );
262
+ revert_move_blocks (blocks_affected, blk_loc_registry );
263
263
revert_noc_traffic_flow_routes (blocks_affected, block_locs);
264
264
}
265
265
}
266
266
}
267
267
268
268
if (checkpoint.get_cost () < costs.cost ) {
269
- checkpoint.restore_checkpoint (costs, place_loc_vars );
269
+ checkpoint.restore_checkpoint (costs, blk_loc_registry );
270
270
}
271
271
}
272
272
273
273
void initial_noc_placement (const t_noc_opts& noc_opts,
274
274
const t_placer_opts& placer_opts,
275
- BlkLocRegistry& place_loc_vars ) {
275
+ BlkLocRegistry& blk_loc_registry ) {
276
276
vtr::ScopedStartFinishTimer timer (" Initial NoC Placement" );
277
277
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 ();
279
279
280
280
// Get all the router clusters
281
281
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,
290
290
}
291
291
292
292
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 );
294
294
} else {
295
295
unfixed_routers.push_back (router_blk_id);
296
296
}
297
297
}
298
298
299
299
// 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 );
301
301
302
302
// populate internal data structures to maintain route, bandwidth usage, and latencies
303
303
initial_noc_routing ({}, block_locs);
304
304
305
305
// 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 );
307
307
308
308
// check if there is any cycles
309
309
bool has_cycle = noc_routing_has_cycle (block_locs);
0 commit comments