Skip to content

Commit 4c55d01

Browse files
committed
rr_graph: use arithmetic mean to calculate delay normalization factor
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 6721818 commit 4c55d01

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

vpr/src/route/rr_graph_indexed_data.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,21 +256,18 @@ static float get_delay_normalization_fac() {
256256
auto& device_ctx = g_vpr_ctx.device();
257257
auto& rr_indexed_data = device_ctx.rr_indexed_data;
258258

259-
std::vector<float> Tdel_vector(0.0);
259+
float Tdel_sum = 0.0;
260+
int Tdel_num = 0;
260261
for (size_t cost_index = CHANX_COST_INDEX_START; cost_index < rr_indexed_data.size(); cost_index++) {
261262
float T_value = rr_indexed_data[cost_index].T_linear + rr_indexed_data[cost_index].T_quadratic;
262263

263-
if (rr_indexed_data[cost_index].number_of_nodes == 0 || T_value == 0.0) continue;
264+
if (T_value == 0.0) continue;
264265

265-
Tdel_vector.push_back(T_value * 1e10);
266+
Tdel_sum += T_value;
267+
Tdel_num += 1;
266268
}
267269

268-
double mult = 1.0f;
269-
for (auto Tdel : Tdel_vector) {
270-
mult *= Tdel;
271-
}
272-
273-
return std::pow(mult, 1.0 / Tdel_vector.size()) / 1e10;
270+
return Tdel_sum / Tdel_num;
274271
}
275272

276273
static void load_rr_indexed_data_T_values() {
@@ -362,8 +359,6 @@ static void load_rr_indexed_data_T_values() {
362359
rr_indexed_data[cost_index].T_quadratic = 0.0;
363360
rr_indexed_data[cost_index].C_load = 0.0;
364361
} else {
365-
rr_indexed_data[cost_index].number_of_nodes = num_nodes_of_index[cost_index];
366-
367362
float Rnode = R_total[cost_index] / num_nodes_of_index[cost_index];
368363
float Cnode = C_total[cost_index] / num_nodes_of_index[cost_index];
369364
float Rsw = (float)switch_R_total[cost_index] / num_nodes_of_index[cost_index];

vpr/src/route/rr_node.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ struct t_rr_indexed_data {
185185
float T_linear = std::numeric_limits<float>::quiet_NaN();
186186
float T_quadratic = std::numeric_limits<float>::quiet_NaN();
187187
float C_load = std::numeric_limits<float>::quiet_NaN();
188-
int number_of_nodes = 0;
189188
};
190189

191190
#include "rr_node_impl.h"

0 commit comments

Comments
 (0)