Skip to content

Commit 7f027cf

Browse files
committed
Add verification that no incremental node allocation occurred.
Signed-off-by: Keith Rothman <[email protected]>
1 parent 624ef25 commit 7f027cf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

vpr/src/route/rr_graph.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,10 @@ static void build_rr_graph(const t_graph_type graph_type,
574574

575575
device_ctx.rr_node_indices = alloc_and_load_rr_node_indices(max_chan_width, grid,
576576
&num_rr_nodes, chan_details_x, chan_details_y);
577+
size_t expected_node_count = num_rr_nodes;
577578
if (clock_modeling == DEDICATED_NETWORK) {
578-
device_ctx.rr_nodes.reserve(num_rr_nodes + ClockRRGraphBuilder::estimate_additional_nodes(grid));
579+
expected_node_count += ClockRRGraphBuilder::estimate_additional_nodes(grid);
580+
device_ctx.rr_nodes.reserve(expected_node_count);
579581
}
580582
device_ctx.rr_nodes.resize(num_rr_nodes);
581583

@@ -692,6 +694,12 @@ static void build_rr_graph(const t_graph_type graph_type,
692694
is_global_graph,
693695
clock_modeling);
694696

697+
// Verify no incremental node allocation.
698+
if (device_ctx.rr_nodes.size() > expected_node_count) {
699+
VTR_LOG_ERROR("Expected no more than %zu nodes, have %zu nodes",
700+
expected_node_count, device_ctx.rr_nodes.size());
701+
}
702+
695703
/* Update rr_nodes capacities if global routing */
696704
if (graph_type == GRAPH_GLOBAL) {
697705
// Using num_rr_nodes here over device_ctx.rr_nodes.size() because

0 commit comments

Comments
 (0)