Skip to content

Addressing route_timing Offset #2114

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 8 commits into from
Aug 11, 2022
Merged
Changes from all commits
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
17 changes: 11 additions & 6 deletions vpr/src/route/route_timing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,9 +893,14 @@ void alloc_timing_driven_route_structs(float** pin_criticality_ptr,

int max_sinks = std::max(get_max_pins_per_net() - 1, 0);

*pin_criticality_ptr = new float[max_sinks] - 1; /* First sink is pin #1. */
*sink_order_ptr = new int[max_sinks] - 1;
*rt_node_of_sink_ptr = new t_rt_node*[max_sinks] - 1;
*pin_criticality_ptr = new float[max_sinks + 1]; /* First sink is pin #1.*/
*sink_order_ptr = new int[max_sinks + 1];
*rt_node_of_sink_ptr = new t_rt_node*[max_sinks + 1];

/* Element 0 should be an invalid value so we are likely to crash if we accidentally use it. */
(*pin_criticality_ptr)[0] = -1;
(*sink_order_ptr)[0] = -1;
(*rt_node_of_sink_ptr)[0] = nullptr;

alloc_route_tree_timing_structs();
}
Expand All @@ -908,11 +913,11 @@ void free_timing_driven_route_structs(float* pin_criticality, int* sink_order, t
/* Frees all the structures needed only by the timing-driven router. */

// coverity[offset_free : Intentional]
delete[](pin_criticality + 1); /* Starts at index 1. */
delete[](pin_criticality);
// coverity[offset_free : Intentional]
delete[](sink_order + 1);
delete[](sink_order);
// coverity[offset_free : Intentional]
delete[](rt_node_of_sink + 1);
delete[](rt_node_of_sink);

free_route_tree_timing_structs();
}
Expand Down