8
8
9
9
std::pair<t_trace*, t_trace*> traceback_from_route_tree_recurr (t_trace* head, t_trace* tail, const RouteTreeNode& node);
10
10
static void traceback_to_route_tree_x (
11
- std::unordered_map<RRNodeId, vtr::optional<RouteTreeNode&>> rr_node_to_rt_node,
11
+ std::unordered_map<RRNodeId, vtr::optional<RouteTreeNode&>>& rr_node_to_rt_node,
12
12
t_trace* trace,
13
13
RouteTreeNode& parent,
14
14
RRSwitchId parent_switch);
@@ -23,7 +23,7 @@ vtr::optional<RouteTree> traceback_to_route_tree(t_trace* head) {
23
23
if (head == nullptr )
24
24
return vtr::nullopt;
25
25
26
- RouteTreeNode root (RRNodeId (head->index ), RRSwitchId (OPEN ), vtr::nullopt);
26
+ RouteTreeNode root (RRNodeId (head->index ), RRSwitchId::INVALID ( ), vtr::nullopt);
27
27
std::unordered_map<RRNodeId, vtr::optional<RouteTreeNode&>> rr_node_to_rt_node;
28
28
29
29
rr_node_to_rt_node[RRNodeId (head->index )] = root;
@@ -34,18 +34,18 @@ vtr::optional<RouteTree> traceback_to_route_tree(t_trace* head) {
34
34
RouteTree tree (std::move (root));
35
35
tree.reload_timing ();
36
36
37
- /* We built the tree using an external lookup, but returning by value should either copy
37
+ /* We built the tree using a (hacky) external lookup, but returning by value should either copy
38
38
* or move, which will make the tree update its own lookup */
39
39
return tree;
40
40
}
41
41
42
42
/* Add the path indicated by the trace to parent */
43
- static void traceback_to_route_tree_x (std::unordered_map<RRNodeId, vtr::optional<RouteTreeNode&>> rr_node_to_rt_node, t_trace* trace, RouteTreeNode& parent, RRSwitchId parent_switch) {
43
+ static void traceback_to_route_tree_x (std::unordered_map<RRNodeId, vtr::optional<RouteTreeNode&>>& rr_node_to_rt_node, t_trace* trace, RouteTreeNode& parent, RRSwitchId parent_switch) {
44
44
auto & device_ctx = g_vpr_ctx.device ();
45
45
const auto & rr_graph = device_ctx.rr_graph ;
46
46
RRNodeId inode = RRNodeId (trace->index );
47
47
48
- RouteTreeNode new_node = parent.emplace_child (inode, parent_switch, parent);
48
+ RouteTreeNode& new_node = parent.emplace_child (inode, parent_switch, parent);
49
49
new_node.net_pin_index = trace->net_pin_index ;
50
50
new_node.R_upstream = std::numeric_limits<float >::quiet_NaN ();
51
51
new_node.C_downstream = std::numeric_limits<float >::quiet_NaN ();
@@ -59,7 +59,7 @@ static void traceback_to_route_tree_x(std::unordered_map<RRNodeId, vtr::optional
59
59
rr_node_to_rt_node[new_node.inode ] = new_node;
60
60
61
61
if (rr_graph.node_type (inode) == SINK) {
62
- /* The traceback returns to the previous branch point if there is more than one SINK, else we are at the base case */
62
+ /* The traceback returns to the previous branch point if there is more than one SINK, otherwise we are at the last SINK */
63
63
if (trace->next ) {
64
64
RRNodeId next_rr_node = RRNodeId (trace->next ->index );
65
65
RouteTreeNode& branch = rr_node_to_rt_node.at (next_rr_node).value ();
0 commit comments