4
4
5
5
#include " placer_globals.h"
6
6
7
- static bool update_bb (ClusterNetId net_id, t_bb* bb_coord_new, int xold, int yold, int xnew, int ynew);
7
+ static bool get_bb_incrementally (ClusterNetId net_id, t_bb* bb_coord_new, int xold, int yold, int xnew, int ynew);
8
8
9
- static void get_bb_from_scratch (ClusterNetId net_id, t_bb* bb_coord_new, ClusterBlockId block_id, bool & skip_net);
9
+ static void get_bb_from_scratch_excluding_block (ClusterNetId net_id, t_bb* bb_coord_new, ClusterBlockId block_id, bool & skip_net);
10
10
11
11
e_create_move MedianMoveGenerator::propose_move (t_pl_blocks_to_be_moved& blocks_affected, e_move_type& /* move_type*/ , float rlim, const t_placer_opts& placer_opts, const PlacerCriticalities* /* criticalities*/ ) {
12
12
auto & place_ctx = g_vpr_ctx.placement ();
@@ -56,7 +56,7 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
56
56
continue ;
57
57
if (cluster_ctx.clb_nlist .net_sinks (net_id).size () < SMALL_NET) {
58
58
// calculate the bb from scratch
59
- get_bb_from_scratch (net_id, &coords, b_from, skip_net);
59
+ get_bb_from_scratch_excluding_block (net_id, &coords, b_from, skip_net);
60
60
if (skip_net)
61
61
continue ;
62
62
} else {
@@ -83,8 +83,8 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
83
83
ynew = place_move_ctx.bb_coords [net_id].ymin ;
84
84
}
85
85
86
- if (!update_bb (net_id, &coords, xold, yold, xnew, ynew)) {
87
- get_bb_from_scratch (net_id, &coords, b_from, skip_net);
86
+ if (!get_bb_incrementally (net_id, &coords, xold, yold, xnew, ynew)) {
87
+ get_bb_from_scratch_excluding_block (net_id, &coords, b_from, skip_net);
88
88
if (skip_net)
89
89
continue ;
90
90
}
@@ -126,13 +126,16 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
126
126
}
127
127
128
128
/* Finds the bounding box of a net and stores its coordinates in the *
129
- * bb_coord_new data structure. This routine should only be called *
130
- * for small nets, since it does not determine enough information for *
131
- * the bounding box to be updated incrementally later. *
129
+ * bb_coord_new data structure. It excludes the moving block sent in *
130
+ * function arguments in block_id. It also returns whether this net *
131
+ * should be excluded from median calculation or not. *
132
+ * This routine should only be called for small nets, since it does *
133
+ * not determine enough information for the bounding box to be *
134
+ * updated incrementally later. *
132
135
* Currently assumes channels on both sides of the CLBs forming the *
133
136
* edges of the bounding box can be used. Essentially, I am assuming *
134
137
* the pins always lie on the outside of the bounding box. */
135
- static void get_bb_from_scratch (ClusterNetId net_id, t_bb* bb_coord_new, ClusterBlockId block_id, bool & skip_net) {
138
+ static void get_bb_from_scratch_excluding_block (ClusterNetId net_id, t_bb* bb_coord_new, ClusterBlockId block_id, bool & skip_net) {
136
139
// TODO: account for multiple physical pin instances per logical pin
137
140
138
141
skip_net = true ;
@@ -210,19 +213,19 @@ static void get_bb_from_scratch(ClusterNetId net_id, t_bb* bb_coord_new, Cluster
210
213
}
211
214
212
215
/*
213
- * Updates the bounding box of a net by storing its coordinates in *
214
- * the bb_coord_new data structure and the number of blocks on each *
215
- * edge in the bb_edge_new data structure. This routine should only *
216
- * be called for large nets, since it has some overhead relative to *
217
- * just doing a brute force bounding box calculation. The bounding *
218
- * box coordinate and edge information for inet must be valid before *
219
- * this routine is called. *
216
+ * Calculates the bounding box of a net by storing its coordinates *
217
+ * in the bb_coord_new data structure. It uses information from *
218
+ * PlaceMoveContext to calculate the bb incrementally. This routine *
219
+ * should only be called for large nets, since it has some overhead *
220
+ * relative to just doing a brute force bounding box calculation. *
221
+ * The bounding box coordinate and edge information for inet must be *
222
+ * valid before this routine is called. *
220
223
* Currently assumes channels on both sides of the CLBs forming the *
221
- * edges of the bounding box can be used. Essentially, I am assuming *
224
+ * edges of the bounding box can be used. Essentially, I am assuming *
222
225
* the pins always lie on the outside of the bounding box. *
223
226
* The x and y coordinates are the pin's x and y coordinates. */
224
227
/* IO blocks are considered to be one cell in for simplicity. */
225
- static bool update_bb (ClusterNetId net_id, t_bb* bb_coord_new, int xold, int yold, int xnew, int ynew) {
228
+ static bool get_bb_incrementally (ClusterNetId net_id, t_bb* bb_coord_new, int xold, int yold, int xnew, int ynew) {
226
229
// TODO: account for multiple physical pin instances per logical pin
227
230
228
231
const t_bb *curr_bb_edge, *curr_bb_coord;
0 commit comments