@@ -29,6 +29,8 @@ static void load_rr_indexed_data_T_values(int index_start,
29
29
int nodes_per_chan,
30
30
const t_rr_node_indices& L_rr_node_indices);
31
31
32
+ static void fixup_rr_indexed_data_T_values (size_t num_segment);
33
+
32
34
static std::vector<size_t > count_rr_segment_types ();
33
35
34
36
/* ******************* Subroutine definitions *********************************/
@@ -115,27 +117,7 @@ void alloc_and_load_rr_indexed_data(const std::vector<t_segment_inf>& segment_in
115
117
load_rr_indexed_data_T_values ((CHANX_COST_INDEX_START + num_segment),
116
118
num_segment, CHANY, nodes_per_chan, L_rr_node_indices);
117
119
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.
126
- for (int cost_index = CHANX_COST_INDEX_START;
127
- cost_index < CHANX_COST_INDEX_START + 2 * num_segment; cost_index++) {
128
- int ortho_cost_index = device_ctx.rr_indexed_data [cost_index].ortho_cost_index ;
129
-
130
- // Check if this data is uninitialized, but the orthogonal data is
131
- // initialized.
132
- 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.
134
- device_ctx.rr_indexed_data [cost_index].T_linear = device_ctx.rr_indexed_data [ortho_cost_index].T_linear ;
135
- device_ctx.rr_indexed_data [cost_index].T_quadratic = device_ctx.rr_indexed_data [ortho_cost_index].T_quadratic ;
136
- device_ctx.rr_indexed_data [cost_index].C_load = device_ctx.rr_indexed_data [ortho_cost_index].C_load ;
137
- }
138
- }
120
+ fixup_rr_indexed_data_T_values (num_segment);
139
121
140
122
load_rr_indexed_data_base_costs (nodes_per_chan, L_rr_node_indices,
141
123
base_cost_type);
@@ -448,3 +430,29 @@ static void load_rr_indexed_data_T_values(int index_start,
448
430
free (switch_Cinternal_total);
449
431
free (switches_buffered);
450
432
}
433
+
434
+ static void fixup_rr_indexed_data_T_values (size_t num_segment) {
435
+ auto & device_ctx = g_vpr_ctx.mutable_device ();
436
+
437
+ // Scan CHANX/CHANY indexed data and search for uninitialized costs.
438
+ //
439
+ // This would occur if a segment ends up only being used as CHANX or a
440
+ // CHANY, but not both. If this occurs, then copying the orthogonal
441
+ // pair's cost data is likely a better choice than leaving it as -1.
442
+ //
443
+ // The primary reason for this fixup is to avoid propagating negative
444
+ // values in cost functions.
445
+ for (size_t cost_index = CHANX_COST_INDEX_START;
446
+ cost_index < CHANX_COST_INDEX_START + 2 * num_segment; cost_index++) {
447
+ int ortho_cost_index = device_ctx.rr_indexed_data [cost_index].ortho_cost_index ;
448
+
449
+ // Check if this data is uninitialized, but the orthogonal data is
450
+ // initialized.
451
+ if (device_ctx.rr_indexed_data [cost_index].T_linear == OPEN && device_ctx.rr_indexed_data [ortho_cost_index].T_linear != OPEN) {
452
+ // Copy orthogonal data over.
453
+ device_ctx.rr_indexed_data [cost_index].T_linear = device_ctx.rr_indexed_data [ortho_cost_index].T_linear ;
454
+ device_ctx.rr_indexed_data [cost_index].T_quadratic = device_ctx.rr_indexed_data [ortho_cost_index].T_quadratic ;
455
+ device_ctx.rr_indexed_data [cost_index].C_load = device_ctx.rr_indexed_data [ortho_cost_index].C_load ;
456
+ }
457
+ }
458
+ }
0 commit comments