@@ -357,7 +357,8 @@ bool try_timing_driven_route(const t_router_opts& router_opts,
357
357
*router_lookahead,
358
358
device_ctx.rr_nodes ,
359
359
device_ctx.rr_rc_data ,
360
- device_ctx.rr_switch_inf );
360
+ device_ctx.rr_switch_inf ,
361
+ route_ctx.rr_node_route_inf );
361
362
362
363
/*
363
364
* On the first routing iteration ignore congestion to get reasonable net
@@ -1068,18 +1069,6 @@ bool timing_driven_route_net(Router& router,
1068
1069
return (true );
1069
1070
}
1070
1071
1071
- void Router::update_cheapest (t_heap* cheapest) {
1072
- auto & route_ctx = g_vpr_ctx.mutable_routing ();
1073
-
1074
- // Record final link to target
1075
- add_to_mod_list (cheapest->index , modified_rr_node_inf_);
1076
-
1077
- route_ctx.rr_node_route_inf [cheapest->index ].prev_node = cheapest->u .prev .node ;
1078
- route_ctx.rr_node_route_inf [cheapest->index ].prev_edge = cheapest->u .prev .edge ;
1079
- route_ctx.rr_node_route_inf [cheapest->index ].path_cost = cheapest->cost ;
1080
- route_ctx.rr_node_route_inf [cheapest->index ].backward_path_cost = cheapest->backward_path_cost ;
1081
- }
1082
-
1083
1072
static bool timing_driven_pre_route_to_clock_root (
1084
1073
Router& router,
1085
1074
ClusterNetId net_id,
@@ -1533,7 +1522,7 @@ std::vector<t_heap> Router::timing_driven_find_all_shortest_paths_from_route_tre
1533
1522
std::vector<t_heap> Router::timing_driven_find_all_shortest_paths_from_heap (
1534
1523
const t_conn_cost_params cost_params,
1535
1524
t_bb bounding_box) {
1536
- std::vector<t_heap> cheapest_paths (rr_nodes_. size ());
1525
+ std::vector<t_heap> cheapest_paths (rr_nodes_-> size ());
1537
1526
1538
1527
VTR_ASSERT_SAFE (heap_::is_valid ());
1539
1528
@@ -1579,12 +1568,11 @@ void Router::timing_driven_expand_cheapest(t_heap* cheapest,
1579
1568
int target_node,
1580
1569
const t_conn_cost_params cost_params,
1581
1570
t_bb bounding_box) {
1582
- auto & route_ctx = g_vpr_ctx.mutable_routing ();
1583
-
1584
1571
int inode = cheapest->index ;
1585
1572
1586
- float best_total_cost = route_ctx.rr_node_route_inf [inode].path_cost ;
1587
- float best_back_cost = route_ctx.rr_node_route_inf [inode].backward_path_cost ;
1573
+ t_rr_node_route_inf* route_inf = &rr_node_route_inf_[inode];
1574
+ float best_total_cost = route_inf->path_cost ;
1575
+ float best_back_cost = route_inf->backward_path_cost ;
1588
1576
1589
1577
float new_total_cost = cheapest->cost ;
1590
1578
float new_back_cost = cheapest->backward_path_cost ;
@@ -1605,7 +1593,7 @@ void Router::timing_driven_expand_cheapest(t_heap* cheapest,
1605
1593
VTR_LOGV_DEBUG (f_router_debug, " New back cost: %g\n " , new_back_cost);
1606
1594
VTR_LOGV_DEBUG (f_router_debug, " Setting path costs for associated node %d (from %d edge %d)\n " , cheapest->index , cheapest->u .prev .node , cheapest->u .prev .edge );
1607
1595
1608
- update_cheapest (cheapest);
1596
+ update_cheapest (cheapest, route_inf );
1609
1597
1610
1598
timing_driven_expand_neighbours (cheapest, cost_params, bounding_box,
1611
1599
target_node);
@@ -1958,22 +1946,24 @@ void Router::timing_driven_expand_neighbours(t_heap* current,
1958
1946
/* Puts all the rr_nodes adjacent to current on the heap.
1959
1947
*/
1960
1948
1961
- auto & device_ctx = g_vpr_ctx.device ();
1962
-
1963
1949
t_bb target_bb;
1964
1950
if (target_node != OPEN) {
1965
- target_bb.xmin = device_ctx. rr_nodes [target_node]. xlow ();
1966
- target_bb.ymin = device_ctx. rr_nodes [target_node]. ylow ();
1967
- target_bb.xmax = device_ctx. rr_nodes [target_node]. xhigh ();
1968
- target_bb.ymax = device_ctx. rr_nodes [target_node]. yhigh ();
1951
+ target_bb.xmin = rr_nodes_-> xlow (RRNodeId (target_node) );
1952
+ target_bb.ymin = rr_nodes_-> ylow (RRNodeId (target_node) );
1953
+ target_bb.xmax = rr_nodes_-> xhigh (RRNodeId (target_node) );
1954
+ target_bb.ymax = rr_nodes_-> yhigh (RRNodeId (target_node) );
1969
1955
}
1970
1956
1971
1957
// For each node associated with the current heap element, expand all of it's neighbors
1972
- int num_edges = device_ctx.rr_nodes [current->index ].num_edges ();
1958
+ int from_node_int = current->index ;
1959
+ RRNodeId from_node (from_node_int);
1960
+ int num_edges = rr_nodes_->num_edges (from_node);
1973
1961
for (int iconn = 0 ; iconn < num_edges; iconn++) {
1974
- int to_node = device_ctx. rr_nodes [current-> index ]. edge_sink_node (iconn);
1962
+ RRNodeId to_node = rr_nodes_-> edge_sink_node (from_node, iconn);
1975
1963
timing_driven_expand_neighbour (current,
1976
- current->index , iconn, to_node,
1964
+ from_node_int,
1965
+ iconn,
1966
+ size_t (to_node),
1977
1967
cost_params,
1978
1968
bounding_box,
1979
1969
target_node,
@@ -1987,17 +1977,16 @@ void Router::timing_driven_expand_neighbours(t_heap* current,
1987
1977
void Router::timing_driven_expand_neighbour (t_heap* current,
1988
1978
const int from_node,
1989
1979
const t_edge_size from_edge,
1990
- const int to_node ,
1980
+ const int to_node_int ,
1991
1981
const t_conn_cost_params cost_params,
1992
1982
const t_bb bounding_box,
1993
1983
int target_node,
1994
1984
const t_bb target_bb) {
1995
- auto & device_ctx = g_vpr_ctx.device ();
1996
-
1997
- int to_xlow = device_ctx.rr_nodes [to_node].xlow ();
1998
- int to_ylow = device_ctx.rr_nodes [to_node].ylow ();
1999
- int to_xhigh = device_ctx.rr_nodes [to_node].xhigh ();
2000
- int to_yhigh = device_ctx.rr_nodes [to_node].yhigh ();
1985
+ RRNodeId to_node (to_node_int);
1986
+ int to_xlow = rr_nodes_->xlow (to_node);
1987
+ int to_ylow = rr_nodes_->ylow (to_node);
1988
+ int to_xhigh = rr_nodes_->xhigh (to_node);
1989
+ int to_yhigh = rr_nodes_->yhigh (to_node);
2001
1990
2002
1991
if (to_xhigh < bounding_box.xmin // Strictly left of BB left-edge
2003
1992
|| to_xlow > bounding_box.xmax // Strictly right of BB right-edge
@@ -2007,7 +1996,7 @@ void Router::timing_driven_expand_neighbour(t_heap* current,
2007
1996
" Pruned expansion of node %d edge %d -> %d"
2008
1997
" (to node location %d,%dx%d,%d outside of expanded"
2009
1998
" net bounding box %d,%dx%d,%d)\n " ,
2010
- from_node, from_edge, to_node ,
1999
+ from_node, from_edge, to_node_int ,
2011
2000
to_xlow, to_ylow, to_xhigh, to_yhigh,
2012
2001
bounding_box.xmin , bounding_box.ymin , bounding_box.xmax , bounding_box.ymax );
2013
2002
return ; /* Node is outside (expanded) bounding box. */
@@ -2018,7 +2007,7 @@ void Router::timing_driven_expand_neighbour(t_heap* current,
2018
2007
* more promising routes, but makes route-through (via CLBs) impossible. *
2019
2008
* Change this if you want to investigate route-throughs. */
2020
2009
if (target_node != OPEN) {
2021
- t_rr_type to_type = device_ctx. rr_nodes [to_node]. type ( );
2010
+ t_rr_type to_type = rr_nodes_-> node_type (to_node );
2022
2011
if (to_type == IPIN) {
2023
2012
// Check if this IPIN leads to the target block
2024
2013
// IPIN's of the target block should be contained within it's bounding box
@@ -2030,7 +2019,7 @@ void Router::timing_driven_expand_neighbour(t_heap* current,
2030
2019
" Pruned expansion of node %d edge %d -> %d"
2031
2020
" (to node is IPIN at %d,%dx%d,%d which does not"
2032
2021
" lead to target block %d,%dx%d,%d)\n " ,
2033
- from_node, from_edge, to_node ,
2022
+ from_node, from_edge, to_node_int ,
2034
2023
to_xlow, to_ylow, to_xhigh, to_yhigh,
2035
2024
target_bb.xmin , target_bb.ymin , target_bb.xmax , target_bb.ymax );
2036
2025
return ;
@@ -2039,12 +2028,12 @@ void Router::timing_driven_expand_neighbour(t_heap* current,
2039
2028
}
2040
2029
2041
2030
VTR_LOGV_DEBUG (f_router_debug, " Expanding node %d edge %d -> %d\n " ,
2042
- from_node, from_edge, to_node );
2031
+ from_node, from_edge, to_node_int );
2043
2032
2044
2033
timing_driven_add_to_heap (cost_params,
2045
2034
current,
2046
2035
from_node,
2047
- to_node ,
2036
+ to_node_int ,
2048
2037
from_edge,
2049
2038
target_node);
2050
2039
}
@@ -2067,10 +2056,8 @@ void Router::timing_driven_add_to_heap(const t_conn_cost_params cost_params,
2067
2056
timing_driven_expand_node (cost_params,
2068
2057
next, from_node, to_node, iconn, target_node);
2069
2058
2070
- auto & route_ctx = g_vpr_ctx.routing ();
2071
-
2072
- float best_total_cost = route_ctx.rr_node_route_inf [to_node].path_cost ;
2073
- float best_back_cost = route_ctx.rr_node_route_inf [to_node].backward_path_cost ;
2059
+ float best_total_cost = rr_node_route_inf_[to_node].path_cost ;
2060
+ float best_back_cost = rr_node_route_inf_[to_node].backward_path_cost ;
2074
2061
2075
2062
float new_total_cost = next->cost ;
2076
2063
float new_back_cost = next->backward_path_cost ;
@@ -2126,20 +2113,20 @@ void Router::evaluate_timing_driven_node_costs(t_heap* to,
2126
2113
*/
2127
2114
2128
2115
// Info for the switch connecting from_node to_node
2129
- int iswitch = rr_nodes_[from_node]. edge_switch (iconn);
2116
+ int iswitch = rr_nodes_-> edge_switch (RRNodeId (from_node), iconn);
2130
2117
bool switch_buffered = rr_switch_inf_[iswitch].buffered ();
2131
2118
bool reached_configurably = rr_switch_inf_[iswitch].configurable ();
2132
2119
float switch_R = rr_switch_inf_[iswitch].R ;
2133
2120
float switch_Tdel = rr_switch_inf_[iswitch].Tdel ;
2134
2121
float switch_Cinternal = rr_switch_inf_[iswitch].Cinternal ;
2135
2122
2136
2123
// To node info
2137
- auto rc_index = rr_nodes_[to_node]. rc_index ( );
2124
+ auto rc_index = rr_nodes_-> node_rc_index ( RRNodeId (to_node) );
2138
2125
float node_C = rr_rc_data_[rc_index].C ;
2139
2126
float node_R = rr_rc_data_[rc_index].R ;
2140
2127
2141
2128
// From node info
2142
- float from_node_R = rr_rc_data_[rr_nodes_[from_node]. rc_index ( )].R ;
2129
+ float from_node_R = rr_rc_data_[rr_nodes_-> node_rc_index ( RRNodeId (from_node) )].R ;
2143
2130
2144
2131
// Update R_upstream
2145
2132
if (switch_buffered) {
@@ -2191,8 +2178,8 @@ void Router::evaluate_timing_driven_node_costs(t_heap* to,
2191
2178
to->backward_path_cost += cost_params.criticality * Tdel; // Delay cost
2192
2179
2193
2180
if (cost_params.bend_cost != 0 .) {
2194
- t_rr_type from_type = rr_nodes_[from_node]. type ( );
2195
- t_rr_type to_type = rr_nodes_[to_node]. type ( );
2181
+ t_rr_type from_type = rr_nodes_-> node_type ( RRNodeId (from_node) );
2182
+ t_rr_type to_type = rr_nodes_-> node_type ( RRNodeId (to_node) );
2196
2183
if ((from_type == CHANX && to_type == CHANY) || (from_type == CHANY && to_type == CHANX)) {
2197
2184
to->backward_path_cost += cost_params.bend_cost ; // Bend cost
2198
2185
}
0 commit comments