Skip to content

Commit b6b5332

Browse files
committed
rr_graph: avoid div-by-zero issues while getting the delay norm fac
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 18b7ca6 commit b6b5332

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vpr/src/route/rr_graph_indexed_data.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ static float get_delay_normalization_fac() {
278278
Tdel_num += 1;
279279
}
280280

281+
if (Tdel_num == 0) {
282+
VTR_LOG_WARN("No valid cost index was found to get the delay normalization factor. Setting delay normalization factor to 1e-9 (1 ns)\n");
283+
return 1e-9;
284+
}
285+
281286
float delay_norm_fac = Tdel_sum / Tdel_num;
282287

283288
if (getEchoEnabled() && isEchoFileEnabled(E_ECHO_RR_GRAPH_INDEXED_DATA)) {

0 commit comments

Comments
 (0)