From 4554c5781ab6927163435d080940b7e8c8a3279b Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 14 Aug 2024 18:08:01 -0700 Subject: [PATCH 1/2] [core] fixed a bug where some clock spine was wrongly marked unused --- openfpga/src/annotation/route_clock_rr_graph.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openfpga/src/annotation/route_clock_rr_graph.cpp b/openfpga/src/annotation/route_clock_rr_graph.cpp index c2ac62afb..9b37061d7 100644 --- a/openfpga/src/annotation/route_clock_rr_graph.cpp +++ b/openfpga/src/annotation/route_clock_rr_graph.cpp @@ -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 switch_point_coord = spine_coords[icoord]; @@ -380,6 +383,10 @@ 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; From 1bcb0d08684c1adc793976a0dcbc605ee83064a0 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 14 Aug 2024 18:09:44 -0700 Subject: [PATCH 2/2] [core] code format --- openfpga/src/annotation/route_clock_rr_graph.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openfpga/src/annotation/route_clock_rr_graph.cpp b/openfpga/src/annotation/route_clock_rr_graph.cpp index 9b37061d7..00ad3bacc 100644 --- a/openfpga/src/annotation/route_clock_rr_graph.cpp +++ b/openfpga/src/annotation/route_clock_rr_graph.cpp @@ -383,7 +383,9 @@ 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 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; }