@@ -37,16 +37,20 @@ static constexpr int SORT_WEIGHT_PER_TILES_OUTSIDE_OF_PR = 100;
37
37
* @brief Set chosen grid locations to EMPTY block id before each placement iteration
38
38
*
39
39
* @param unplaced_blk_types_index Block types that their grid locations must be cleared.
40
- *
40
+ * @param place_loc_vars Placement block location information. To be filled with the location
41
+ * where pl_macro is placed.
41
42
*/
42
43
static void clear_block_type_grid_locs (const std::unordered_set<int >& unplaced_blk_types_index,
43
44
PlaceLocVars& place_loc_vars);
44
45
45
46
/* *
46
47
* @brief Initializes the grid to empty. It also initialized the location for
47
48
* all blocks to unplaced.
49
+ *
50
+ * @param place_loc_vars Placement block location information. To be filled with the location
51
+ * where pl_macro is placed.
48
52
*/
49
- static void clear_all_grid_locs (PlaceLocVars& place_loc_avrs );
53
+ static void clear_all_grid_locs (PlaceLocVars& place_loc_vars );
50
54
51
55
/* *
52
56
* @brief Control routine for placing a macro.
@@ -63,6 +67,8 @@ static void clear_all_grid_locs(PlaceLocVars& place_loc_avrs);
63
67
* @param pad_loc_type Used to check whether an io block needs to be marked as fixed.
64
68
* @param blk_types_empty_locs_in_grid First location (lowest y) and number of remaining blocks in each column for the blk_id type.
65
69
* @param block_scores The block_scores (ranking of what to place next) for unplaced blocks connected to this macro should be updated.
70
+ * @param place_loc_vars Placement block location information. To be filled with the location
71
+ * where pl_macro is placed.
66
72
*
67
73
* @return true if macro was placed, false if not.
68
74
*/
@@ -71,7 +77,7 @@ static bool place_macro(int macros_max_num_tries,
71
77
e_pad_loc_type pad_loc_type,
72
78
std::vector<t_grid_empty_locs_block_type>* blk_types_empty_locs_in_grid,
73
79
vtr::vector<ClusterBlockId, t_block_score>& block_scores,
74
- PlaceLocVars& place_loc_avrs );
80
+ PlaceLocVars& place_loc_vars );
75
81
76
82
/*
77
83
* Assign scores to each block based on macro size and floorplanning constraints.
@@ -82,10 +88,11 @@ static vtr::vector<ClusterBlockId, t_block_score> assign_block_scores();
82
88
83
89
/* *
84
90
* @brief Tries to find y coordinate for macro head location based on macro direction
85
- *
86
91
*
87
92
* @param first_macro_loc The first available location that can place the macro blocks.
88
93
* @param pl_macro The macro to be placed.
94
+ * @param place_loc_vars Placement block location information. To be filled with the location
95
+ * where pl_macro is placed.
89
96
*
90
97
* @return y coordinate of the location that macro head should be placed
91
98
*/
@@ -132,6 +139,8 @@ static std::vector<t_grid_empty_locs_block_type> init_blk_types_empty_locations(
132
139
* @param pl_macro The macro to be fixed.
133
140
* @param loc The location at which the head of the macro is placed.
134
141
* @param pad_loc_type Used to check whether an io block needs to be marked as fixed.
142
+ * @param block_locs Clustered block locations used to mark the IO blocks that are to be placed
143
+ * randomly as fixed.
135
144
*/
136
145
static inline void fix_IO_block_types (const t_pl_macro& pl_macro,
137
146
t_pl_loc loc,
@@ -157,6 +166,8 @@ static bool is_loc_legal(const t_pl_loc& loc,
157
166
*
158
167
* @param pl_macro The macro to be placed.
159
168
* @param centroid specified location (x,y,subtile) for the pl_macro head member.
169
+ * @param place_loc_vars Placement block location information. To be filled with the location
170
+ * where pl_macro is placed.
160
171
*
161
172
* @return a vector of blocks that are connected to this block but not yet placed so their scores can later be updated.
162
173
*/
@@ -170,6 +181,8 @@ static std::vector<ClusterBlockId> find_centroid_loc(const t_pl_macro& pl_macro,
170
181
* @param centroid_loc Calculated location in try_centroid_placement function for the block.
171
182
* @param block_type Logical block type of the macro blocks.
172
183
* @param search_for_empty If set, the function tries to find an empty location.
184
+ * @param place_loc_vars Placement block location information. To be filled with the location
185
+ * where pl_macro is placed.
173
186
*
174
187
* @return true if the function can find any location near the centroid one, false otherwise.
175
188
*/
@@ -186,7 +199,9 @@ static bool find_centroid_neighbor(t_pl_loc& centroid_loc,
186
199
* constrained.
187
200
* @param block_type Logical block type of the macro blocks.
188
201
* @param pad_loc_type Used to check whether an io block needs to be marked as fixed.
189
- * @param block_scores The block_scores (ranking of what to place next) for unplaced blocks connected to this macro are updated in this routine.
202
+ * @param block_scores The block_scores (ranking of what to place next) for unplaced blocks connected to this macro are updated in this routine.
203
+ * @param place_loc_vars Placement block location information. To be filled with the location
204
+ * where pl_macro is placed.
190
205
*
191
206
* @return true if the macro gets placed, false if not.
192
207
*/
@@ -195,7 +210,7 @@ static bool try_centroid_placement(const t_pl_macro& pl_macro,
195
210
t_logical_block_type_ptr block_type,
196
211
e_pad_loc_type pad_loc_type,
197
212
vtr::vector<ClusterBlockId, t_block_score>& block_scores,
198
- PlaceLocVars& place_loc_avrs );
213
+ PlaceLocVars& place_loc_vars );
199
214
200
215
/* *
201
216
* @brief Looks for a valid placement location for macro in second iteration, tries to place as many macros as possible in one column
@@ -207,6 +222,8 @@ static bool try_centroid_placement(const t_pl_macro& pl_macro,
207
222
* @param block_type Logical block type of the macro blocks.
208
223
* @param pad_loc_type Used to check whether an io block needs to be marked as fixed.
209
224
* @param blk_types_empty_locs_in_grid first location (lowest y) and number of remaining blocks in each column for the blk_id type
225
+ * @param place_loc_vars Placement block location information. To be filled with the location
226
+ * where pl_macro is placed.
210
227
*
211
228
* @return true if the macro gets placed, false if not.
212
229
*/
@@ -215,19 +232,21 @@ static bool try_dense_placement(const t_pl_macro& pl_macro,
215
232
t_logical_block_type_ptr block_type,
216
233
e_pad_loc_type pad_loc_type,
217
234
std::vector<t_grid_empty_locs_block_type>* blk_types_empty_locs_in_grid,
218
- PlaceLocVars& place_loc_avrs );
235
+ PlaceLocVars& place_loc_vars );
219
236
220
237
/* *
221
238
* @brief Tries for MAX_INIT_PLACE_ATTEMPTS times to place all blocks considering their floorplanning constraints and the device size
222
239
*
223
240
* @param pad_loc_type Used to check whether an io block needs to be marked as fixed.
224
241
* @param constraints_file Used to read block locations if any constraints is available.
242
+ * @param place_loc_vars Placement block location information. To be filled with the location
243
+ * where pl_macro is placed.
225
244
*/
226
245
static void place_all_blocks (const t_placer_opts& placer_opts,
227
246
vtr::vector<ClusterBlockId, t_block_score>& block_scores,
228
247
e_pad_loc_type pad_loc_type,
229
248
const char * constraints_file,
230
- PlaceLocVars& place_loc_avrs );
249
+ PlaceLocVars& place_loc_vars );
231
250
232
251
/* *
233
252
* @brief If any blocks remain unplaced after all initial placement iterations, this routine
@@ -990,7 +1009,7 @@ static void place_all_blocks(const t_placer_opts& placer_opts,
990
1009
vtr::vector<ClusterBlockId, t_block_score>& block_scores,
991
1010
enum e_pad_loc_type pad_loc_type,
992
1011
const char * constraints_file,
993
- PlaceLocVars& place_loc_avrs ) {
1012
+ PlaceLocVars& place_loc_vars ) {
994
1013
auto & cluster_ctx = g_vpr_ctx.clustering ();
995
1014
auto & place_ctx = g_vpr_ctx.placement ();
996
1015
auto & device_ctx = g_vpr_ctx.device ();
@@ -1013,12 +1032,12 @@ static void place_all_blocks(const t_placer_opts& placer_opts,
1013
1032
1014
1033
for (auto iter_no = 0 ; iter_no < MAX_INIT_PLACE_ATTEMPTS; iter_no++) {
1015
1034
// clear grid for a new placement iteration
1016
- clear_block_type_grid_locs (unplaced_blk_type_in_curr_itr, place_loc_avrs );
1035
+ clear_block_type_grid_locs (unplaced_blk_type_in_curr_itr, place_loc_vars );
1017
1036
unplaced_blk_type_in_curr_itr.clear ();
1018
1037
1019
1038
// read the constraint file if the user has provided one and this is not the first attempt
1020
1039
if (strlen (constraints_file) != 0 && iter_no != 0 ) {
1021
- read_constraints (constraints_file, place_loc_avrs );
1040
+ read_constraints (constraints_file, place_loc_vars );
1022
1041
}
1023
1042
1024
1043
// resize the vector to store unplaced block types empty locations
@@ -1050,7 +1069,7 @@ static void place_all_blocks(const t_placer_opts& placer_opts,
1050
1069
1051
1070
blocks_placed_since_heap_update++;
1052
1071
1053
- bool block_placed = place_one_block (blk_id, pad_loc_type, &blk_types_empty_locs_in_grid[blk_id_type->index ], &block_scores, place_loc_avrs );
1072
+ bool block_placed = place_one_block (blk_id, pad_loc_type, &blk_types_empty_locs_in_grid[blk_id_type->index ], &block_scores, place_loc_vars );
1054
1073
1055
1074
// update heap based on update_heap_freq calculated above
1056
1075
if (blocks_placed_since_heap_update % (update_heap_freq) == 0 ) {
@@ -1214,14 +1233,14 @@ static void alloc_and_load_movable_blocks(const vtr::vector_map<ClusterBlockId,
1214
1233
void initial_placement (const t_placer_opts& placer_opts,
1215
1234
const char * constraints_file,
1216
1235
const t_noc_opts& noc_opts,
1217
- PlaceLocVars& place_loc_avrs ) {
1236
+ PlaceLocVars& place_loc_vars ) {
1218
1237
vtr::ScopedStartFinishTimer timer (" Initial Placement" );
1219
- auto & block_locs = place_loc_avrs .mutable_block_locs ();
1238
+ auto & block_locs = place_loc_vars .mutable_block_locs ();
1220
1239
1221
1240
/* Initialize the grid blocks to empty.
1222
1241
* Initialize all the blocks to unplaced.
1223
1242
*/
1224
- clear_all_grid_locs (place_loc_avrs );
1243
+ clear_all_grid_locs (place_loc_vars );
1225
1244
1226
1245
/* Go through cluster blocks to calculate the tightest placement
1227
1246
* floorplan constraint for each constrained block
@@ -1230,28 +1249,28 @@ void initial_placement(const t_placer_opts& placer_opts,
1230
1249
1231
1250
/* Mark the blocks that have already been locked to one spot via floorplan constraints
1232
1251
* as fixed, so they do not get moved during initial placement or later during the simulated annealing stage of placement*/
1233
- mark_fixed_blocks (place_loc_avrs );
1252
+ mark_fixed_blocks (place_loc_vars );
1234
1253
1235
1254
// Compute and store compressed floorplanning constraints
1236
1255
alloc_and_load_compressed_cluster_constraints ();
1237
1256
1238
1257
1239
1258
// read the constraint file and place fixed blocks
1240
1259
if (strlen (constraints_file) != 0 ) {
1241
- read_constraints (constraints_file, place_loc_avrs );
1260
+ read_constraints (constraints_file, place_loc_vars );
1242
1261
}
1243
1262
1244
1263
if (noc_opts.noc ) {
1245
1264
// NoC routers are placed before other blocks
1246
- initial_noc_placement (noc_opts, placer_opts, place_loc_avrs );
1265
+ initial_noc_placement (noc_opts, placer_opts, place_loc_vars );
1247
1266
propagate_place_constraints ();
1248
1267
}
1249
1268
1250
1269
// Assign scores to blocks and placement macros according to how difficult they are to place
1251
1270
vtr::vector<ClusterBlockId, t_block_score> block_scores = assign_block_scores ();
1252
1271
1253
1272
// Place all blocks
1254
- place_all_blocks (placer_opts, block_scores, placer_opts.pad_loc_type , constraints_file, place_loc_avrs );
1273
+ place_all_blocks (placer_opts, block_scores, placer_opts.pad_loc_type , constraints_file, place_loc_vars );
1255
1274
1256
1275
alloc_and_load_movable_blocks (block_locs);
1257
1276
0 commit comments