77#include " scatter_gather_types.h"
88#include " rr_types.h"
99#include " globals.h"
10+ #include " rr_graph_uxsdcxx_interface.h"
1011#include " vtr_assert.h"
1112#include " vtr_random.h"
1213
@@ -160,7 +161,9 @@ static std::vector<t_sg_candidate> find_candidate_wires(const std::vector<t_chan
160161
161162std::vector<t_bottleneck_link> alloc_and_load_scatter_gather_connections (const std::vector<t_scatter_gather_pattern>& scatter_gather_patterns,
162163 const std::vector<bool >& inter_cluster_rr,
163- const std::vector<t_segment_inf>& segment_inf,
164+ const std::vector<t_segment_inf>& segment_inf_x,
165+ const std::vector<t_segment_inf>& segment_inf_y,
166+ const std::vector<t_segment_inf>& segment_inf_z,
164167 const t_chan_details& chan_details_x,
165168 const t_chan_details& chan_details_y,
166169 const t_chan_width& nodes_per_chan,
@@ -201,6 +204,19 @@ std::vector<t_bottleneck_link> alloc_and_load_scatter_gather_connections(const s
201204 VTR_ASSERT (sg_link_it != sg_pattern.sg_links .end ());
202205 const t_sg_link& sg_link = *sg_link_it;
203206
207+ VTR_ASSERT (vtr::exactly_k_conditions (1 , sg_link.x_offset != 0 , sg_link.y_offset != 0 , sg_link.z_offset != 0 ));
208+ t_physical_tile_loc scatter_loc;
209+ scatter_loc.x = gather_loc.x + sg_link.x_offset ;
210+ scatter_loc.y = gather_loc.y + sg_link.y_offset ;
211+ scatter_loc.layer_num = gather_loc.layer_num + sg_link.z_offset ;
212+
213+ const std::vector<t_segment_inf> segment_inf& = (sg_link.x_offset != 0 ) ? segment_inf_x :
214+ (sg_link.y_offset != 0 ) ? segment_inf_y : segment_inf_z;
215+
216+ const e_rr_type chan_type = (sg_link.x_offset != 0 ) ? e_rr_type::CHANX :
217+ (sg_link.y_offset != 0 ) ? e_rr_type::CHANY : e_rr_type::CHANZ;
218+
219+
204220 auto seg_it = std::ranges::find_if (segment_inf,
205221 [&](const t_segment_inf& seg) noexcept {
206222 return seg.name == sg_link.seg_type ;
@@ -209,10 +225,6 @@ std::vector<t_bottleneck_link> alloc_and_load_scatter_gather_connections(const s
209225 VTR_ASSERT (seg_it != segment_inf.end ());
210226 const t_segment_inf& wire_segment = *seg_it;
211227
212- t_physical_tile_loc scatter_loc;
213- scatter_loc.x = gather_loc.x + sg_link.x_offset ;
214- scatter_loc.y = gather_loc.y + sg_link.y_offset ;
215- scatter_loc.layer_num = gather_loc.layer_num + sg_link.z_offset ;
216228
217229 index_to_correct_sg_channels (sg_pattern.gather_pattern , gather_loc, chan_details_x, chan_details_y, gather_channels);
218230 index_to_correct_sg_channels (sg_pattern.scatter_pattern , scatter_loc, chan_details_x, chan_details_y, scatter_channels);
@@ -317,6 +329,9 @@ std::vector<t_bottleneck_link> alloc_and_load_scatter_gather_connections(const s
317329 } else {
318330 bottleneck_link.arch_wire_switch = wire_segment.arch_wire_switch ;
319331 }
332+
333+ bottleneck_link.chan_type = chan_type;
334+ bottleneck_link.parallel_segment_index = std::distance (segment_inf.begin (), seg_it);
320335 bottleneck_links.push_back (std::move (bottleneck_link));
321336 }
322337 }
0 commit comments