@@ -119,7 +119,7 @@ void ClockRib::set_initial_wire_location(int start_x, int end_x, int y) {
119119
120120void ClockRib::set_wire_repeat (int repeat_x, int repeat_y) {
121121 if (repeat_x <= 0 || repeat_y <= 0 ) {
122- // Avoid an infinte loop when creating ribs
122+ // Avoid an infinite loop when creating ribs
123123 VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Clock Network wire repeat (%d,%d) must be greater than zero\n " ,
124124 repeat_x, repeat_y);
125125 }
@@ -399,9 +399,16 @@ void ClockRib::record_tap_locations(unsigned x_start,
399399void ClockRib::map_relative_seg_indices (const t_unified_to_parallel_seg_index& indices_map) {
400400 // We have horizontal segments in clock-ribs so we search for X_AXIS
401401
402- drive_seg_idx = get_parallel_seg_index (drive_seg_idx, indices_map, e_parallel_axis::X_AXIS);
403- left_seg_idx = get_parallel_seg_index (left_seg_idx, indices_map, e_parallel_axis::X_AXIS);
404- right_seg_idx = get_parallel_seg_index (right_seg_idx, indices_map, e_parallel_axis::X_AXIS);
402+ int seg_idx;
403+
404+ seg_idx = get_parallel_seg_index (drive_seg_idx, indices_map, e_parallel_axis::X_AXIS);
405+ drive_seg_idx = (seg_idx >= 0 ) ? seg_idx : drive_seg_idx;
406+
407+ seg_idx = get_parallel_seg_index (left_seg_idx, indices_map, e_parallel_axis::X_AXIS);
408+ left_seg_idx = (seg_idx >= 0 ) ? seg_idx : left_seg_idx;
409+
410+ seg_idx = get_parallel_seg_index (right_seg_idx, indices_map, e_parallel_axis::X_AXIS);
411+ right_seg_idx = (seg_idx >= 0 ) ? seg_idx : right_seg_idx;
405412}
406413
407414/* ********************************************************************************
@@ -446,7 +453,7 @@ void ClockSpine::set_initial_wire_location(int start_y, int end_y, int x) {
446453
447454void ClockSpine::set_wire_repeat (int repeat_x, int repeat_y) {
448455 if (repeat_x <= 0 || repeat_y <= 0 ) {
449- // Avoid an infinte loop when creating spines
456+ // Avoid an infinite loop when creating spines
450457 VPR_FATAL_ERROR (VPR_ERROR_ROUTE, " Clock Network wire repeat (%d,%d) must be greater than zero\n " ,
451458 repeat_x, repeat_y);
452459 }
@@ -727,9 +734,16 @@ void ClockSpine::record_tap_locations(unsigned y_start,
727734void ClockSpine::map_relative_seg_indices (const t_unified_to_parallel_seg_index& indices_map) {
728735 // We have vertical segments in clock-spines so we search for Y_AXIS
729736
730- drive_seg_idx = get_parallel_seg_index (drive_seg_idx, indices_map, e_parallel_axis::Y_AXIS);
731- left_seg_idx = get_parallel_seg_index (left_seg_idx, indices_map, e_parallel_axis::Y_AXIS);
732- right_seg_idx = get_parallel_seg_index (right_seg_idx, indices_map, e_parallel_axis::Y_AXIS);
737+ int seg_idx;
738+
739+ seg_idx = get_parallel_seg_index (drive_seg_idx, indices_map, e_parallel_axis::Y_AXIS);
740+ drive_seg_idx = (seg_idx >= 0 ) ? seg_idx : drive_seg_idx;
741+
742+ seg_idx = get_parallel_seg_index (left_seg_idx, indices_map, e_parallel_axis::Y_AXIS);
743+ left_seg_idx = (seg_idx >= 0 ) ? seg_idx : left_seg_idx;
744+
745+ seg_idx = get_parallel_seg_index (right_seg_idx, indices_map, e_parallel_axis::Y_AXIS);
746+ right_seg_idx = (seg_idx >= 0 ) ? seg_idx : right_seg_idx;
733747}
734748
735749/* ********************************************************************************
0 commit comments