Skip to content

Commit fd6d5c5

Browse files
add rr_graph_chan_chan_edges
1 parent 9a12593 commit fd6d5c5

File tree

9 files changed

+1228
-1181
lines changed

9 files changed

+1228
-1181
lines changed

vpr/src/route/rr_graph_generation/rr_graph.cpp

Lines changed: 15 additions & 284 deletions
Large diffs are not rendered by default.

vpr/src/route/rr_graph_generation/rr_graph2.cpp

Lines changed: 4 additions & 852 deletions
Large diffs are not rendered by default.

vpr/src/route/rr_graph_generation/rr_graph2.h

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ int get_seg_start(const t_chan_seg_details* seg_details,
4545
const int itrack,
4646
const int chan_num,
4747
const int seg_num);
48+
4849
int get_seg_end(const t_chan_seg_details* seg_details,
4950
const int itrack,
5051
const int istart,
@@ -63,44 +64,6 @@ bool is_sblock(const int chan,
6364
const t_chan_seg_details* seg_details,
6465
const enum e_directionality directionality);
6566

66-
/// Adds the fan-out edges from wire segment at (chan, seg, track) to adjacent blocks along the wire's length
67-
int get_track_to_pins(RRGraphBuilder& rr_graph_builder,
68-
int layer,
69-
int seg,
70-
int chan,
71-
int track,
72-
int tracks_per_chan,
73-
RRNodeId from_rr_node,
74-
t_rr_edge_info_set& rr_edges_to_create,
75-
const t_track_to_pin_lookup& track_to_pin_lookup,
76-
const t_chan_seg_details* seg_details,
77-
e_rr_type chan_type,
78-
int chan_length,
79-
int wire_to_ipin_switch,
80-
e_directionality directionality);
81-
82-
int get_track_to_tracks(RRGraphBuilder& rr_graph_builder,
83-
const int layer,
84-
const int from_chan,
85-
const int from_seg,
86-
const int from_track,
87-
const e_rr_type from_type,
88-
const int to_seg,
89-
const e_rr_type to_type,
90-
const int chan_len,
91-
const int max_chan_width,
92-
const DeviceGrid& grid,
93-
const int Fs_per_side,
94-
t_sblock_pattern& sblock_pattern,
95-
RRNodeId from_rr_node,
96-
t_rr_edge_info_set& rr_edges_to_create,
97-
const t_chan_seg_details* from_seg_details,
98-
const t_chan_seg_details* to_seg_details,
99-
const t_chan_details& to_chan_details,
100-
const e_directionality directionality,
101-
const vtr::NdMatrix<std::vector<int>, 3>& switch_block_conn,
102-
const t_sb_connection_map* sb_conn_map);
103-
10467
/**
10568
* @brief Identifies and labels all mux endpoints at a given channel segment coordinate.
10669
*

vpr/src/route/rr_graph_generation/rr_graph_chan_chan_edges.cpp

Lines changed: 1168 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#pragma once
2+
3+
#include "rr_types.h"
4+
#include "build_switchblocks.h"
5+
6+
class RRGraphBuilder;
7+
struct t_chan_width;
8+
struct t_bottleneck_link;
9+
10+
void add_chan_chan_edges(RRGraphBuilder& rr_graph_builder,
11+
size_t num_seg_types_x,
12+
size_t num_seg_types_y,
13+
const t_track_to_pin_lookup& track_to_pin_lookup_x,
14+
const t_track_to_pin_lookup& track_to_pin_lookup_y,
15+
const t_chan_width& chan_width,
16+
const t_chan_details& chan_details_x,
17+
const t_chan_details& chan_details_y,
18+
t_sb_connection_map* sb_conn_map,
19+
const vtr::NdMatrix<std::vector<int>, 3>& switch_block_conn,
20+
const vtr::NdMatrix<std::vector<t_bottleneck_link>, 2>& interdie_3d_links,
21+
t_sblock_pattern& sblock_pattern,
22+
int Fs,
23+
int wire_to_ipin_switch,
24+
e_directionality directionality,
25+
bool is_global_graph,
26+
int& num_edges);

vpr/src/route/rr_graph_generation/rr_graph_opin_chan_edges.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,13 @@ void add_opin_chan_edges(RRGraphBuilder& rr_graph_builder,
658658
const std::vector<t_direct_inf>& directs,
659659
const std::vector<t_clb_to_clb_directs>& clb_to_clb_directs,
660660
e_directionality directionality,
661-
t_rr_edge_info_set& rr_edges_to_create,
662661
int& num_edges,
663662
int& rr_edges_before_directs,
664663
bool* Fc_clipped) {
665664
const DeviceGrid& grid = g_vpr_ctx.device().grid;
666665

666+
t_rr_edge_info_set rr_edges_to_create;
667+
667668
// These are data structures used by the unidir opin mapping. They are used
668669
// to spread connections evenly for each segment type among the available
669670
// wire start points

vpr/src/route/rr_graph_generation/rr_graph_opin_chan_edges.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ void add_opin_chan_edges(RRGraphBuilder& rr_graph_builder,
3737
const std::vector<t_direct_inf>& directs,
3838
const std::vector<t_clb_to_clb_directs>& clb_to_clb_directs,
3939
e_directionality directionality,
40-
t_rr_edge_info_set& rr_edges_to_create,
4140
int& num_edges,
4241
int& rr_edges_before_directs,
4342
bool* Fc_clipped);

vpr/src/route/rr_graph_generation/rr_graph_sg.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,14 @@ void add_and_connect_non_3d_sg_links(RRGraphBuilder& rr_graph_builder,
264264
const t_chan_details& chan_details_x,
265265
const t_chan_details& chan_details_y,
266266
size_t num_seg_types_x,
267-
t_rr_edge_info_set& non_3d_sg_rr_edges_to_create) {
267+
int& num_edges) {
268268
// Each SG link should have a corresponding RR node index
269269
VTR_ASSERT(sg_links.size() == sg_node_indices.size());
270270
const size_t num_links = sg_links.size();
271271

272+
t_rr_edge_info_set rr_edges_to_create;
273+
num_edges = 0;
274+
272275
for (size_t i = 0; i < num_links; i++) {
273276

274277
const t_bottleneck_link& link = sg_links[i];
@@ -320,7 +323,7 @@ void add_and_connect_non_3d_sg_links(RRGraphBuilder& rr_graph_builder,
320323
gather_chan_type,
321324
gather_wire.wire_switchpoint.wire);
322325
// Record deferred edge creation (gather_node --> sg_node)
323-
non_3d_sg_rr_edges_to_create.emplace_back(gather_node, node_id, link.arch_wire_switch, false);
326+
rr_edges_to_create.emplace_back(gather_node, node_id, link.arch_wire_switch, false);
324327
}
325328

326329
// Step 7: Add outgoing edges to scatter (fanout) channel wires
@@ -339,7 +342,11 @@ void add_and_connect_non_3d_sg_links(RRGraphBuilder& rr_graph_builder,
339342
// Determine which architecture switch this edge should use
340343
int switch_index = chan_details[chan_loc.x][chan_loc.y][scatter_wire.wire_switchpoint.wire].arch_wire_switch();
341344
// Record deferred edge creation (sg_node --> scatter_node)
342-
non_3d_sg_rr_edges_to_create.emplace_back(node_id, scatter_node, switch_index, false);
345+
rr_edges_to_create.emplace_back(node_id, scatter_node, switch_index, false);
343346
}
344347
}
348+
349+
uniquify_edges(rr_edges_to_create);
350+
rr_graph_builder.alloc_and_load_edges(&rr_edges_to_create);
351+
num_edges += rr_edges_to_create.size();
345352
}

vpr/src/route/rr_graph_generation/rr_graph_sg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ void add_edges_opin_chanz_per_block(const RRGraphView& rr_graph,
6767
* @param chan_details_x Channel details for CHANX segments.
6868
* @param chan_details_y Channel details for CHANY segments.
6969
* @param num_seg_types_x Number of segment types in the X direction.
70-
* @param non_3d_sg_rr_edges_to_create Set collecting RR edges to create later.
70+
* @param num_edges Total number of edges added to RR graph.
7171
*/
7272
void add_and_connect_non_3d_sg_links(RRGraphBuilder& rr_graph_builder,
7373
const std::vector<t_bottleneck_link>& sg_links,
7474
const std::vector<std::pair<RRNodeId, int>>& sg_node_indices,
7575
const t_chan_details& chan_details_x,
7676
const t_chan_details& chan_details_y,
7777
size_t num_seg_types_x,
78-
t_rr_edge_info_set& non_3d_sg_rr_edges_to_create);
78+
int& num_edges);

0 commit comments

Comments
 (0)