Skip to content

Commit 21e7287

Browse files
add parallel_segment_index and chan_type member vars to t_bottleneck_link
1 parent c642623 commit 21e7287

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

vpr/src/route/rr_graph_generation/build_scatter_gathers.cpp

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
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

161162
std::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
}

vpr/src/route/rr_graph_generation/build_scatter_gathers.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include <vector>
99

10-
// forward declartion
10+
// forward declaration
1111
namespace vtr {
1212
class RngContainer;
1313
}
@@ -32,6 +32,8 @@ struct t_bottleneck_link {
3232
t_physical_tile_loc gather_loc; ///< Source switchblock location.
3333
t_physical_tile_loc scatter_loc; ///< Destination switchblock location.
3434
int arch_wire_switch; ///< The switch (mux) used to drive the bottleneck wire.
35+
int parallel_segment_index;
36+
e_rr_type chan_type;
3537
std::vector<t_sg_candidate> gather_fanin_connections; ///< Wires driving the bottleneck link at `gather_loc`
3638
std::vector<t_sg_candidate> scatter_fanout_connections; ///< Wires driven by the bottleneck link at `scatter_loc`
3739
};
@@ -46,7 +48,7 @@ struct t_bottleneck_link {
4648
*
4749
* @param scatter_gather_patterns List of scatter/gather connection patterns.
4850
* @param inter_cluster_rr Flags indicating whether each layer has inter-cluster routing resources.
49-
* @param segment_inf Wire segment type information.
51+
* @param segment_inf_x, segment_inf_y, segment_inf_z Wire segment type information along each axis.
5052
* @param chan_details_x Channel details for horizontal routing channels.
5153
* @param chan_details_y Channel details for vertical routing channels.
5254
* @param nodes_per_chan Channel width data.
@@ -56,7 +58,9 @@ struct t_bottleneck_link {
5658
*/
5759
std::vector<t_bottleneck_link> alloc_and_load_scatter_gather_connections(const std::vector<t_scatter_gather_pattern>& scatter_gather_patterns,
5860
const std::vector<bool>& inter_cluster_rr,
59-
const std::vector<t_segment_inf>& segment_inf,
61+
const std::vector<t_segment_inf>& segment_inf_x,
62+
const std::vector<t_segment_inf>& segment_inf_y,
63+
const std::vector<t_segment_inf>& segment_inf_z,
6064
const t_chan_details& chan_details_x,
6165
const t_chan_details& chan_details_y,
6266
const t_chan_width& nodes_per_chan,

vpr/src/route/rr_graph_generation/rr_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ static void build_rr_graph(e_graph_type graph_type,
913913
vtr::NdMatrix<std::vector<t_bottleneck_link>, 2> interdie_3d_links;
914914
const std::vector<t_bottleneck_link> bottleneck_links = alloc_and_load_scatter_gather_connections(scatter_gather_patterns,
915915
inter_cluster_prog_rr,
916-
segment_inf,
916+
segment_inf_x, segment_inf_y, segment_inf_z,
917917
chan_details_x, chan_details_y,
918918
nodes_per_chan,
919919
switchpoint_rng,

0 commit comments

Comments
 (0)