Skip to content

Commit 80675e3

Browse files
committed
move is_net_fully_absorbed to route_utils.h
1 parent 55a5276 commit 80675e3

File tree

4 files changed

+24
-26
lines changed

4 files changed

+24
-26
lines changed

vpr/src/draw/search_bar.cpp

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "vtr_log.h"
2222

2323
#include "vpr_utils.h"
24+
#include "route_utils.h"
2425

2526
#include "globals.h"
2627
#include "draw.h"
@@ -42,29 +43,6 @@
4243

4344
extern std::string rr_highlight_message;
4445

45-
bool is_net_fully_absorbed(AtomNetId atomic_net_id) {
46-
const RRGraphView& rr_graph = g_vpr_ctx.device().rr_graph;
47-
RoutingContext& route_ctx = g_vpr_ctx.mutable_routing();
48-
49-
bool is_absorbed = true;
50-
51-
t_trace* head = TracebackCompat::traceback_from_route_tree(route_ctx.route_trees[atomic_net_id].value());
52-
t_trace* tptr = head;
53-
while (tptr != nullptr) {
54-
RRNodeId inode = RRNodeId(tptr->index);
55-
e_rr_type rr_type = rr_graph.node_type(inode);
56-
57-
if (rr_type == e_rr_type::CHANX || rr_type == e_rr_type::CHANY) {
58-
is_absorbed = false;
59-
break;
60-
}
61-
tptr = tptr->next;
62-
}
63-
free_traceback(head);
64-
65-
return is_absorbed;
66-
}
67-
6846
void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) {
6947
auto& device_ctx = g_vpr_ctx.device();
7048
auto& cluster_ctx = g_vpr_ctx.clustering();
@@ -191,7 +169,7 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) {
191169
app->refresh_drawing();
192170
return;
193171
}
194-
if (!route_ctx.net_status.is_routed(atomic_net_id)) {
172+
if (!route_ctx.net_status.is_routed(atom_net_id)) {
195173
warning_dialog_box("Net is unrouted");
196174
app->refresh_drawing();
197175
return;

vpr/src/draw/search_bar.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#include "ezgl/application.hpp"
1818

19-
bool is_net_fully_absorbed(AtomNetId atomic_net_id);
20-
2119
void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app);
2220
bool highlight_rr_nodes(RRNodeId hit_node);
2321
void auto_zoom_rr_node(RRNodeId rr_node_id);

vpr/src/route/route_utils.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,3 +673,22 @@ void update_router_info_and_check_bp(bp_router_type type, int net_id) {
673673
}
674674
}
675675
#endif
676+
677+
bool is_net_fully_absorbed(ParentNetId net_id) {
678+
const RRGraphView& rr_graph = g_vpr_ctx.device().rr_graph;
679+
const RoutingContext& route_ctx = g_vpr_ctx.routing();
680+
681+
bool is_absorbed = true;
682+
683+
for (auto& rt_node : route_ctx.route_trees[net_id].value().all_nodes()) {
684+
RRNodeId inode = rt_node.inode;
685+
686+
e_rr_type rr_type = rr_graph.node_type(inode);
687+
688+
if (rr_type == e_rr_type::CHANX || rr_type == e_rr_type::CHANY) {
689+
is_absorbed = false;
690+
break;
691+
}
692+
}
693+
return is_absorbed;
694+
}

vpr/src/route/route_utils.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,6 @@ void update_draw_pres_fac(const float new_pres_fac);
157157
* Stops after the specified router iteration or net id is encountered */
158158
void update_router_info_and_check_bp(bp_router_type type, int net_id);
159159
#endif
160+
161+
162+
bool is_net_fully_absorbed(ParentNetId net_id);

0 commit comments

Comments
 (0)