Skip to content

Commit ac30b4b

Browse files
added some comments
1 parent f7b183a commit ac30b4b

5 files changed

+32
-28
lines changed

vpr/src/place/RL_agent_util.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ enum class e_agent_state {
1414
*
1515
* This function creates 2 move generators to be used by the annealer. The type of the move generators created here depends on the
1616
* type selected in placer_opts.
17-
* It returns a unique pointer for each move generator in move_generator and move_generator2
1817
*
1918
* @param placer_state Move generators store a reference to the placer context to avoid global state access.
2019
* @param placer_opts Contains information about the placement algorithm and its parameters.

vpr/src/place/analytic_placer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ void AnalyticPlacer::build_legal_locations() {
303303
// initialize other data members
304304
void AnalyticPlacer::init() {
305305
const ClusteredNetlist& clb_nlist = g_vpr_ctx.clustering().clb_nlist;
306-
auto& block_locs = blk_loc_registry_ref_.block_locs();
306+
auto& init_block_locs = blk_loc_registry_ref_.block_locs();
307307

308308
for (auto blk_id : clb_nlist.blocks()) {
309309
blk_locs.insert(blk_id, BlockLocation{});
310-
blk_locs[blk_id].loc = block_locs[blk_id].loc; // transfer of initial placement
310+
blk_locs[blk_id].loc = init_block_locs[blk_id].loc; // transfer of initial placement
311311
row_num.insert(blk_id, DONT_SOLVE); // no blocks are moved by default, until they are setup in setup_solve_blks()
312312
}
313313

@@ -322,7 +322,7 @@ void AnalyticPlacer::init() {
322322
};
323323

324324
for (auto blk_id : clb_nlist.blocks()) {
325-
if (!block_locs[blk_id].is_fixed && has_connections(blk_id))
325+
if (!init_block_locs[blk_id].is_fixed && has_connections(blk_id))
326326
// not fixed and has connections
327327
// matrix equation is formulated based on connections, so requires at least one connection
328328
if (imacro(blk_id) == NO_MACRO || macro_head(blk_id) == blk_id) {

vpr/src/place/centroid_move_generator.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121
class CentroidMoveGenerator : public MoveGenerator {
2222
public:
2323
/**
24-
* The move generator created by calling this constructor only consider
24+
* The move generator created by calling this constructor only considers
2525
* netlist connectivity for computing the centroid location.
26+
*
27+
* @param placer_state A mutable reference to the placement state which will
28+
* be stored in this object.
2629
*/
2730
explicit CentroidMoveGenerator(PlacerState& placer_state);
2831

@@ -33,6 +36,8 @@ class CentroidMoveGenerator : public MoveGenerator {
3336
* in the graph representing the clustered netlist. When finding connected
3437
* components, none of the nets whose fanout is larger than high_fanout_net
3538
* are traversed.
39+
* @param placer_state A mutable reference to the placement state which will
40+
* be stored in this object.
3641
* @param noc_attraction_weight Specifies how much the computed centroid
3742
* is adjusted towards the location of NoC routers in the same NoC group as
3843
* the clustered block to be moved.

vpr/src/place/median_move_generator.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,6 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
186186
return create_move;
187187
}
188188

189-
/* Finds the bounding box of a net and stores its coordinates in the *
190-
* bb_coord_new data structure. It excludes the moving block sent in *
191-
* function arguments in block_id. It also returns whether this net *
192-
* should be excluded from median calculation or not. *
193-
* This routine should only be called for small nets, since it does *
194-
* not determine enough information for the bounding box to be *
195-
* updated incrementally later. *
196-
* Currently assumes channels on both sides of the CLBs forming the *
197-
* edges of the bounding box can be used. Essentially, I am assuming *
198-
* the pins always lie on the outside of the bounding box. */
199189
void MedianMoveGenerator::get_bb_from_scratch_excluding_block(ClusterNetId net_id,
200190
t_bb& bb_coord_new,
201191
ClusterBlockId block_id,
@@ -294,19 +284,6 @@ void MedianMoveGenerator::get_bb_from_scratch_excluding_block(ClusterNetId net_i
294284
bb_coord_new.layer_max = std::max(std::min<int>(layer_max, device_ctx.grid.get_num_layers() - 1), 0);
295285
}
296286

297-
/*
298-
* Calculates the bounding box of a net by storing its coordinates *
299-
* in the bb_coord_new data structure. It uses information from *
300-
* PlaceMoveContext to calculate the bb incrementally. This routine *
301-
* should only be called for large nets, since it has some overhead *
302-
* relative to just doing a brute force bounding box calculation. *
303-
* The bounding box coordinate and edge information for inet must be *
304-
* valid before this routine is called. *
305-
* Currently assumes channels on both sides of the CLBs forming the *
306-
* edges of the bounding box can be used. Essentially, I am assuming *
307-
* the pins always lie on the outside of the bounding box. *
308-
* The x and y coordinates are the pin's x and y coordinates. */
309-
/* IO blocks are considered to be one cell in for simplicity. */
310287
bool MedianMoveGenerator::get_bb_incrementally(ClusterNetId net_id,
311288
t_bb& bb_coord_new,
312289
int xold,

vpr/src/place/median_move_generator.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,33 @@ class MedianMoveGenerator : public MoveGenerator {
2727
const t_placer_opts& placer_opts,
2828
const PlacerCriticalities* /*criticalities*/) override;
2929

30+
/**
31+
* @brief Calculates the bounding box of a net by storing its coordinates
32+
* in the bb_coord_new data structure.
33+
*
34+
* @details It uses information from PlaceMoveContext to calculate the bb incrementally.
35+
* This routine should only be called for large nets, since it has some overhead
36+
* relative to just doing a brute force bounding box calculation. The bounding box coordinate
37+
* and edge information for inet must be valid before this routine is called.
38+
* Currently assumes channels on both sides of the CLBs forming the edges of the bounding box
39+
* can be used. Essentially, I am assuming the pins always lie on the outside of the bounding box.
40+
* The x and y coordinates are the pin's x and y coordinates. IO blocks are considered to be
41+
* one cell in for simplicity. */
3042
bool get_bb_incrementally(ClusterNetId net_id, t_bb& bb_coord_new,
3143
int xold, int yold, int layer_old,
3244
int xnew, int ynew, int layer_new);
3345

46+
47+
/**
48+
* @brief Finds the bounding box of a net and stores its coordinates in the bb_coord_new data structure.
49+
*
50+
* @details It excludes the moving block sent in function arguments in block_id.
51+
* It also returns whether this net should be excluded from median calculation or not.
52+
* This routine should only be called for small nets, since it does not determine
53+
* enough information for the bounding box to be updated incrementally later.
54+
* Currently assumes channels on both sides of the CLBs forming the edges of the bounding box can be used.
55+
* Essentially, I am assuming the pins always lie on the outside of the bounding box.
56+
*/
3457
void get_bb_from_scratch_excluding_block(ClusterNetId net_id,
3558
t_bb& bb_coord_new,
3659
ClusterBlockId block_id,

0 commit comments

Comments
 (0)