Skip to content

Commit 9e03a13

Browse files
committed
Added in-class initializers for t_placer_costs.
1 parent 51c358a commit 9e03a13

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

vpr/src/place/place_util.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ void t_annealing_state::update_move_lim(float success_target, float success_rate
278278
move_lim = std::max(move_lim, 1);
279279
}
280280

281+
///@brief Clear all data fields.
281282
void t_placer_statistics::reset() {
282283
av_cost = 0.;
283284
av_bb_cost = 0.;
@@ -288,6 +289,7 @@ void t_placer_statistics::reset() {
288289
std_dev = 0.;
289290
}
290291

292+
///@brief Calculate placer success rate and cost std_dev for this iteration.
291293
void t_placer_statistics::single_swap_update(const t_placer_costs& costs) {
292294
success_sum++;
293295
av_cost += costs.cost;
@@ -296,6 +298,7 @@ void t_placer_statistics::single_swap_update(const t_placer_costs& costs) {
296298
sum_of_squares += (costs.cost) * (costs.cost);
297299
}
298300

301+
///@brief Update stats when a single swap move has been accepted.
299302
void t_placer_statistics::calc_iteration_stats(const t_placer_costs& costs, int move_lim) {
300303
if (success_sum == 0) {
301304
av_cost = costs.cost;

vpr/src/place/place_util.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
*/
4141
class t_placer_costs {
4242
public: //members
43-
double cost;
44-
double bb_cost;
45-
double timing_cost;
46-
double bb_cost_norm;
47-
double timing_cost_norm;
43+
double cost = 0.;
44+
double bb_cost = 0.;
45+
double timing_cost = 0.;
46+
double bb_cost_norm = 0.;
47+
double timing_cost_norm = 0.;
4848

4949
public: //Constructor
5050
t_placer_costs(t_place_algorithm algo)

0 commit comments

Comments
 (0)