diff --git a/vpr/src/route/rr_graph.cpp b/vpr/src/route/rr_graph.cpp index 03c96393427..cb3656eebe7 100644 --- a/vpr/src/route/rr_graph.cpp +++ b/vpr/src/route/rr_graph.cpp @@ -100,7 +100,8 @@ static vtr::NdMatrix, 4> alloc_and_load_track_to_pin_lookup(vtr const int max_chan_width, const int num_seg_types); -static void build_bidir_rr_opins(const int i, +static void build_bidir_rr_opins(RRGraphBuilder& rr_graph_builder, + const int i, const int j, const e_side side, const t_rr_node_indices& L_rr_node_indices, @@ -117,7 +118,8 @@ static void build_bidir_rr_opins(const int i, const int num_seg_types, t_opin_connections_scratchpad* scratchpad); -static void build_unidir_rr_opins(const int i, +static void build_unidir_rr_opins(RRGraphBuilder& rr_graph_builder, + const int i, const int j, const e_side side, const DeviceGrid& grid, @@ -137,11 +139,12 @@ static void build_unidir_rr_opins(const int i, const int num_seg_types, t_opin_connections_scratchpad* scratchpad); -static int get_opin_direct_connections(int x, +static int get_opin_direct_connections(RRGraphBuilder& rr_graph_builder, + int x, int y, e_side side, int opin, - int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, const t_rr_node_indices& L_rr_node_indices, const t_rr_graph_storage& rr_nodes, @@ -150,7 +153,8 @@ static int get_opin_direct_connections(int x, const t_clb_to_clb_directs* clb_to_clb_directs, t_opin_connections_scratchpad* scratchpad); -static std::function alloc_and_load_rr_graph(t_rr_graph_storage& L_rr_node, +static std::function alloc_and_load_rr_graph(RRGraphBuilder& rr_graph_builder, + t_rr_graph_storage& L_rr_node, const int num_seg_types, const t_chan_details& chan_details_x, const t_chan_details& chan_details_y, @@ -209,7 +213,8 @@ static std::vector> alloc_and_load_perturb_ipins(const int L_n const std::vector>& Fc_out, const enum e_directionality directionality); -static void build_rr_sinks_sources(const int i, +static void build_rr_sinks_sources(RRGraphBuilder& rr_graph_builder, + const int i, const int j, t_rr_graph_storage& L_rr_node, t_rr_edge_info_set& rr_edges_to_create, @@ -218,7 +223,8 @@ static void build_rr_sinks_sources(const int i, const DeviceGrid& grid, t_opin_connections_scratchpad* scratchpad); -static void build_rr_chan(const int i, +static void build_rr_chan(RRGraphBuilder& rr_graph_builder, + const int i, const int j, const t_rr_type chan_type, const t_track_to_pin_lookup& track_to_pin_lookup, @@ -232,7 +238,6 @@ static void build_rr_chan(const int i, const int Fs_per_side, const t_chan_details& chan_details_x, const t_chan_details& chan_details_y, - const t_rr_node_indices& L_rr_node_indices, t_rr_edge_info_set& created_rr_edges, t_rr_graph_storage& L_rr_node, const int wire_to_ipin_switch, @@ -278,9 +283,9 @@ static std::vector> alloc_and_load_actual_fc(const std::vector< const enum e_directionality directionality, bool* Fc_clipped); -static int pick_best_direct_connect_target_rr_node(const t_rr_graph_storage& rr_nodes, - int from_rr, - const std::vector& candidate_rr_nodes); +static RRNodeId pick_best_direct_connect_target_rr_node(const t_rr_graph_storage& rr_nodes, + RRNodeId from_rr, + const std::vector& candidate_rr_nodes); static void process_non_config_sets(); @@ -685,6 +690,7 @@ static void build_rr_graph(const t_graph_type graph_type, bool Fc_clipped = false; auto update_chan_width = alloc_and_load_rr_graph( + device_ctx.rr_graph_builder, device_ctx.rr_nodes, segment_inf.size(), chan_details_x, chan_details_y, track_to_pin_lookup, opin_to_track_map, @@ -1131,7 +1137,8 @@ static void free_type_track_to_pin_map(t_track_to_pin_lookup& track_to_pin_map, /* Does the actual work of allocating the rr_graph and filling all the * * appropriate values. Everything up to this was just a prelude! */ -static std::function alloc_and_load_rr_graph(t_rr_graph_storage& L_rr_node, +static std::function alloc_and_load_rr_graph(RRGraphBuilder& rr_graph_builder, + t_rr_graph_storage& L_rr_node, const int num_seg_types, const t_chan_details& chan_details_x, const t_chan_details& chan_details_y, @@ -1180,7 +1187,7 @@ static std::function alloc_and_load_rr_graph(t_rr_graph_sto /* Connection SINKS and SOURCES to their pins. */ for (size_t i = 0; i < grid.width(); ++i) { for (size_t j = 0; j < grid.height(); ++j) { - build_rr_sinks_sources(i, j, L_rr_node, rr_edges_to_create, L_rr_node_indices, + build_rr_sinks_sources(rr_graph_builder, i, j, L_rr_node, rr_edges_to_create, L_rr_node_indices, delayless_switch, grid, &scratchpad); //Create the actual SOURCE->OPIN, IPIN->SINK edges @@ -1195,14 +1202,14 @@ static std::function alloc_and_load_rr_graph(t_rr_graph_sto for (size_t j = 0; j < grid.height(); ++j) { for (e_side side : SIDES) { if (BI_DIRECTIONAL == directionality) { - build_bidir_rr_opins(i, j, side, L_rr_node_indices, L_rr_node, + build_bidir_rr_opins(rr_graph_builder, i, j, side, L_rr_node_indices, L_rr_node, opin_to_track_map, Fc_out, rr_edges_to_create, chan_details_x, chan_details_y, grid, directs, num_directs, clb_to_clb_directs, num_seg_types, &scratchpad); } else { VTR_ASSERT(UNI_DIRECTIONAL == directionality); bool clipped; - build_unidir_rr_opins(i, j, side, grid, Fc_out, max_chan_width, + build_unidir_rr_opins(rr_graph_builder, i, j, side, grid, Fc_out, max_chan_width, chan_details_x, chan_details_y, Fc_xofs, Fc_yofs, rr_edges_to_create, &clipped, L_rr_node_indices, L_rr_node, directs, num_directs, clb_to_clb_directs, num_seg_types, &scratchpad); @@ -1225,11 +1232,11 @@ static std::function alloc_and_load_rr_graph(t_rr_graph_sto for (size_t j = 0; j < grid.height() - 1; ++j) { if (i > 0) { int tracks_per_chan = ((is_global_graph) ? 1 : chan_width.x_list[j]); - build_rr_chan(i, j, CHANX, track_to_pin_lookup, sb_conn_map, switch_block_conn, + build_rr_chan(rr_graph_builder, i, j, CHANX, track_to_pin_lookup, sb_conn_map, switch_block_conn, CHANX_COST_INDEX_START, max_chan_width, grid, tracks_per_chan, sblock_pattern, Fs / 3, chan_details_x, chan_details_y, - L_rr_node_indices, rr_edges_to_create, L_rr_node, + rr_edges_to_create, L_rr_node, wire_to_ipin_switch, directionality, &scratchpad); @@ -1240,11 +1247,11 @@ static std::function alloc_and_load_rr_graph(t_rr_graph_sto } if (j > 0) { int tracks_per_chan = ((is_global_graph) ? 1 : chan_width.y_list[i]); - build_rr_chan(i, j, CHANY, track_to_pin_lookup, sb_conn_map, switch_block_conn, + build_rr_chan(rr_graph_builder, i, j, CHANY, track_to_pin_lookup, sb_conn_map, switch_block_conn, CHANX_COST_INDEX_START + num_seg_types, max_chan_width, grid, tracks_per_chan, sblock_pattern, Fs / 3, chan_details_x, chan_details_y, - L_rr_node_indices, rr_edges_to_create, L_rr_node, + rr_edges_to_create, L_rr_node, wire_to_ipin_switch, directionality, &scratchpad); @@ -1274,7 +1281,8 @@ static std::function alloc_and_load_rr_graph(t_rr_graph_sto return update_chan_width; } -static void build_bidir_rr_opins(const int i, +static void build_bidir_rr_opins(RRGraphBuilder& rr_graph_builder, + const int i, const int j, const e_side side, const t_rr_node_indices& L_rr_node_indices, @@ -1321,18 +1329,18 @@ static void build_bidir_rr_opins(const int i, total_pin_Fc += Fc[pin_index][iseg]; } - int node_index = get_rr_node_index(L_rr_node_indices, i, j, OPIN, pin_index, side); - VTR_ASSERT(node_index >= 0); + RRNodeId node_index = rr_graph_builder.node_lookup().find_node(i, j, OPIN, pin_index, side); + VTR_ASSERT(node_index); if (total_pin_Fc > 0) { - get_bidir_opin_connections(i, j, pin_index, - node_index, rr_edges_to_create, opin_to_track_map, L_rr_node_indices, + get_bidir_opin_connections(rr_graph_builder, i, j, pin_index, + node_index, rr_edges_to_create, opin_to_track_map, chan_details_x, chan_details_y); } /* Add in direct connections */ - get_opin_direct_connections(i, j, side, pin_index, + get_opin_direct_connections(rr_graph_builder, i, j, side, pin_index, node_index, rr_edges_to_create, L_rr_node_indices, rr_nodes, directs, num_directs, clb_to_clb_directs, scratchpad); } @@ -1370,7 +1378,8 @@ void free_rr_graph() { invalidate_router_lookahead_cache(); } -static void build_rr_sinks_sources(const int i, +static void build_rr_sinks_sources(RRGraphBuilder& rr_graph_builder, + const int i, const int j, t_rr_graph_storage& L_rr_node, t_rr_edge_info_set& rr_edges_to_create, @@ -1394,10 +1403,10 @@ static void build_rr_sinks_sources(const int i, /* SINK and SOURCE-to-OPIN edges */ for (int iclass = 0; iclass < num_class; ++iclass) { - int inode = 0; + RRNodeId inode = RRNodeId::INVALID(); if (class_inf[iclass].type == DRIVER) { /* SOURCE */ - inode = get_rr_node_index(L_rr_node_indices, i, j, SOURCE, iclass); - VTR_ASSERT(inode >= 0); + inode = rr_graph_builder.node_lookup().find_node(i, j, SOURCE, iclass); + VTR_ASSERT(inode); //Retrieve all the physical OPINs associated with this source, this includes //those at different grid tiles of this block @@ -1406,6 +1415,7 @@ static void build_rr_sinks_sources(const int i, for (int height_offset = 0; height_offset < type->height; ++height_offset) { for (int ipin = 0; ipin < class_inf[iclass].num_pins; ++ipin) { int pin_num = class_inf[iclass].pinlist[ipin]; + /* TODO: scratchpad should be reworked to use RRNodeId */ std::vector& physical_pins = scratchpad->scratch[0]; get_rr_node_indices(L_rr_node_indices, i + width_offset, j + height_offset, OPIN, pin_num, &physical_pins); opin_nodes.insert(opin_nodes.end(), physical_pins.begin(), physical_pins.end()); @@ -1414,17 +1424,18 @@ static void build_rr_sinks_sources(const int i, } //Connect the SOURCE to each OPIN + //TODO: rr_edges_to_create should be adapted to use RRNodeId for (size_t iedge = 0; iedge < opin_nodes.size(); ++iedge) { - rr_edges_to_create.emplace_back(inode, opin_nodes[iedge], delayless_switch); + rr_edges_to_create.emplace_back(size_t(inode), opin_nodes[iedge], delayless_switch); } - L_rr_node[inode].set_cost_index(SOURCE_COST_INDEX); - L_rr_node[inode].set_type(SOURCE); + L_rr_node.set_node_cost_index(inode, SOURCE_COST_INDEX); + L_rr_node.set_node_type(inode, SOURCE); } else { /* SINK */ VTR_ASSERT(class_inf[iclass].type == RECEIVER); - inode = get_rr_node_index(L_rr_node_indices, i, j, SINK, iclass); + inode = rr_graph_builder.node_lookup().find_node(i, j, SINK, iclass); - VTR_ASSERT(inode >= 0); + VTR_ASSERT(inode); /* NOTE: To allow route throughs through clbs, change the lines below to * * make an edge from the input SINK to the output SOURCE. Do for just the * @@ -1432,17 +1443,21 @@ static void build_rr_sinks_sources(const int i, * leads to. If route throughs are allowed, you may want to increase the * * base cost of OPINs and/or SOURCES so they aren't used excessively. */ - L_rr_node[inode].set_cost_index(SINK_COST_INDEX); - L_rr_node[inode].set_type(SINK); + /* TODO: The casting will be removed when RRGraphBuilder has the following APIs: + * - set_node_cost_index(RRNodeId, int); + * - set_node_type(RRNodeId, t_rr_type); + */ + L_rr_node.set_node_cost_index(inode, SINK_COST_INDEX); + L_rr_node.set_node_type(inode, SINK); } /* Things common to both SOURCEs and SINKs. */ - L_rr_node[inode].set_capacity(class_inf[iclass].num_pins); - L_rr_node[inode].set_coordinates(i, j, i + type->width - 1, j + type->height - 1); + L_rr_node.set_node_capacity(inode, class_inf[iclass].num_pins); + L_rr_node.set_node_coordinates(inode, i, j, i + type->width - 1, j + type->height - 1); float R = 0.; float C = 0.; - L_rr_node[inode].set_rc_index(find_create_rr_rc_data(R, C)); - L_rr_node[inode].set_ptc_num(iclass); + L_rr_node.set_node_rc_index(inode, find_create_rr_rc_data(R, C)); + L_rr_node.set_node_ptc_num(inode, iclass); } /* Connect IPINS to SINKS and initialize OPINS */ @@ -1453,58 +1468,57 @@ static void build_rr_sinks_sources(const int i, for (int width_offset = 0; width_offset < type->width; ++width_offset) { for (int height_offset = 0; height_offset < type->height; ++height_offset) { if (type->pinloc[width_offset][height_offset][side][ipin]) { - int inode; + RRNodeId inode = RRNodeId::INVALID(); int iclass = pin_class[ipin]; if (class_inf[iclass].type == RECEIVER) { //Connect the input pin to the sink - inode = get_rr_node_index(L_rr_node_indices, i + width_offset, j + height_offset, IPIN, ipin, side); + inode = rr_graph_builder.node_lookup().find_node(i + width_offset, j + height_offset, IPIN, ipin, side); /* Input pins are uniquified, we may not always find one */ - if (OPEN != inode) { - int to_node = get_rr_node_index(L_rr_node_indices, i, j, SINK, iclass); + if (inode) { + RRNodeId to_node = rr_graph_builder.node_lookup().find_node(i, j, SINK, iclass); //Add info about the edge to be created - rr_edges_to_create.emplace_back(inode, to_node, delayless_switch); + //TODO: rr_edges_to_create should be adapted to use RRNodeId + rr_edges_to_create.emplace_back(size_t(inode), size_t(to_node), delayless_switch); - VTR_ASSERT(inode >= 0); - L_rr_node[inode].set_cost_index(IPIN_COST_INDEX); - L_rr_node[inode].set_type(IPIN); + L_rr_node.set_node_cost_index(inode, IPIN_COST_INDEX); + L_rr_node.set_node_type(inode, IPIN); } } else { VTR_ASSERT(class_inf[iclass].type == DRIVER); //Initialize the output pin // Note that we leave it's out-going edges unconnected (they will be hooked up to global routing later) - inode = get_rr_node_index(L_rr_node_indices, i + width_offset, j + height_offset, OPIN, ipin, side); + inode = rr_graph_builder.node_lookup().find_node(i + width_offset, j + height_offset, OPIN, ipin, side); /* Output pins may not exist on some sides, we may not always find one */ - if (OPEN != inode) { + if (inode) { //Initially left unconnected - VTR_ASSERT(inode >= 0); - L_rr_node[inode].set_cost_index(OPIN_COST_INDEX); - L_rr_node[inode].set_type(OPIN); + L_rr_node.set_node_cost_index(inode, OPIN_COST_INDEX); + L_rr_node.set_node_type(inode, OPIN); } } /* Common to both DRIVERs and RECEIVERs */ - if (OPEN != inode) { - L_rr_node[inode].set_capacity(1); + if (inode) { + L_rr_node.set_node_capacity(inode, 1); float R = 0.; float C = 0.; - L_rr_node[inode].set_rc_index(find_create_rr_rc_data(R, C)); - L_rr_node[inode].set_ptc_num(ipin); + L_rr_node.set_node_rc_index(inode, find_create_rr_rc_data(R, C)); + L_rr_node.set_node_ptc_num(inode, ipin); //Note that we store the grid tile location and side where the pin is located, //which greatly simplifies the drawing code //For those pins located on multiple sides, we save the rr node index //for the pin on all sides at which it exists //As such, multipler driver problem can be avoided. - L_rr_node[inode].set_coordinates(i + width_offset, j + height_offset, i + width_offset, j + height_offset); - L_rr_node[inode].add_side(side); + L_rr_node.set_node_coordinates(inode, i + width_offset, j + height_offset, i + width_offset, j + height_offset); + L_rr_node.add_node_side(inode, side); // Sanity check - VTR_ASSERT(L_rr_node[inode].is_node_on_specific_side(side)); - VTR_ASSERT(type->pinloc[width_offset][height_offset][side][L_rr_node[inode].pin_num()]); + VTR_ASSERT(L_rr_node.is_node_on_specific_side(inode, side)); + VTR_ASSERT(type->pinloc[width_offset][height_offset][side][L_rr_node.node_pin_num(inode)]); } } } @@ -1517,7 +1531,8 @@ static void build_rr_sinks_sources(const int i, /* Allocates/loads edges for nodes belonging to specified channel segment and initializes * node properties such as cost, occupancy and capacity */ -static void build_rr_chan(const int x_coord, +static void build_rr_chan(RRGraphBuilder& rr_graph_builder, + const int x_coord, const int y_coord, const t_rr_type chan_type, const t_track_to_pin_lookup& track_to_pin_lookup, @@ -1531,7 +1546,6 @@ static void build_rr_chan(const int x_coord, const int Fs_per_side, const t_chan_details& chan_details_x, const t_chan_details& chan_details_y, - const t_rr_node_indices& L_rr_node_indices, t_rr_edge_info_set& rr_edges_to_create, t_rr_graph_storage& L_rr_node, const int wire_to_ipin_switch, @@ -1589,16 +1603,16 @@ static void build_rr_chan(const int x_coord, from_seg_details = chan_details_x[start][y_coord].data(); } - int node = get_rr_node_index(L_rr_node_indices, x_coord, y_coord, chan_type, track); + RRNodeId node = rr_graph_builder.node_lookup().find_node(x_coord, y_coord, chan_type, track); - if (node == OPEN) { + if (!node) { continue; } /* Add the edges from this track to all it's connected pins into the list */ int num_edges = 0; - num_edges += get_track_to_pins(start, chan_coord, track, tracks_per_chan, node, rr_edges_to_create, - L_rr_node_indices, track_to_pin_lookup, seg_details, chan_type, seg_dimension, + num_edges += get_track_to_pins(rr_graph_builder, start, chan_coord, track, tracks_per_chan, node, rr_edges_to_create, + track_to_pin_lookup, seg_details, chan_type, seg_dimension, wire_to_ipin_switch, directionality); /* get edges going from the current track into channel segments which are perpendicular to it */ @@ -1611,12 +1625,11 @@ static void build_rr_chan(const int x_coord, to_seg_details = chan_details_x[x_coord][start].data(); } if (to_seg_details->length() > 0) { - num_edges += get_track_to_tracks(chan_coord, start, track, chan_type, chan_coord, + num_edges += get_track_to_tracks(rr_graph_builder, chan_coord, start, track, chan_type, chan_coord, opposite_chan_type, seg_dimension, max_chan_width, grid, Fs_per_side, sblock_pattern, node, rr_edges_to_create, from_seg_details, to_seg_details, opposite_chan_details, directionality, - L_rr_node_indices, switch_block_conn, sb_conn_map, scratchpad); } } @@ -1629,12 +1642,11 @@ static void build_rr_chan(const int x_coord, to_seg_details = chan_details_x[x_coord + 1][start].data(); } if (to_seg_details->length() > 0) { - num_edges += get_track_to_tracks(chan_coord, start, track, chan_type, chan_coord + 1, + num_edges += get_track_to_tracks(rr_graph_builder, chan_coord, start, track, chan_type, chan_coord + 1, opposite_chan_type, seg_dimension, max_chan_width, grid, Fs_per_side, sblock_pattern, node, rr_edges_to_create, from_seg_details, to_seg_details, opposite_chan_details, directionality, - L_rr_node_indices, switch_block_conn, sb_conn_map, scratchpad); } } @@ -1659,36 +1671,35 @@ static void build_rr_chan(const int x_coord, to_seg_details = chan_details_y[x_coord][target_seg].data(); } if (to_seg_details->length() > 0) { - num_edges += get_track_to_tracks(chan_coord, start, track, chan_type, target_seg, + num_edges += get_track_to_tracks(rr_graph_builder, chan_coord, start, track, chan_type, target_seg, chan_type, seg_dimension, max_chan_width, grid, Fs_per_side, sblock_pattern, node, rr_edges_to_create, from_seg_details, to_seg_details, from_chan_details, directionality, - L_rr_node_indices, switch_block_conn, sb_conn_map, scratchpad); } } } /* Edge arrays have now been built up. Do everything else. */ - L_rr_node[node].set_cost_index(cost_index_offset + seg_details[track].index()); - L_rr_node[node].set_capacity(1); /* GLOBAL routing handled elsewhere */ + L_rr_node.set_node_cost_index(node, cost_index_offset + seg_details[track].index()); + L_rr_node.set_node_capacity(node, 1); /* GLOBAL routing handled elsewhere */ if (chan_type == CHANX) { - L_rr_node[node].set_coordinates(start, y_coord, end, y_coord); + L_rr_node.set_node_coordinates(node, start, y_coord, end, y_coord); } else { VTR_ASSERT(chan_type == CHANY); - L_rr_node[node].set_coordinates(x_coord, start, x_coord, end); + L_rr_node.set_node_coordinates(node, x_coord, start, x_coord, end); } int length = end - start + 1; float R = length * seg_details[track].Rmetal(); float C = length * seg_details[track].Cmetal(); - L_rr_node[node].set_rc_index(find_create_rr_rc_data(R, C)); + L_rr_node.set_node_rc_index(node, find_create_rr_rc_data(R, C)); - L_rr_node[node].set_ptc_num(track); - L_rr_node[node].set_type(chan_type); - L_rr_node[node].set_direction(seg_details[track].direction()); + L_rr_node.set_node_ptc_num(node, track); + L_rr_node.set_node_type(node, chan_type); + L_rr_node.set_node_direction(node, seg_details[track].direction()); } } @@ -2489,7 +2500,27 @@ std::string describe_rr_node(int inode) { return msg; } -static void build_unidir_rr_opins(const int i, const int j, const e_side side, const DeviceGrid& grid, const std::vector>& Fc_out, const int max_chan_width, const t_chan_details& chan_details_x, const t_chan_details& chan_details_y, vtr::NdMatrix& Fc_xofs, vtr::NdMatrix& Fc_yofs, t_rr_edge_info_set& rr_edges_to_create, bool* Fc_clipped, const t_rr_node_indices& L_rr_node_indices, const t_rr_graph_storage& rr_nodes, const t_direct_inf* directs, const int num_directs, const t_clb_to_clb_directs* clb_to_clb_directs, const int num_seg_types, t_opin_connections_scratchpad* scratchpad) { + +static void build_unidir_rr_opins(RRGraphBuilder& rr_graph_builder, + const int i, + const int j, + const e_side side, + const DeviceGrid& grid, + const std::vector>& Fc_out, + const int max_chan_width, + const t_chan_details& chan_details_x, + const t_chan_details& chan_details_y, + vtr::NdMatrix& Fc_xofs, + vtr::NdMatrix& Fc_yofs, + t_rr_edge_info_set& rr_edges_to_create, + bool* Fc_clipped, + const t_rr_node_indices& L_rr_node_indices, + const t_rr_graph_storage& rr_nodes, + const t_direct_inf* directs, + const int num_directs, + const t_clb_to_clb_directs* clb_to_clb_directs, + const int num_seg_types, + t_opin_connections_scratchpad* scratchpad) { /* * This routine adds the edges from opins to channels at the specified * grid location (i,j) and grid tile side @@ -2512,8 +2543,8 @@ static void build_unidir_rr_opins(const int i, const int j, const e_side side, c continue; } - int opin_node_index = get_rr_node_index(L_rr_node_indices, i, j, OPIN, pin_index, side); - if (opin_node_index < 0) continue; //No valid from node + RRNodeId opin_node_index = rr_graph_builder.node_lookup().find_node(i, j, OPIN, pin_index, side); + if (!opin_node_index) continue; //No valid from node for (int iseg = 0; iseg < num_seg_types; iseg++) { /* get Fc for this segment type */ @@ -2561,19 +2592,19 @@ static void build_unidir_rr_opins(const int i, const int j, const e_side side, c /* Get the list of opin to mux connections for that chan seg. */ bool clipped; - get_unidir_opin_connections(chan, seg, + get_unidir_opin_connections(rr_graph_builder, chan, seg, seg_type_Fc, iseg, chan_type, seg_details, opin_node_index, rr_edges_to_create, Fc_ofs, max_len, max_chan_width, - L_rr_node_indices, &clipped, scratchpad); + &clipped, scratchpad); if (clipped) { *Fc_clipped = true; } } /* Add in direct connections */ - get_opin_direct_connections(i, j, side, pin_index, opin_node_index, rr_edges_to_create, L_rr_node_indices, rr_nodes, + get_opin_direct_connections(rr_graph_builder, i, j, side, pin_index, opin_node_index, rr_edges_to_create, L_rr_node_indices, rr_nodes, directs, num_directs, clb_to_clb_directs, scratchpad); } } @@ -2688,11 +2719,12 @@ static t_clb_to_clb_directs* alloc_and_load_clb_to_clb_directs(const t_direct_in * * The current opin is located at (x,y) along the specified side */ -static int get_opin_direct_connections(int x, +static int get_opin_direct_connections(RRGraphBuilder& rr_graph_builder, + int x, int y, e_side side, int opin, - int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, const t_rr_node_indices& L_rr_node_indices, const t_rr_graph_storage& rr_nodes, @@ -2779,10 +2811,9 @@ static int get_opin_direct_connections(int x, if (directs[i].to_side != NUM_SIDES) { //Explicit side specified, only create if pin exists on that side - int inode = get_rr_node_index(L_rr_node_indices, x + directs[i].x_offset, y + directs[i].y_offset, - IPIN, ipin, directs[i].to_side); - if (inode != OPEN) { - inodes.push_back(inode); + RRNodeId inode = rr_graph_builder.node_lookup().find_node(x + directs[i].x_offset, y + directs[i].y_offset, IPIN, ipin, directs[i].to_side); + if (inode) { + inodes.push_back(size_t(inode)); } } else { //No side specified, get all candidates @@ -2795,9 +2826,9 @@ static int get_opin_direct_connections(int x, //target ipin. We only need to connect to one of them (since the physical pins //are logically equivalent). This also ensures the graphics look reasonable and map //back fairly directly to the architecture file in the case of pin equivalence - int inode = pick_best_direct_connect_target_rr_node(rr_nodes, from_rr_node, inodes); + RRNodeId inode = pick_best_direct_connect_target_rr_node(rr_nodes, from_rr_node, inodes); - rr_edges_to_create.emplace_back(from_rr_node, inode, clb_to_clb_directs[i].switch_index); + rr_edges_to_create.emplace_back(size_t(from_rr_node), size_t(inode), clb_to_clb_directs[i].switch_index); ++num_pins; } } @@ -2909,9 +2940,9 @@ static std::vector alloc_and_load_perturb_opins(const t_physical_tile_type return perturb_opins; } -static int pick_best_direct_connect_target_rr_node(const t_rr_graph_storage& rr_nodes, - int from_rr, - const std::vector& candidate_rr_nodes) { +static RRNodeId pick_best_direct_connect_target_rr_node(const t_rr_graph_storage& rr_nodes, + RRNodeId from_rr, + const std::vector& candidate_rr_nodes) { //With physically equivalent pins there may be multiple candidate rr nodes (which are equivalent) //to connect the direct edge to. //As a result it does not matter (from a correctness standpoint) which is picked. @@ -2923,21 +2954,21 @@ static int pick_best_direct_connect_target_rr_node(const t_rr_graph_storage& rr_ auto& device_ctx = g_vpr_ctx.device(); const auto& rr_graph = device_ctx.rr_graph; - VTR_ASSERT(rr_graph.node_type(RRNodeId(from_rr)) == OPIN); + VTR_ASSERT(rr_graph.node_type(from_rr) == OPIN); float best_dist = std::numeric_limits::infinity(); int best_rr = OPEN; for (const e_side& from_side : SIDES) { /* Bypass those side where the node does not appear */ - if (!rr_nodes[from_rr].is_node_on_specific_side(from_side)) { + if (!rr_nodes.is_node_on_specific_side(from_rr, from_side)) { continue; } for (int to_rr : candidate_rr_nodes) { VTR_ASSERT(rr_graph.node_type(RRNodeId(to_rr)) == IPIN); - float to_dist = std::abs(rr_nodes[from_rr].xlow() - rr_nodes[to_rr].xlow()) - + std::abs(rr_nodes[from_rr].ylow() - rr_nodes[to_rr].ylow()); + float to_dist = std::abs(rr_nodes.node_xlow(from_rr) - rr_nodes[to_rr].xlow()) + + std::abs(rr_nodes.node_ylow(from_rr) - rr_nodes[to_rr].ylow()); for (const e_side& to_side : SIDES) { /* Bypass those side where the node does not appear */ @@ -2973,7 +3004,7 @@ static int pick_best_direct_connect_target_rr_node(const t_rr_graph_storage& rr_ VTR_ASSERT(best_rr != OPEN); - return best_rr; + return RRNodeId(best_rr); } //Collects the sets of connected non-configurable edges in the RR graph diff --git a/vpr/src/route/rr_graph2.cpp b/vpr/src/route/rr_graph2.cpp index eb09301f97a..f27bf1e7cd8 100644 --- a/vpr/src/route/rr_graph2.cpp +++ b/vpr/src/route/rr_graph2.cpp @@ -39,8 +39,8 @@ static void load_block_rr_indices(RRGraphBuilder& rr_graph_builder, const DeviceGrid& grid, int* index); -static int get_bidir_track_to_chan_seg(const std::vector conn_tracks, - const t_rr_node_indices& L_rr_node_indices, +static int get_bidir_track_to_chan_seg(RRGraphBuilder& rr_graph_builder, + const std::vector conn_tracks, const int to_chan, const int to_seg, const int to_sb, @@ -50,10 +50,11 @@ static int get_bidir_track_to_chan_seg(const std::vector conn_tracks, const int from_switch, const int switch_override, const enum e_directionality directionality, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create); -static int get_unidir_track_to_chan_seg(const int from_track, +static int get_unidir_track_to_chan_seg(RRGraphBuilder& rr_graph_builder, + const int from_track, const int to_chan, const int to_seg, const int to_sb, @@ -65,23 +66,22 @@ static int get_unidir_track_to_chan_seg(const int from_track, const int Fs_per_side, t_sblock_pattern& sblock_pattern, const int switch_override, - const t_rr_node_indices& L_rr_node_indices, const t_chan_seg_details* seg_details, bool* Fs_clipped, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, t_opin_connections_scratchpad* scratchpad); -static int get_track_to_chan_seg(const int from_track, +static int get_track_to_chan_seg(RRGraphBuilder& rr_graph_builder, + const int from_track, const int to_chan, const int to_seg, const t_rr_type to_chan_type, const e_side from_side, const e_side to_side, const int swtich_override, - const t_rr_node_indices& L_rr_node_indices, t_sb_connection_map* sb_conn_map, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create); static int vpr_to_phy_track(const int itrack, @@ -570,17 +570,17 @@ int get_seg_end(const t_chan_seg_details* seg_details, const int itrack, const i /* Returns the number of tracks to which clb opin #ipin at (i,j) connects. * * Also stores the nodes to which this pin connects in rr_edges_to_create */ -int get_bidir_opin_connections(const int i, +int get_bidir_opin_connections(RRGraphBuilder& rr_graph_builder, + const int i, const int j, const int ipin, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, const t_pin_to_track_lookup& opin_to_track_map, - const t_rr_node_indices& L_rr_node_indices, const t_chan_details& chan_details_x, const t_chan_details& chan_details_y) { int num_conn, tr_i, tr_j, chan, seg; - int to_switch, to_node; + int to_switch; int is_connected_track; t_physical_tile_type_ptr type; t_rr_type to_type; @@ -639,13 +639,13 @@ int get_bidir_opin_connections(const int i, /* Only connect to wire if there is a CB */ if (is_cblock(chan, seg, to_track, seg_details)) { to_switch = seg_details[to_track].arch_wire_switch(); - to_node = get_rr_node_index(L_rr_node_indices, tr_i, tr_j, to_type, to_track); + RRNodeId to_node = rr_graph_builder.node_lookup().find_node(tr_i, tr_j, to_type, to_track); - if (to_node == OPEN) { + if (!to_node) { continue; } - rr_edges_to_create.emplace_back(from_rr_node, to_node, to_switch); + rr_edges_to_create.emplace_back(size_t(from_rr_node), size_t(to_node), to_switch); ++num_conn; } } @@ -654,25 +654,24 @@ int get_bidir_opin_connections(const int i, return num_conn; } -int get_unidir_opin_connections(const int chan, +int get_unidir_opin_connections(RRGraphBuilder& rr_graph_builder, + const int chan, const int seg, int Fc, const int seg_type_index, const t_rr_type chan_type, const t_chan_seg_details* seg_details, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, vtr::NdMatrix& Fc_ofs, const int max_len, const int max_chan_width, - const t_rr_node_indices& L_rr_node_indices, bool* Fc_clipped, t_opin_connections_scratchpad* scratchpad) { /* Gets a linked list of Fc nodes of specified seg_type_index to connect * to in given chan seg. Fc_ofs is used for the opin staggering pattern. */ int num_inc_muxes, num_dec_muxes, iconn; - int inc_inode_index, dec_inode_index; int inc_mux, dec_mux; int inc_track, dec_track; int x, y; @@ -716,18 +715,18 @@ int get_unidir_opin_connections(const int chan, dec_track = dec_muxes[dec_mux]; /* Figure the inodes of those muxes */ - inc_inode_index = get_rr_node_index(L_rr_node_indices, x, y, chan_type, inc_track); - dec_inode_index = get_rr_node_index(L_rr_node_indices, x, y, chan_type, dec_track); + RRNodeId inc_inode_index = rr_graph_builder.node_lookup().find_node(x, y, chan_type, inc_track); + RRNodeId dec_inode_index = rr_graph_builder.node_lookup().find_node(x, y, chan_type, dec_track); - if (inc_inode_index == OPEN || dec_inode_index == OPEN) { + if (!inc_inode_index || !dec_inode_index) { continue; } /* Add to the list. */ - rr_edges_to_create.emplace_back(from_rr_node, inc_inode_index, seg_details[inc_track].arch_opin_switch()); + rr_edges_to_create.emplace_back(size_t(from_rr_node), size_t(inc_inode_index), seg_details[inc_track].arch_opin_switch()); ++num_edges; - rr_edges_to_create.emplace_back(from_rr_node, dec_inode_index, seg_details[dec_track].arch_opin_switch()); + rr_edges_to_create.emplace_back(size_t(from_rr_node), size_t(dec_inode_index), seg_details[dec_track].arch_opin_switch()); ++num_edges; } @@ -1562,13 +1561,13 @@ int find_average_rr_node_index(int device_width, return (inode); } -int get_track_to_pins(int seg, +int get_track_to_pins(RRGraphBuilder& rr_graph_builder, + int seg, int chan, int track, int tracks_per_chan, - int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, - const t_rr_node_indices& L_rr_node_indices, const t_track_to_pin_lookup& track_to_pin_lookup, const t_chan_seg_details* seg_details, enum e_rr_type chan_type, @@ -1626,9 +1625,9 @@ int get_track_to_pins(int seg, /* Check there is a connection and Fc map isn't wrong */ /*int to_node = get_rr_node_index(L_rr_node_indices, x + width_offset, y + height_offset, IPIN, ipin, side);*/ - int to_node = get_rr_node_index(L_rr_node_indices, x, y, IPIN, ipin, side); - if (to_node >= 0) { - rr_edges_to_create.emplace_back(from_rr_node, to_node, wire_to_ipin_switch); + RRNodeId to_node = rr_graph_builder.node_lookup().find_node(x, y, IPIN, ipin, side); + if (to_node) { + rr_edges_to_create.emplace_back(size_t(from_rr_node), size_t(to_node), wire_to_ipin_switch); ++num_conn; } } @@ -1656,7 +1655,8 @@ int get_track_to_pins(int seg, * switches are marked as being of the types of the larger (lower R) pass * transistor. */ -int get_track_to_tracks(const int from_chan, +int get_track_to_tracks(RRGraphBuilder& rr_graph_builder, + const int from_chan, const int from_seg, const int from_track, const t_rr_type from_type, @@ -1667,13 +1667,12 @@ int get_track_to_tracks(const int from_chan, const DeviceGrid& grid, const int Fs_per_side, t_sblock_pattern& sblock_pattern, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, const t_chan_seg_details* from_seg_details, const t_chan_seg_details* to_seg_details, const t_chan_details& to_chan_details, const enum e_directionality directionality, - const t_rr_node_indices& L_rr_node_indices, const vtr::NdMatrix, 3>& switch_block_conn, t_sb_connection_map* sb_conn_map, t_opin_connections_scratchpad* scratchpad) { @@ -1804,10 +1803,9 @@ int get_track_to_tracks(const int from_chan, if (sb_seg < end_sb_seg) { if (custom_switch_block) { if (DEC_DIRECTION == from_seg_details[from_track].direction() || BI_DIRECTIONAL == directionality) { - num_conn += get_track_to_chan_seg(from_track, to_chan, to_seg, + num_conn += get_track_to_chan_seg(rr_graph_builder, from_track, to_chan, to_seg, to_type, from_side_a, to_side, switch_override, - L_rr_node_indices, sb_conn_map, from_rr_node, rr_edges_to_create); } } else { @@ -1815,8 +1813,8 @@ int get_track_to_tracks(const int from_chan, /* For bidir, the target segment might have an unbuffered (bidir pass transistor) * switchbox, so we follow through regardless of whether the current segment has an SB */ conn_tracks = switch_block_conn[from_side_a][to_side][from_track]; - num_conn += get_bidir_track_to_chan_seg(conn_tracks, - L_rr_node_indices, to_chan, to_seg, to_sb, to_type, + num_conn += get_bidir_track_to_chan_seg(rr_graph_builder, conn_tracks, + to_chan, to_seg, to_sb, to_type, to_seg_details, from_is_sblock, from_switch, switch_override, directionality, from_rr_node, rr_edges_to_create); @@ -1826,12 +1824,12 @@ int get_track_to_tracks(const int from_chan, /* Also, we are connecting from the top or right of SB so it * makes the most sense to only get there from DEC_DIRECTION wires. */ if ((from_is_sblock) && (DEC_DIRECTION == from_seg_details[from_track].direction())) { - num_conn += get_unidir_track_to_chan_seg(from_track, to_chan, + num_conn += get_unidir_track_to_chan_seg(rr_graph_builder, from_track, to_chan, to_seg, to_sb, to_type, max_chan_width, grid, from_side_a, to_side, Fs_per_side, sblock_pattern, switch_override, - L_rr_node_indices, to_seg_details, + to_seg_details, &Fs_clipped, from_rr_node, rr_edges_to_create, scratchpad); } } @@ -1843,10 +1841,9 @@ int get_track_to_tracks(const int from_chan, if (sb_seg > start_sb_seg) { if (custom_switch_block) { if (INC_DIRECTION == from_seg_details[from_track].direction() || BI_DIRECTIONAL == directionality) { - num_conn += get_track_to_chan_seg(from_track, to_chan, to_seg, + num_conn += get_track_to_chan_seg(rr_graph_builder, from_track, to_chan, to_seg, to_type, from_side_b, to_side, switch_override, - L_rr_node_indices, sb_conn_map, from_rr_node, rr_edges_to_create); } } else { @@ -1854,8 +1851,8 @@ int get_track_to_tracks(const int from_chan, /* For bidir, the target segment might have an unbuffered (bidir pass transistor) * switchbox, so we follow through regardless of whether the current segment has an SB */ conn_tracks = switch_block_conn[from_side_b][to_side][from_track]; - num_conn += get_bidir_track_to_chan_seg(conn_tracks, - L_rr_node_indices, to_chan, to_seg, to_sb, to_type, + num_conn += get_bidir_track_to_chan_seg(rr_graph_builder, conn_tracks, + to_chan, to_seg, to_sb, to_type, to_seg_details, from_is_sblock, from_switch, switch_override, directionality, from_rr_node, rr_edges_to_create); @@ -1866,12 +1863,12 @@ int get_track_to_tracks(const int from_chan, * makes the most sense to only get there from INC_DIRECTION wires. */ if ((from_is_sblock) && (INC_DIRECTION == from_seg_details[from_track].direction())) { - num_conn += get_unidir_track_to_chan_seg(from_track, to_chan, + num_conn += get_unidir_track_to_chan_seg(rr_graph_builder, from_track, to_chan, to_seg, to_sb, to_type, max_chan_width, grid, from_side_b, to_side, Fs_per_side, sblock_pattern, switch_override, - L_rr_node_indices, to_seg_details, + to_seg_details, &Fs_clipped, from_rr_node, rr_edges_to_create, scratchpad); } } @@ -1882,8 +1879,8 @@ int get_track_to_tracks(const int from_chan, return num_conn; } -static int get_bidir_track_to_chan_seg(const std::vector conn_tracks, - const t_rr_node_indices& L_rr_node_indices, +static int get_bidir_track_to_chan_seg(RRGraphBuilder& rr_graph_builder, + const std::vector conn_tracks, const int to_chan, const int to_seg, const int to_sb, @@ -1893,10 +1890,10 @@ static int get_bidir_track_to_chan_seg(const std::vector conn_tracks, const int from_switch, const int switch_override, const enum e_directionality directionality, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create) { unsigned iconn; - int to_track, to_node, to_switch, num_conn, to_x, to_y, i; + int to_track, to_switch, num_conn, to_x, to_y, i; bool to_is_sblock; short switch_types[2]; @@ -1914,9 +1911,9 @@ static int get_bidir_track_to_chan_seg(const std::vector conn_tracks, num_conn = 0; for (iconn = 0; iconn < conn_tracks.size(); ++iconn) { to_track = conn_tracks[iconn]; - to_node = get_rr_node_index(L_rr_node_indices, to_x, to_y, to_type, to_track); + RRNodeId to_node = rr_graph_builder.node_lookup().find_node(to_x, to_y, to_type, to_track); - if (to_node == OPEN) { + if (!to_node) { continue; } @@ -1937,7 +1934,7 @@ static int get_bidir_track_to_chan_seg(const std::vector conn_tracks, } /* Add the edge to the list */ - rr_edges_to_create.emplace_back(from_rr_node, to_node, switch_types[i]); + rr_edges_to_create.emplace_back(size_t(from_rr_node), size_t(to_node), switch_types[i]); ++num_conn; } } @@ -1950,16 +1947,16 @@ static int get_bidir_track_to_chan_seg(const std::vector conn_tracks, * edges added . * See route/build_switchblocks.c for a detailed description of how the switch block * connection map sb_conn_map is generated. */ -static int get_track_to_chan_seg(const int from_wire, +static int get_track_to_chan_seg(RRGraphBuilder& rr_graph_builder, + const int from_wire, const int to_chan, const int to_seg, const t_rr_type to_chan_type, const e_side from_side, const e_side to_side, const int switch_override, - const t_rr_node_indices& L_rr_node_indices, t_sb_connection_map* sb_conn_map, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create) { int edge_count = 0; int to_x, to_y; @@ -1993,9 +1990,9 @@ static int get_track_to_chan_seg(const int from_wire, if (conn_vector.at(iconn).from_wire != from_wire) continue; int to_wire = conn_vector.at(iconn).to_wire; - int to_node = get_rr_node_index(L_rr_node_indices, to_x, to_y, to_chan_type, to_wire); + RRNodeId to_node = rr_graph_builder.node_lookup().find_node(to_x, to_y, to_chan_type, to_wire); - if (to_node == OPEN) { + if (!to_node) { continue; } @@ -2007,14 +2004,14 @@ static int get_track_to_chan_seg(const int from_wire, src_switch = switch_override; } - rr_edges_to_create.emplace_back(from_rr_node, to_node, src_switch); + rr_edges_to_create.emplace_back(size_t(from_rr_node), size_t(to_node), src_switch); ++edge_count; auto& device_ctx = g_vpr_ctx.device(); if (device_ctx.arch_switch_inf[src_switch].directionality() == BI_DIRECTIONAL) { //Add reverse edge since bi-directional - rr_edges_to_create.emplace_back(to_node, from_rr_node, src_switch); + rr_edges_to_create.emplace_back(size_t(to_node), size_t(from_rr_node), src_switch); ++edge_count; } } @@ -2024,7 +2021,8 @@ static int get_track_to_chan_seg(const int from_wire, return edge_count; } -static int get_unidir_track_to_chan_seg(const int from_track, +static int get_unidir_track_to_chan_seg(RRGraphBuilder& rr_graph_builder, + const int from_track, const int to_chan, const int to_seg, const int to_sb, @@ -2036,10 +2034,9 @@ static int get_unidir_track_to_chan_seg(const int from_track, const int Fs_per_side, t_sblock_pattern& sblock_pattern, const int switch_override, - const t_rr_node_indices& L_rr_node_indices, const t_chan_seg_details* seg_details, bool* Fs_clipped, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, t_opin_connections_scratchpad* scratchpad) { int num_labels = 0; @@ -2090,9 +2087,9 @@ static int get_unidir_track_to_chan_seg(const int from_track, sblock_pattern[sb_x][sb_y][from_side][to_side][from_track][j + 1] = to_track; } - int to_node = get_rr_node_index(L_rr_node_indices, to_x, to_y, to_type, to_track); + RRNodeId to_node = rr_graph_builder.node_lookup().find_node(to_x, to_y, to_type, to_track); - if (to_node == OPEN) { + if (!to_node) { continue; } @@ -2106,13 +2103,13 @@ static int get_unidir_track_to_chan_seg(const int from_track, VTR_ASSERT(iswitch != OPEN); /* Add edge to list. */ - rr_edges_to_create.emplace_back(from_rr_node, to_node, iswitch); + rr_edges_to_create.emplace_back(size_t(from_rr_node), size_t(to_node), iswitch); ++count; auto& device_ctx = g_vpr_ctx.device(); if (device_ctx.arch_switch_inf[iswitch].directionality() == BI_DIRECTIONAL) { //Add reverse edge since bi-directional - rr_edges_to_create.emplace_back(to_node, from_rr_node, iswitch); + rr_edges_to_create.emplace_back(size_t(to_node), size_t(from_rr_node), iswitch); ++count; } } diff --git a/vpr/src/route/rr_graph2.h b/vpr/src/route/rr_graph2.h index 04cbcc1c86c..9e02ea8ba44 100644 --- a/vpr/src/route/rr_graph2.h +++ b/vpr/src/route/rr_graph2.h @@ -130,38 +130,38 @@ bool is_sblock(const int chan, const t_chan_seg_details* seg_details, const enum e_directionality directionality); -int get_bidir_opin_connections(const int i, +int get_bidir_opin_connections(RRGraphBuilder& rr_graph_builder, + const int i, const int j, const int ipin, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, const t_pin_to_track_lookup& opin_to_track_map, - const t_rr_node_indices& L_rr_node_indices, const t_chan_details& chan_details_x, const t_chan_details& chan_details_y); -int get_unidir_opin_connections(const int chan, +int get_unidir_opin_connections(RRGraphBuilder& rr_graph_builder, + const int chan, const int seg, int Fc, const int seg_type_index, const t_rr_type chan_type, const t_chan_seg_details* seg_details, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, vtr::NdMatrix& Fc_ofs, const int max_len, const int max_chan_width, - const t_rr_node_indices& L_rr_node_indices, bool* Fc_clipped, t_opin_connections_scratchpad* scratchpad); -int get_track_to_pins(int seg, +int get_track_to_pins(RRGraphBuilder& rr_graph_builder, + int seg, int chan, int track, int tracks_per_chan, - int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, - const t_rr_node_indices& L_rr_node_indices, const t_track_to_pin_lookup& track_to_pin_lookup, const t_chan_seg_details* seg_details, enum e_rr_type chan_type, @@ -169,7 +169,8 @@ int get_track_to_pins(int seg, int wire_to_ipin_switch, enum e_directionality directionality); -int get_track_to_tracks(const int from_chan, +int get_track_to_tracks(RRGraphBuilder& rr_graph_builder, + const int from_chan, const int from_seg, const int from_track, const t_rr_type from_type, @@ -180,13 +181,12 @@ int get_track_to_tracks(const int from_chan, const DeviceGrid& grid, const int Fs_per_side, t_sblock_pattern& sblock_pattern, - const int from_rr_node, + RRNodeId from_rr_node, t_rr_edge_info_set& rr_edges_to_create, const t_chan_seg_details* from_seg_details, const t_chan_seg_details* to_seg_details, const t_chan_details& to_chan_details, const enum e_directionality directionality, - const t_rr_node_indices& L_rr_node_indices, const vtr::NdMatrix, 3>& switch_block_conn, t_sb_connection_map* sb_conn_map, t_opin_connections_scratchpad* scratchpad);