Skip to content

Commit 53b178b

Browse files
litghostkmurray
authored andcommitted
Expand comment on orthogonal data fixup.
Signed-off-by: Keith Rothman <[email protected]>
1 parent 17728ad commit 53b178b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

vpr/src/route/rr_graph_indexed_data.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,22 @@ void alloc_and_load_rr_indexed_data(const std::vector<t_segment_inf>& segment_in
115115
load_rr_indexed_data_T_values((CHANX_COST_INDEX_START + num_segment),
116116
num_segment, CHANY, nodes_per_chan, L_rr_node_indices);
117117

118+
// Scan CHANX/CHANY indexed data and search for uninitialized costs.
119+
//
120+
// This would occur if a segment ends up only being used as CHANX or a
121+
// CHANY, but not both. If this occurs, then copying the orthogonal
122+
// pair's cost data is likely a better choice than leaving it as -1.
123+
//
124+
// The primary reason for this fixup is to avoid propagating negative
125+
// values in cost functions.
118126
for (int cost_index = CHANX_COST_INDEX_START;
119127
cost_index < CHANX_COST_INDEX_START + 2 * num_segment; cost_index++) {
120128
int ortho_cost_index = device_ctx.rr_indexed_data[cost_index].ortho_cost_index;
121-
/* If segments doesn't have data (e.g. doesn't exists), check if ortho
122-
* segment does exist. If so, copy that data. */
129+
130+
// Check if this data is uninitialized, but the orthogonal data is
131+
// initialized.
123132
if (device_ctx.rr_indexed_data[cost_index].T_linear == OPEN && device_ctx.rr_indexed_data[ortho_cost_index].T_linear != OPEN) {
133+
// Copy orthogonal data over.
124134
device_ctx.rr_indexed_data[cost_index].T_linear = device_ctx.rr_indexed_data[ortho_cost_index].T_linear;
125135
device_ctx.rr_indexed_data[cost_index].T_quadratic = device_ctx.rr_indexed_data[ortho_cost_index].T_quadratic;
126136
device_ctx.rr_indexed_data[cost_index].C_load = device_ctx.rr_indexed_data[ortho_cost_index].C_load;

0 commit comments

Comments
 (0)