Merge pull request #1796 from lnis-uofu/xt_pbfixup

[core] fixed a bug where some clock spine was wrongly marked unused
This commit is contained in:
tangxifan 2024-08-14 20:47:52 -07:00 committed by GitHub
commit 68efe30e39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions

View File

@ -333,7 +333,10 @@ static int rec_expand_and_route_clock_spine(
* As such, it is easy to turn off spines by any stop.
* The spine should go in a straight line, connect all the stops on the line
*/
bool prev_stop_usage = curr_tap_usage;
bool prev_stop_usage = false;
if (clk_ntwk.is_last_level(curr_spine)) {
prev_stop_usage = curr_tap_usage;
}
std::reverse(spine_coords.begin(), spine_coords.end());
for (size_t icoord = 0; icoord < spine_coords.size(); ++icoord) {
vtr::Point<int> switch_point_coord = spine_coords[icoord];
@ -380,6 +383,12 @@ static int rec_expand_and_route_clock_spine(
switch_point_coord.y());
continue;
}
/* If there are any stop is used, mark this spine is used. This is to avoid
* that a spine is marked unused when only its 1st stop is actually used.
* The skip condition may cause this. */
if (curr_stop_usage) {
curr_spine_usage = true;
}
/* Skip the first stop */
if (icoord == spine_coords.size() - 1) {
continue;