Skip to content

Commit 80667ac

Browse files
Richard Renkmurray
authored andcommitted
Refactored net_delay and route_tree_timing code
1 parent 9f7e882 commit 80667ac

File tree

4 files changed

+65
-434
lines changed

4 files changed

+65
-434
lines changed

vpr/src/draw/draw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3240,7 +3240,7 @@ static std::vector<int> trace_routed_connection_rr_nodes(const ClusterNetId net_
32403240
std::reverse(rr_nodes_on_path.begin(), rr_nodes_on_path.end());
32413241

32423242
if (allocated_route_tree_structs) {
3243-
free_route_tree_timing_structs(); //Clean-up
3243+
free_route_tree_timing_structs();
32443244
}
32453245
return rr_nodes_on_path;
32463246
}

vpr/src/route/route_timing.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ void free_timing_driven_route_structs(float* pin_criticality, int* sink_order, t
841841
free(sink_order + 1);
842842
// coverity[offset_free : Intentional]
843843
free(rt_node_of_sink + 1);
844+
844845
free_route_tree_timing_structs();
845846
}
846847

vpr/src/route/route_tree_timing.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ using namespace std;
2121
* about the partial routing during timing-driven routing, so the routines
2222
* in this module are used to keep a tree representation of the partial
2323
* routing during timing-driven routing. This allows rapid incremental
24-
* timing analysis. The net_delay module does timing analysis in one step
25-
* (not incrementally as pieces of the routing are added). I could probably
26-
* one day remove a lot of net_delay.c and call the corresponding routines
27-
* here, but it's useful to have a from-scratch delay calculator to check
28-
* the results of this one. */
24+
* timing analysis. */
2925

3026
/********************** Variables local to this module ***********************/
3127

@@ -612,6 +608,7 @@ void free_route_tree(t_rt_node* rt_node) {
612608
if (!rr_node_to_rt_node.empty()) {
613609
rr_node_to_rt_node.at(rt_node->inode) = nullptr;
614610
}
611+
615612
free_rt_node(rt_node);
616613
}
617614

@@ -690,7 +687,13 @@ t_rt_node* traceback_to_route_tree(t_trace* head) {
690687
while (trace) { //Each branch
691688
trace = traceback_to_route_tree_branch(trace, rr_node_to_rt);
692689
}
690+
// Due to the recursive nature of traceback_to_route_tree_branch,
691+
// the source node is not properly configured.
692+
// Here, for the source we set the parent node and switch to be
693+
// nullptr and OPEN respectively.
693694

695+
rr_node_to_rt[head->index]->parent_node = nullptr;
696+
rr_node_to_rt[head->index]->parent_switch = OPEN;
694697
return rr_node_to_rt[head->index];
695698
}
696699

0 commit comments

Comments
 (0)