Skip to content

Commit b579cbd

Browse files
committed
Updates based on GitHub; wrapped #ifndef and updated calculating_routing_usage comment in .h file.
1 parent d186c73 commit b579cbd

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

vpr/src/route/route_util.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ vtr::Matrix<float> calculate_routing_usage(t_rr_type rr_type, bool is_flat, bool
2929

3030
//Record number of used resources in each x/y channel
3131
for (RRNodeId rr_node : rr_nodes) {
32-
if (!is_print) {
33-
t_draw_state* draw_state = get_draw_state_vars();
34-
int layer_num = rr_graph.node_layer(rr_node);
35-
if (!draw_state->draw_layer_display[layer_num].visible)
36-
continue; // don't count usage if layer is not visible
37-
}
32+
#ifndef NO_GRAPHICS
33+
if (!is_print) {
34+
t_draw_state* draw_state = get_draw_state_vars();
35+
int layer_num = rr_graph.node_layer(rr_node);
36+
if (!draw_state->draw_layer_display[layer_num].visible)
37+
continue; // don't count usage if layer is not visible
38+
}
39+
#endif
3840

3941
if (rr_type == CHANX) {
4042
VTR_ASSERT(rr_graph.node_type(rr_node) == CHANX);

vpr/src/route/route_util.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
vtr::Matrix<float> calculate_routing_avail(t_rr_type rr_type);
88

99
/**
10-
* @brief Calculates routing usage over entire grid
11-
* Collects all in-use nodes and records number of used resources
12-
* in each x/y channel. Takes into consideration visible layers
13-
* for multi-layered architectures. Also takes into consideration
14-
* if it is being printed, if so, layer visibility is ignored.
10+
* @brief: Calculates and returns the usage over the entire grid for the specified
11+
* type of rr_node to the usage array. The usage is recorded at each (x,y) location.
12+
*
13+
* @param rr_type: Type of rr_node that we are calculating the usage of; can be CHANX or CHANY
14+
* @param is_flat: Is the flat router being used or not?
15+
* @param only_visible: If true, only record the usage of rr_nodes on layers that are visible according to the current
16+
* drawing settings.
1517
*/
1618
vtr::Matrix<float> calculate_routing_usage(t_rr_type rr_type, bool is_flat, bool is_print);
1719
float routing_util(float used, float avail);

0 commit comments

Comments
 (0)