Skip to content

Commit 1dbc124

Browse files
Update stale doc comments to describe the slot-based move state
1 parent 10587ac commit 1dbc124

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

vpr/src/place/net_cost_handler.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ class NetCostHandler {
105105
*
106106
* The change in the bounding box cost is stored in `bb_delta_c`.
107107
* The change in the timing cost is stored in `timing_delta_c`.
108-
* ts_nets_to_update is also extended with the latest net.
109108
*
110-
* @return The number of affected nets.
109+
* Every affected net is recorded in ts_nets_to_update_ and given a slot in
110+
* ts_net_info_. The slots must be released by update_move_nets() or
111+
* reset_move_nets() before this method is called again.
111112
*/
112113
void find_affected_nets_and_update_costs(const PlaceDelayModel* delay_model,
113114
const PlacerCriticalities* criticalities,
@@ -116,14 +117,14 @@ class NetCostHandler {
116117
double& timing_delta_c);
117118

118119
/**
119-
* @brief Reset the net cost function flags (proposed_net_cost and bb_updated_before)
120+
* @brief Discards the proposed state of the affected nets and releases their slots.
121+
* Called when the move under evaluation is rejected.
120122
*/
121123
void reset_move_nets();
122124

123125
/**
124-
* @brief Update net cost data structures (in placer context and net_cost in .cpp file)
125-
* and reset flags (proposed_net_cost and bb_updated_before).
126-
* It is used to determine the index up to which elements in ts_nets_to_update are valid.
126+
* @brief Copies the proposed state of the affected nets into the committed state
127+
* and releases their slots. Called when the move under evaluation is accepted.
127128
*/
128129
void update_move_nets();
129130

vpr/src/place/swap_evaluator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void SwapEvaluator::commit(t_pl_blocks_to_be_moved& blocks_affected,
100100
placer_state_.mutable_timing().commit_td_cost(blocks_affected);
101101
}
102102

103-
// Update net cost functions and reset flags.
103+
// Commit the proposed net costs and release the scratch state of the move.
104104
net_cost_handler_.update_move_nets();
105105
if (update_interposer_costs) {
106106
interposer_cost_handler_->commit_costs(net_cost_handler_.affected_nets());
@@ -111,7 +111,7 @@ void SwapEvaluator::commit(t_pl_blocks_to_be_moved& blocks_affected,
111111
}
112112

113113
void SwapEvaluator::revert(t_pl_blocks_to_be_moved& blocks_affected, bool revert_td) {
114-
// Reset the net cost function flags first.
114+
// Discard the proposed net state first.
115115
net_cost_handler_.reset_move_nets();
116116

117117
// Restore the blk_loc_registry.block_locs data structures to their state before the move.

0 commit comments

Comments
 (0)