@@ -40,43 +40,23 @@ void set_placer_breakpoint_reached(bool flag) {
40
40
* @brief Expand the y-axis search range based on the number of blocks in the column
41
41
*
42
42
* @param search_range The search range to adjust
43
- * @param y_lower_iter The lower bound of the search range in the compressed grid
44
- * @param y_range The search range across the y-axis
45
- * @param type The type of the block to move
46
43
* @param block_rows Compatible blocks in the column
47
44
*/
48
45
static void adjust_y_axis_search_range (t_bb& search_range,
49
- vtr::flat_map2<int , t_physical_tile_loc>::const_iterator& y_lower_iter,
50
- int & y_range,
51
- t_logical_block_type_ptr type,
52
46
const vtr::flat_map2<int , t_physical_tile_loc>& block_rows) {
53
47
54
- auto y_upper_iter = block_rows.upper_bound (search_range.ymax );
48
+ if (block_rows.size () <= G_MIN_NUM_BLOCKS_IN_COLUMN) {
49
+ /* The number of compatible blocks is less than
50
+ * the minimum number of blocks in a column
51
+ * Expand the search range to include all blocks in the column
52
+ */
55
53
56
- if (block_rows.size () > G_MIN_NUM_BLOCKS_IN_COLUMN) {
57
- if (y_lower_iter->first > search_range.ymin ) {
58
- // No valid blocks at this x location which are within rlim_y
59
- //
60
- if (type->index != 1 ) {
61
- continue ;
62
- } else {
63
- // Fall back to allow the whole y range
64
- y_lower_iter = block_rows.begin ();
65
- y_upper_iter = block_rows.end ();
66
-
67
- search_range.ymin = y_lower_iter->first ;
68
- search_range.ymax = (y_upper_iter - 1 )->first ;
69
- }
70
- }
71
- } else { // search_range is not fixed and there are less than G_MIN_NUM_BLOCKS_IN_COLUMN blocks at this x location
72
- y_lower_iter = block_rows.begin ();
73
- y_upper_iter = block_rows.end ();
54
+ auto y_lower_iter = block_rows.begin ();
55
+ auto y_upper_iter = block_rows.end ();
74
56
75
57
search_range.ymin = y_lower_iter->first ;
76
58
search_range.ymax = (y_upper_iter - 1 )->first ;
77
59
}
78
-
79
- y_range = std::distance (y_lower_iter, y_upper_iter);
80
60
}
81
61
82
62
e_create_move create_move (t_pl_blocks_to_be_moved& blocks_affected,
@@ -1060,16 +1040,16 @@ bool find_compatible_compressed_loc_in_range(t_logical_block_type_ptr type,
1060
1040
// The candidates are stored in a flat_map so we can efficiently find the set of valid
1061
1041
// candidates with upper/lower bound.
1062
1042
const auto & block_rows = compressed_block_grid.get_column_block_map (to_loc.x , to_layer_num);
1043
+ if (!fixed_search_range) {
1044
+ adjust_y_axis_search_range (search_range, block_rows);
1045
+ }
1046
+
1063
1047
auto y_lower_iter = block_rows.lower_bound (search_range.ymin );
1064
1048
auto y_upper_iter = block_rows.upper_bound (search_range.ymax );
1065
1049
if (y_lower_iter == block_rows.end ()) {
1066
1050
continue ;
1067
1051
}
1068
1052
int y_range = std::distance (y_lower_iter, y_upper_iter);
1069
- if (!fixed_search_range) {
1070
- y_lower_iter = adjust_y_axis_search_range (search_range, y_range, type, block_rows);
1071
- }
1072
-
1073
1053
VTR_ASSERT (y_range >= 0 );
1074
1054
1075
1055
// At this point we know y_lower_iter and y_upper_iter
0 commit comments