Skip to content

Commit 4c635b8

Browse files
add doxygen comments for congestion cost terms
1 parent 08d48b0 commit 4c635b8

File tree

2 files changed

+37
-41
lines changed

2 files changed

+37
-41
lines changed

vpr/src/place/place_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void t_placer_costs::update_norm_factors() {
2222
}
2323

2424
if (place_algorithm.is_timing_driven()) {
25-
//Prevent the norm factor from going to infinity
25+
// Prevent the norm factor from going to infinity
2626
timing_cost_norm = std::min(1 / timing_cost, MAX_INV_TIMING_COST);
2727
} else {
2828
// Timing normalization factor is not used

vpr/src/place/place_util.h

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -63,39 +63,33 @@ struct NocCostTerms {
6363
* values of the previous iteration. However, the divisions are expensive,
6464
* so we store their multiplicative inverses when they are updated in
6565
* the outer loop routines to speed up the normalization process.
66-
*
67-
* @param cost The weighted average of the wiring cost and the timing cost.
68-
* @param bb_cost The bounding box cost, aka the wiring cost.
69-
* @param timing_cost The timing cost, which is connection delay * criticality.
70-
*
71-
* @param bb_cost_norm The normalization factor for the wiring cost.
72-
* @param timing_cost_norm The normalization factor for the timing cost, which
73-
* is upper-bounded by the value of MAX_INV_TIMING_COST.
74-
*
75-
* @param noc_cost_terms NoC-related cost terms
76-
* @param noc_cost_norm_factors Normalization factors for NoC-related cost terms.
77-
*
78-
* @param MAX_INV_TIMING_COST Stops inverse timing cost from going to infinity
79-
* with very lax timing constraints, which avoids multiplying by a
80-
* gigantic timing_cost_norm when auto-normalizing. The exact value
81-
* of this cost has relatively little impact, but should be large
82-
* enough to not affect the timing costs computation for normal
83-
* constraints.
84-
*
85-
* @param place_algorithm Determines how the member values are updated upon
86-
* each temperature change during the placer annealing process.
8766
*/
8867
class t_placer_costs {
8968
public: //members
69+
/// The weighted average of the wiring cost, the timing cost, and the congestion cost (if enabled)
9070
double cost = 0.;
71+
72+
/// The bounding box cost, aka the wiring cost.
9173
double bb_cost = 0.;
74+
75+
/// The timing cost, which is connection delay * criticality.
9276
double timing_cost = 0.;
77+
78+
/// The congestion cost, which estimates how much routing channels are over-utilized.
9379
double congestion_cost = 0.;
80+
81+
/// The normalization factor for the wiring cost.
9482
double bb_cost_norm = 0.;
83+
84+
/// The normalization factor for the timing cost, which is upper-bounded by the value of MAX_INV_TIMING_COST.
9585
double timing_cost_norm = 0.;
86+
87+
/// The normalization factor for the congestion cost.
9688
double congestion_cost_norm = 0.;
9789

90+
/// NoC-related cost terms.
9891
NocCostTerms noc_cost_terms;
92+
/// Normalization factors for NoC-related cost terms.
9993
NocCostTerms noc_cost_norm_factors;
10094

10195
public: //Constructor
@@ -133,7 +127,18 @@ class t_placer_costs {
133127
t_placer_costs& operator+=(const NocCostTerms& noc_delta_cost);
134128

135129
private:
130+
/**
131+
* @brief Stops inverse timing cost from going to infinity
132+
* with very lax timing constraints, which avoids multiplying by a
133+
* gigantic timing_cost_norm when auto-normalizing. The exact value
134+
* of this cost has relatively little impact, but should be large
135+
* enough to not affect the timing costs computation for normal
136+
* constraints.
137+
*/
136138
static constexpr double MAX_INV_TIMING_COST = 1.e12;
139+
140+
/// Determines how the member values are updated upon
141+
/// each temperature change during the placer annealing process.
137142
t_place_algorithm place_algorithm;
138143
bool noc_enabled;
139144
};
@@ -150,39 +155,30 @@ class t_placer_costs {
150155
* In terms of calculating statistics for total cost, we mean that we
151156
* operate upon the set of placer cost values gathered after every
152157
* accepted block move.
153-
*
154-
* @param av_cost
155-
* Average total cost. Cost formulation depends on
156-
* the place algorithm currently being used.
157-
* @param av_bb_cost
158-
* Average bounding box (wiring) cost.
159-
* @param av_timing_cost
160-
* Average timing cost (delay * criticality).
161-
* @param sum_of_squares
162-
* Sum of squares of the total cost.
163-
* @param success_num
164-
* Number of accepted block swaps for the current iteration.
165-
* @param success_rate
166-
* num_accepted / total_trials for the current iteration.
167-
* @param std_dev
168-
* Standard deviation of the total cost.
169-
*
170158
*/
171159
class t_placer_statistics {
172160
public:
161+
/// Average total cost. Cost formulation depends on the place algorithm currently being used.
173162
double av_cost;
163+
/// Average bounding box (wiring) cost.
174164
double av_bb_cost;
165+
/// Average timing cost (delay * criticality).
175166
double av_timing_cost;
167+
/// Average congestion cost.
176168
double av_cong_cost;
169+
/// Sum of squares of the total cost.
177170
double sum_of_squares;
171+
/// Number of accepted block swaps for the current iteration.
178172
int success_sum;
173+
/// num_accepted / total_trials for the current iteration.
179174
float success_rate;
175+
/// Standard deviation of the total cost.
180176
double std_dev;
181177

182-
public: //Constructor
178+
public: // Constructor
183179
t_placer_statistics() { reset(); }
184180

185-
public: //Mutator
181+
public: // Mutator
186182
///@brief Clear all data fields.
187183
void reset();
188184

0 commit comments

Comments
 (0)