Skip to content

Commit 2e9a2d6

Browse files
committed
revert bool is_net_routed(ParentNetId net_id); as using net_stats is not robust for stage except the route. add doxygen doc for is_net_routed and is_net_fully_absorbed
1 parent 80675e3 commit 2e9a2d6

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

vpr/src/draw/search_bar.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) {
4747
auto& device_ctx = g_vpr_ctx.device();
4848
auto& cluster_ctx = g_vpr_ctx.clustering();
4949
auto& atom_ctx = g_vpr_ctx.atom();
50-
const RoutingContext& route_ctx = g_vpr_ctx.routing();
5150

5251
// get ID from search bar
5352
GtkEntry* text_entry = (GtkEntry*)app->get_object("TextInput");
@@ -134,7 +133,7 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) {
134133
app->refresh_drawing();
135134
return;
136135
}
137-
if (!route_ctx.net_status.is_routed(atom_net_id)) {
136+
if (!is_net_routed(atom_net_id)) {
138137
warning_dialog_box("Net is unrouted");
139138
app->refresh_drawing();
140139
return;
@@ -169,7 +168,7 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) {
169168
app->refresh_drawing();
170169
return;
171170
}
172-
if (!route_ctx.net_status.is_routed(atom_net_id)) {
171+
if (!is_net_routed(atom_net_id)) {
173172
warning_dialog_box("Net is unrouted");
174173
app->refresh_drawing();
175174
return;

vpr/src/route/route_utils.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,15 @@ void update_router_info_and_check_bp(bp_router_type type, int net_id) {
674674
}
675675
#endif
676676

677-
bool is_net_fully_absorbed(ParentNetId net_id) {
677+
bool is_net_routed(ParentNetId net_id)
678+
{
679+
const auto& route_ctx = g_vpr_ctx.routing();
680+
//Note: we can't use route_ctx.net_status.is_routed(atom_net_id), because net_status is filled only when route stage took place
681+
return route_ctx.route_trees[net_id].has_value();
682+
}
683+
684+
bool is_net_fully_absorbed(ParentNetId net_id)
685+
{
678686
const RRGraphView& rr_graph = g_vpr_ctx.device().rr_graph;
679687
const RoutingContext& route_ctx = g_vpr_ctx.routing();
680688

@@ -690,5 +698,6 @@ bool is_net_fully_absorbed(ParentNetId net_id) {
690698
break;
691699
}
692700
}
701+
693702
return is_absorbed;
694703
}

vpr/src/route/route_utils.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,28 @@ void update_draw_pres_fac(const float new_pres_fac);
158158
void update_router_info_and_check_bp(bp_router_type type, int net_id);
159159
#endif
160160

161-
161+
/**
162+
* @brief Checks whether a given net has been routed.
163+
*
164+
* This function determines if the specified net (identified by `net_id`)
165+
* has routing information associated with it in the current routing context.
166+
*
167+
* @param net_id The identifier of the net to check.
168+
* @return true if the net is routed; false otherwise.
169+
*/
170+
bool is_net_routed(ParentNetId net_id);
171+
172+
/**
173+
* @brief Checks whether a given net is fully absorbed within sink nodes.
174+
*
175+
* This function inspects the route tree of the specified net and determines
176+
* whether it is fully absorbed into non-routing resources (i.e., it does not
177+
* occupy any routing channels such as CHANX or CHANY).
178+
*
179+
* A net is considered fully absorbed if all its route tree nodes are of types
180+
* other than CHANX or CHANY (e.g., IPIN, SINK, OPIN).
181+
*
182+
* @param net_id The identifier of the net to be checked.
183+
* @return true if the net is fully absorbed (uses no routing channels); false otherwise.
184+
*/
162185
bool is_net_fully_absorbed(ParentNetId net_id);

0 commit comments

Comments
 (0)