From ad13058a0b4ae0d2e70e946bbb91e2a58618ac96 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 13 Aug 2024 15:04:13 -0700 Subject: [PATCH 1/2] [core] fixed a bug where unused last-level of clock spines are not disabled --- openfpga/src/annotation/openfpga_annotate_routing.cpp | 2 +- openfpga/src/annotation/route_clock_rr_graph.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/openfpga/src/annotation/openfpga_annotate_routing.cpp b/openfpga/src/annotation/openfpga_annotate_routing.cpp index 489c80986..afd0dc69f 100644 --- a/openfpga/src/annotation/openfpga_annotate_routing.cpp +++ b/openfpga/src/annotation/openfpga_annotate_routing.cpp @@ -90,7 +90,7 @@ vtr::vector annotate_rr_node_global_net( rr_graph.node_lookup().find_nodes_at_all_sides( layer, blk_loc.loc.x, blk_loc.loc.y, rr_pin_type, node_pin_num); for (RRNodeId curr_rr_node : curr_rr_nodes) { - VTR_LOGV(verbose, "on '%s' pin '%d'\n", + VTR_LOGV(verbose, "Annotate global net '%s' on '%s' pin '%d'\n", cluster_nlist.net_name(net_id).c_str(), phy_tile->name, node_pin_num); rr_node_nets[curr_rr_node] = net_id; diff --git a/openfpga/src/annotation/route_clock_rr_graph.cpp b/openfpga/src/annotation/route_clock_rr_graph.cpp index ee7552cfd..a80a79210 100644 --- a/openfpga/src/annotation/route_clock_rr_graph.cpp +++ b/openfpga/src/annotation/route_clock_rr_graph.cpp @@ -317,6 +317,15 @@ static int rec_expand_and_route_clock_spine( if (curr_tap_usage) { curr_spine_usage = true; } + /* If no taps are routed, this spine is not used. Early exit */ + if (!curr_tap_usage && clk_ntwk.is_last_level(curr_spine)) { + spine_usage = false; + VTR_LOGV(verbose, + "Disable last-level spine '%s' as " + "none of the taps are not used\n", + clk_ntwk.spine_name(curr_spine).c_str()); + return CMD_EXEC_SUCCESS; + } std::vector> spine_coords = clk_ntwk.spine_coordinates(curr_spine); From c2d9696489e5a676a8629abdb611e992f1ca2e4a Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 13 Aug 2024 15:19:47 -0700 Subject: [PATCH 2/2] [core] fixed a bug where some spines are not disabled --- openfpga/src/annotation/route_clock_rr_graph.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openfpga/src/annotation/route_clock_rr_graph.cpp b/openfpga/src/annotation/route_clock_rr_graph.cpp index a80a79210..c2ac62afb 100644 --- a/openfpga/src/annotation/route_clock_rr_graph.cpp +++ b/openfpga/src/annotation/route_clock_rr_graph.cpp @@ -333,14 +333,11 @@ 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 = false; + bool 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]; bool curr_stop_usage = false; - if (icoord == 0) { - prev_stop_usage = true; /* The first stop is always used */ - } /* Expand on the switching point here */ for (ClockSwitchPointId switch_point_id : clk_ntwk.find_spine_switch_points_with_coord(curr_spine,