Skip to content

Commit 91d70d5

Browse files
author
MohamedElgammal
committed
change some function name to be more meaningful
1 parent 138393e commit 91d70d5

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

vpr/src/place/median_move_generator.cpp

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
#include "placer_globals.h"
66

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);
88

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);
1010

1111
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*/) {
1212
auto& place_ctx = g_vpr_ctx.placement();
@@ -56,7 +56,7 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
5656
continue;
5757
if (cluster_ctx.clb_nlist.net_sinks(net_id).size() < SMALL_NET) {
5858
//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);
6060
if (skip_net)
6161
continue;
6262
} else {
@@ -83,8 +83,8 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
8383
ynew = place_move_ctx.bb_coords[net_id].ymin;
8484
}
8585

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);
8888
if (skip_net)
8989
continue;
9090
}
@@ -126,13 +126,16 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
126126
}
127127

128128
/* 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. *
132135
* Currently assumes channels on both sides of the CLBs forming the *
133136
* edges of the bounding box can be used. Essentially, I am assuming *
134137
* 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) {
136139
//TODO: account for multiple physical pin instances per logical pin
137140

138141
skip_net = true;
@@ -210,19 +213,19 @@ static void get_bb_from_scratch(ClusterNetId net_id, t_bb* bb_coord_new, Cluster
210213
}
211214

212215
/*
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. *
220223
* 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 *
222225
* the pins always lie on the outside of the bounding box. *
223226
* The x and y coordinates are the pin's x and y coordinates. */
224227
/* 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) {
226229
//TODO: account for multiple physical pin instances per logical pin
227230

228231
const t_bb *curr_bb_edge, *curr_bb_coord;

0 commit comments

Comments
 (0)