Skip to content

Issue #2078 #2092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions vpr/src/route/route_tree_timing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static t_linked_rt_edge* rt_edge_free_list = nullptr;

static t_rt_node* alloc_rt_node();

static void free_rt_node(t_rt_node* rt_node);
static void free_rt_node(t_rt_node** rt_node);

static t_linked_rt_edge* alloc_linked_rt_edge();

Expand Down Expand Up @@ -144,11 +144,12 @@ alloc_rt_node() {
return (rt_node);
}

static void free_rt_node(t_rt_node* rt_node) {
static void free_rt_node(t_rt_node** rt_node) {
/* Adds rt_node to the proper free list. */

rt_node->u.next = rt_node_free_list;
rt_node_free_list = rt_node;
(*rt_node)->u.next = rt_node_free_list;
rt_node_free_list = (*rt_node);
(*rt_node) = nullptr;
}

static t_linked_rt_edge*
Expand Down Expand Up @@ -660,7 +661,9 @@ bool verify_route_tree_recurr(t_rt_node* node, std::set<int>& seen_nodes) {
void free_route_tree(t_rt_node* rt_node) {
/* Puts the rt_nodes and edges in the tree rooted at rt_node back on the
* free lists. Recursive, depth-first post-order traversal. */

if(rt_node == nullptr) {
return;
}
t_linked_rt_edge *rt_edge, *next_edge;

rt_edge = rt_node->u.child_list;
Expand All @@ -677,7 +680,7 @@ void free_route_tree(t_rt_node* rt_node) {
rr_node_to_rt_node.at(rt_node->inode) = nullptr;
}

free_rt_node(rt_node);
free_rt_node(&rt_node);
}

void print_route_tree(const t_rt_node* rt_node) {
Expand Down Expand Up @@ -1056,7 +1059,7 @@ static t_rt_node* prune_route_tree_recurr(t_rt_node* node, CBRR& connections_inf
//Record as not reached
connections_inf.toreach_rr_sink(node->net_pin_index);

free_rt_node(node);
free_rt_node(&node);
return nullptr; //Pruned
}
} else if (all_children_pruned) {
Expand Down Expand Up @@ -1102,7 +1105,7 @@ static t_rt_node* prune_route_tree_recurr(t_rt_node* node, CBRR& connections_inf
if (reached_non_configurably && !force_prune) {
return node; //Not pruned
} else {
free_rt_node(node);
free_rt_node(&node);
return nullptr; //Pruned
}

Expand Down