Skip to content

Commit 3402606

Browse files
committed
[vpr][route][crr] pass rr_node_driver_switches and use it in build_crr_gsb_track_to_track_edges
1 parent d20a783 commit 3402606

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

vpr/src/route/rr_graph_generation/tileable_rr_graph/crr_generator/crr_edge_builder.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,21 @@ static RRSwitchId find_or_create_crr_switch_id(const int delay_ps) {
5353
}
5454

5555
void build_crr_gsb_track_to_track_edges(RRGraphBuilder& rr_graph_builder,
56+
const vtr::vector<RRNodeId, RRSwitchId>& rr_node_driver_switches,
5657
const RRGSB& rr_gsb,
5758
const crrgenerator::CRRConnectionBuilder& connection_builder) {
5859
size_t gsb_x = rr_gsb.get_sb_x();
5960
size_t gsb_y = rr_gsb.get_sb_y();
6061

6162
std::vector<crrgenerator::Connection> gsb_connections = connection_builder.get_tile_connections(gsb_x, gsb_y);
6263
for (const auto& connection : gsb_connections) {
63-
RRSwitchId rr_switch_id = find_or_create_crr_switch_id(connection.delay_ps());
64+
RRSwitchId rr_switch_id;
65+
int delay_ps = connection.delay_ps();
66+
if (delay_ps == -1) {
67+
rr_switch_id = rr_node_driver_switches[connection.sink_node()];
68+
} else {
69+
rr_switch_id = find_or_create_crr_switch_id(delay_ps, segment_inf_x, segment_inf_y);
70+
}
6471
VTR_ASSERT(rr_switch_id != RRSwitchId::INVALID());
6572
rr_graph_builder.create_edge_in_cache(connection.src_node(), connection.sink_node(), rr_switch_id, false, connection.sw_template_id());
6673
}

vpr/src/route/rr_graph_generation/tileable_rr_graph/crr_generator/crr_edge_builder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
#include "crr_connection_builder.h"
1818

1919
void build_crr_gsb_track_to_track_edges(RRGraphBuilder& rr_graph_builder,
20+
const vtr::vector<RRNodeId, RRSwitchId>& rr_node_driver_switches,
2021
const RRGSB& rr_gsb,
2122
const crrgenerator::CRRConnectionBuilder& connection_builder);

vpr/src/route/rr_graph_generation/tileable_rr_graph/tileable_rr_graph_edge_builder.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ void build_rr_graph_regular_edges(const RRGraphView& rr_graph,
365365
t_track2track_map sb_conn; /* [0..from_gsb_side][0..chan_width-1][track_indices] */
366366
if (build_crr_edges) {
367367
if (ix != gsb_range.x() && iy != gsb_range.y()) {
368-
build_crr_gsb_track_to_track_edges(rr_graph_builder, rr_gsb, *crr_connection_builder);
368+
build_crr_gsb_track_to_track_edges(rr_graph_builder,
369+
rr_node_driver_switches,
370+
rr_gsb,
371+
*crr_connection_builder);
369372
}
370373
} else {
371374
sb_conn = build_gsb_track_to_track_map(rr_graph,

0 commit comments

Comments
 (0)