Skip to content

Commit 66ffeaa

Browse files
authored
Merge pull request #1962 from RapidSilicon/rr_nodes
Clean-up DeviceContext (Remove shadowed data structure)
2 parents 81b5aa2 + 42e492d commit 66ffeaa

34 files changed

+175
-175
lines changed

utils/route_diag/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static void do_one_route(int source_node, int sink_node,
101101
ConnectionRouter<BinaryHeap> router(
102102
device_ctx.grid,
103103
*router_lookahead,
104-
device_ctx.rr_nodes,
104+
device_ctx.rr_graph.rr_nodes(),
105105
&device_ctx.rr_graph,
106106
device_ctx.rr_rc_data,
107107
device_ctx.rr_graph.rr_switch(),

vpr/src/base/read_route.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ bool read_route(const char* route_file, const t_router_opts& router_opts, bool v
126126
recompute_occupancy_from_scratch();
127127

128128
/* Note: This pres_fac is not necessarily correct since it isn't the first routing iteration*/
129-
OveruseInfo overuse_info(device_ctx.rr_nodes.size());
129+
OveruseInfo overuse_info(device_ctx.rr_graph.num_nodes());
130130
pathfinder_update_acc_cost_and_overuse_info(router_opts.acc_fac, overuse_info);
131131

132132
reserve_locally_used_opins(&small_heap, router_opts.initial_pres_fac,
@@ -505,21 +505,19 @@ static bool check_rr_graph_connectivity(RRNodeId prev_node, RRNodeId node) {
505505
if (prev_node == node) return false;
506506

507507
auto& device_ctx = g_vpr_ctx.device();
508-
const auto& rr_graph = device_ctx.rr_nodes;
509-
/*TODO We need to remove temp_rr_graph once rr_graph is resolved*/
510-
const auto& temp_rr_graph = device_ctx.rr_graph;
508+
const auto& rr_graph = device_ctx.rr_graph;
511509
// If it's starting a new sub branch this is ok
512-
if (device_ctx.rr_graph.node_type(prev_node) == SINK) return true;
510+
if (rr_graph.node_type(prev_node) == SINK) return true;
513511

514512
for (RREdgeId edge : rr_graph.edge_range(prev_node)) {
515513
//If the sink node is reachable by previous node return true
516-
if (rr_graph.edge_sink_node(edge) == node) {
514+
if (rr_graph.rr_nodes().edge_sink_node(edge) == node) {
517515
return true;
518516
}
519517

520518
// If there are any non-configurable branches return true
521-
short edge_switch = rr_graph.edge_switch(edge);
522-
if (!(temp_rr_graph.rr_switch_inf(RRSwitchId(edge_switch)).configurable())) return true;
519+
short edge_switch = rr_graph.rr_nodes().edge_switch(edge);
520+
if (!(rr_graph.rr_switch_inf(RRSwitchId(edge_switch)).configurable())) return true;
523521
}
524522

525523
// If it's part of a non configurable node list, return true

vpr/src/base/vpr_context.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ struct DeviceContext : public Context {
147147
/*
148148
* Structures to define the routing architecture of the FPGA.
149149
*/
150-
t_rr_graph_storage rr_nodes; // autogenerated in build_rr_graph
151150

152151
vtr::vector<RRIndexedDataId, t_rr_indexed_data> rr_indexed_data; // [0 .. num_rr_indexed_data-1]
153152

@@ -163,19 +162,12 @@ struct DeviceContext : public Context {
163162
/* A writeable view of routing resource graph to be the ONLY database
164163
* for routing resource graph builder functions.
165164
*/
166-
RRGraphBuilder rr_graph_builder{&rr_nodes};
165+
RRGraphBuilder rr_graph_builder{};
167166

168167
/* A read-only view of routing resource graph to be the ONLY database
169168
* for client functions: GUI, placer, router, timing analyzer etc.
170169
*/
171-
RRGraphView rr_graph{rr_nodes,
172-
rr_graph_builder.node_lookup(),
173-
rr_graph_builder.rr_node_metadata(),
174-
rr_graph_builder.rr_edge_metadata(),
175-
rr_indexed_data,
176-
rr_graph_builder.rr_segments(),
177-
rr_graph_builder.rr_switch()};
178-
170+
RRGraphView rr_graph{rr_graph_builder.rr_nodes(), rr_graph_builder.node_lookup(), rr_graph_builder.rr_node_metadata(), rr_graph_builder.rr_edge_metadata(), rr_indexed_data, rr_graph_builder.rr_segments(), rr_graph_builder.rr_switch()};
179171
int num_arch_switches;
180172
t_arch_switch_inf* arch_switch_inf; // [0..(num_arch_switches-1)]
181173

@@ -194,7 +186,6 @@ struct DeviceContext : public Context {
194186
* a single value
195187
*/
196188
int virtual_clock_network_root_idx;
197-
198189
/**
199190
* @brief switch_fanin_remap is only used for printing out switch fanin stats
200191
* (the -switch_stats option)

vpr/src/device/rr_graph_builder.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77

88
//#include "globals.h"
99

10-
RRGraphBuilder::RRGraphBuilder(t_rr_graph_storage* node_storage)
11-
: node_storage_(*node_storage) {
12-
}
10+
RRGraphBuilder::RRGraphBuilder() {}
1311

14-
t_rr_graph_storage& RRGraphBuilder::node_storage() {
12+
t_rr_graph_storage& RRGraphBuilder::rr_nodes() {
1513
return node_storage_;
1614
}
1715

@@ -63,6 +61,7 @@ void RRGraphBuilder::add_node_to_all_locs(RRNodeId node) {
6361

6462
void RRGraphBuilder::clear() {
6563
node_lookup_.clear();
64+
node_storage_.clear();
6665
rr_node_metadata_.clear();
6766
rr_edge_metadata_.clear();
6867
rr_segments_.clear();

vpr/src/device/rr_graph_builder.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RRGraphBuilder {
2121
/* -- Constructors -- */
2222
public:
2323
/* See detailed comments about the data structures in the internal data storage section of this file */
24-
RRGraphBuilder(t_rr_graph_storage* node_storage);
24+
RRGraphBuilder();
2525

2626
/* Disable copy constructors and copy assignment operator
2727
* This is to avoid accidental copy because it could be an expensive operation considering that the
@@ -35,7 +35,7 @@ class RRGraphBuilder {
3535
/* -- Mutators -- */
3636
public:
3737
/** @brief Return a writable object for rr_nodes */
38-
t_rr_graph_storage& node_storage();
38+
t_rr_graph_storage& rr_nodes();
3939
/** @brief Return a writable object for update the fast look-up of rr_node */
4040
RRSpatialLookup& node_lookup();
4141
/** .. warning:: The Metadata should stay as an independent data structure than rest of the internal data,
@@ -212,6 +212,11 @@ class RRGraphBuilder {
212212
inline void emplace_back_edge(RRNodeId src, RRNodeId dest, short edge_switch) {
213213
node_storage_.emplace_back_edge(src, dest, edge_switch);
214214
}
215+
/** @brief Append 1 more RR node to the RR graph. */
216+
inline void emplace_back() {
217+
// No edges can be assigned if mutating the rr node array.
218+
node_storage_.emplace_back();
219+
}
215220

216221
/** @brief alloc_and_load_edges; It adds a batch of edges. */
217222
inline void alloc_and_load_edges(const t_rr_edge_info_set* rr_edges_to_create) {
@@ -316,7 +321,7 @@ class RRGraphBuilder {
316321
* That explains why the reference is used here temporarily
317322
*/
318323
/* node-level storage including edge storages */
319-
t_rr_graph_storage& node_storage_;
324+
t_rr_graph_storage node_storage_;
320325
/* Fast look-up for rr nodes */
321326
RRSpatialLookup node_lookup_;
322327

vpr/src/device/rr_graph_view.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,23 @@ class RRGraphView {
6969
* }
7070
*/
7171
inline vtr::StrongIdRange<RRNodeId> nodes() const {
72-
return vtr::StrongIdRange<RRNodeId>(RRNodeId(0), RRNodeId(size()));
72+
return vtr::StrongIdRange<RRNodeId>(RRNodeId(0), RRNodeId(num_nodes()));
7373
}
7474

7575
/** @brief Return number of nodes. This function is inlined for runtime optimization. */
76-
inline size_t size() const {
76+
inline size_t num_nodes() const {
7777
return node_storage_.size();
7878
}
79+
/** @brief Is the RR graph currently empty? */
80+
inline bool empty() const {
81+
return node_storage_.empty();
82+
}
83+
84+
/** @brief Returns a range of RREdgeId's belonging to RRNodeId id.
85+
* If this range is empty, then RRNodeId id has no edges.*/
86+
inline vtr::StrongIdRange<RREdgeId> edge_range(RRNodeId id) const {
87+
return vtr::StrongIdRange<RREdgeId>(node_storage_.first_edge(id), node_storage_.last_edge(id));
88+
}
7989

8090
/** @brief Get the type of a routing resource node. This function is inlined for runtime optimization. */
8191
inline t_rr_type node_type(RRNodeId node) const {
@@ -421,6 +431,11 @@ class RRGraphView {
421431
const RRSpatialLookup& node_lookup() const {
422432
return node_lookup_;
423433
}
434+
/** @brief Return the node-level storage structure for queries from client functions */
435+
inline const t_rr_graph_storage& rr_nodes() const {
436+
return node_storage_;
437+
}
438+
424439
/** .. warning:: The Metadata should stay as an independent data structure than rest of the internal data,
425440
* e.g., node_lookup! */
426441
MetadataStorage<int> rr_node_metadata_data() const {
@@ -464,6 +479,7 @@ class RRGraphView {
464479
const MetadataStorage<std::tuple<int, int, short>>& rr_edge_metadata_;
465480
/* rr_indexed_data_ and rr_segments_ are needed to lookup the segment information in node_coordinate_to_string() */
466481
const vtr::vector<RRIndexedDataId, t_rr_indexed_data>& rr_indexed_data_;
482+
467483
/* Segment info for rr nodes */
468484
const vtr::vector<RRSegmentId, t_segment_inf>& rr_segments_;
469485
/* switch info for rr nodes */

vpr/src/draw/draw.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ void alloc_draw_structs(const t_arch* arch) {
929929
/* Space is allocated for draw_rr_node but not initialized because we do *
930930
* not yet know information about the routing resources. */
931931
draw_state->draw_rr_node = (t_draw_rr_node*)vtr::malloc(
932-
device_ctx.rr_nodes.size() * sizeof(t_draw_rr_node));
932+
device_ctx.rr_graph.num_nodes() * sizeof(t_draw_rr_node));
933933

934934
draw_state->arch_info = arch;
935935

@@ -980,10 +980,10 @@ void init_draw_coords(float width_val) {
980980
return; //do not initialize only if --disp off and --save_graphics off
981981
/* Each time routing is on screen, need to reallocate the color of each *
982982
* rr_node, as the number of rr_nodes may change. */
983-
if (device_ctx.rr_nodes.size() != 0) {
983+
if (rr_graph.num_nodes() != 0) {
984984
draw_state->draw_rr_node = (t_draw_rr_node*)vtr::realloc(
985985
draw_state->draw_rr_node,
986-
(device_ctx.rr_nodes.size()) * sizeof(t_draw_rr_node));
986+
(rr_graph.num_nodes()) * sizeof(t_draw_rr_node));
987987
/*FIXME: the type cast should be eliminated by making draw_rr_node adapt RRNodeId */
988988
for (const RRNodeId& rr_id : rr_graph.nodes()) {
989989
draw_state->draw_rr_node[(size_t)rr_id].color = DEFAULT_RR_NODE_COLOR;
@@ -1310,7 +1310,7 @@ static void draw_routing_costs(ezgl::renderer* g) {
13101310

13111311
float min_cost = std::numeric_limits<float>::infinity();
13121312
float max_cost = -min_cost;
1313-
std::vector<float> rr_node_costs(device_ctx.rr_nodes.size(), 0.);
1313+
std::vector<float> rr_node_costs(device_ctx.rr_graph.num_nodes(), 0.);
13141314

13151315
for (const RRNodeId& rr_id : device_ctx.rr_graph.nodes()) {
13161316
float cost = 0.;
@@ -1694,7 +1694,7 @@ static void draw_rr_edges(int inode, ezgl::renderer* g) {
16941694
to_node = size_t(rr_graph.edge_sink_node(rr_node, iedge));
16951695
to_type = rr_graph.node_type(RRNodeId(to_node));
16961696
to_ptc_num = rr_graph.node_ptc_num(RRNodeId(to_node));
1697-
bool edge_configurable = device_ctx.rr_nodes[inode].edge_is_configurable(iedge);
1697+
bool edge_configurable = rr_graph.rr_nodes()[inode].edge_is_configurable(iedge);
16981698

16991699
switch (from_type) {
17001700
case OPIN:
@@ -2288,7 +2288,7 @@ static void draw_rr_pin(int inode, const ezgl::color& color, ezgl::renderer* g)
22882288
* the physical pin is on. */
22892289
void draw_get_rr_pin_coords(int inode, float* xcen, float* ycen, const e_side& pin_side) {
22902290
auto& device_ctx = g_vpr_ctx.device();
2291-
draw_get_rr_pin_coords(device_ctx.rr_nodes[inode], xcen, ycen, pin_side);
2291+
draw_get_rr_pin_coords(device_ctx.rr_graph.rr_nodes()[inode], xcen, ycen, pin_side);
22922292
}
22932293

22942294
void draw_get_rr_pin_coords(const t_rr_node& node, float* xcen, float* ycen, const e_side& pin_side) {
@@ -2357,7 +2357,7 @@ static void draw_rr_src_sink(int inode, ezgl::color color, ezgl::renderer* g) {
23572357
const auto& rr_graph = device_ctx.rr_graph;
23582358

23592359
float xcen, ycen;
2360-
draw_get_rr_src_sink_coords(device_ctx.rr_nodes[inode], &xcen, &ycen);
2360+
draw_get_rr_src_sink_coords(rr_graph.rr_nodes()[inode], &xcen, &ycen);
23612361

23622362
g->set_color(color);
23632363

@@ -2786,7 +2786,7 @@ static int draw_check_rr_node_hit(float click_x, float click_y) {
27862786
case SOURCE:
27872787
case SINK: {
27882788
float xcen, ycen;
2789-
draw_get_rr_src_sink_coords(device_ctx.rr_nodes[inode], &xcen, &ycen);
2789+
draw_get_rr_src_sink_coords(rr_graph.rr_nodes()[inode], &xcen, &ycen);
27902790

27912791
// Now check if we clicked on this pin
27922792
if (click_x >= xcen - draw_coords->pin_size && click_x <= xcen + draw_coords->pin_size && click_y >= ycen - draw_coords->pin_size && click_y <= ycen + draw_coords->pin_size) {
@@ -2829,7 +2829,7 @@ void draw_expand_non_configurable_rr_nodes_recurr(int from_node,
28292829

28302830
for (t_edge_size iedge = 0;
28312831
iedge < rr_graph.num_edges(RRNodeId(from_node)); ++iedge) {
2832-
bool edge_configurable = device_ctx.rr_nodes[from_node].edge_is_configurable(iedge);
2832+
bool edge_configurable = rr_graph.rr_nodes()[from_node].edge_is_configurable(iedge);
28332833
int to_node = size_t(rr_graph.edge_sink_node(RRNodeId(from_node), iedge));
28342834

28352835
if (!edge_configurable && !expanded_nodes.count(to_node)) {
@@ -3355,7 +3355,7 @@ static void draw_pin_to_sink(int ipin_node, int sink_node, ezgl::renderer* g) {
33553355
draw_get_rr_pin_coords(ipin_node, &x1, &y1, pin_side);
33563356

33573357
float x2 = 0, y2 = 0;
3358-
draw_get_rr_src_sink_coords(device_ctx.rr_nodes[sink_node], &x2, &y2);
3358+
draw_get_rr_src_sink_coords(rr_graph.rr_nodes()[sink_node], &x2, &y2);
33593359

33603360
g->draw_line({x1, y1}, {x2, y2});
33613361

@@ -3370,7 +3370,7 @@ static void draw_source_to_pin(int source_node, int opin_node, ezgl::renderer* g
33703370
const auto& rr_graph = device_ctx.rr_graph;
33713371

33723372
float x1 = 0, y1 = 0;
3373-
draw_get_rr_src_sink_coords(device_ctx.rr_nodes[source_node], &x1, &y1);
3373+
draw_get_rr_src_sink_coords(rr_graph.rr_nodes()[source_node], &x1, &y1);
33743374

33753375
/* Draw the line for each ipin on different sides */
33763376
for (const e_side& pin_side : SIDES) {
@@ -4141,7 +4141,7 @@ static void draw_router_expansion_costs(ezgl::renderer* g) {
41414141
auto& device_ctx = g_vpr_ctx.device();
41424142
auto& routing_ctx = g_vpr_ctx.routing();
41434143

4144-
std::vector<float> rr_costs(device_ctx.rr_nodes.size());
4144+
std::vector<float> rr_costs(device_ctx.rr_graph.num_nodes());
41454145

41464146
for (const RRNodeId& rr_id : device_ctx.rr_graph.nodes()) {
41474147
float cost = get_router_expansion_cost(
@@ -4198,11 +4198,11 @@ static void draw_rr_costs(ezgl::renderer* g, const std::vector<float>& rr_costs,
41984198
|| draw_state->show_router_expansion_cost == DRAW_ROUTER_EXPANSION_COST_KNOWN_WITH_EDGES
41994199
|| draw_state->show_router_expansion_cost == DRAW_ROUTER_EXPANSION_COST_EXPECTED_WITH_EDGES);
42004200

4201-
VTR_ASSERT(rr_costs.size() == device_ctx.rr_nodes.size());
4201+
VTR_ASSERT(rr_costs.size() == rr_graph.num_nodes());
42024202

42034203
float min_cost = std::numeric_limits<float>::infinity();
42044204
float max_cost = -min_cost;
4205-
for (const RRNodeId& rr_id : device_ctx.rr_graph.nodes()) {
4205+
for (const RRNodeId& rr_id : rr_graph.nodes()) {
42064206
if (std::isnan(rr_costs[(size_t)rr_id])) continue;
42074207

42084208
min_cost = std::min(min_cost, rr_costs[(size_t)rr_id]);
@@ -4214,7 +4214,7 @@ static void draw_rr_costs(ezgl::renderer* g, const std::vector<float>& rr_costs,
42144214

42154215
//Draw the nodes in ascending order of value, this ensures high valued nodes
42164216
//are not overdrawn by lower value ones (e.g-> when zoomed-out far)
4217-
std::vector<int> nodes(device_ctx.rr_nodes.size());
4217+
std::vector<int> nodes(rr_graph.num_nodes());
42184218
std::iota(nodes.begin(), nodes.end(), 0);
42194219
auto cmp_ascending_cost = [&](int lhs_node, int rhs_node) {
42204220
if (lowest_cost_first) {

vpr/src/draw/search_bar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) {
6868
ss >> rr_node_id;
6969

7070
// valid rr node id check
71-
if (rr_node_id < 0 || rr_node_id >= int(device_ctx.rr_nodes.size())) {
71+
if (rr_node_id < 0 || rr_node_id >= int(device_ctx.rr_graph.num_nodes())) {
7272
warning_dialog_box("Invalid RR Node ID");
7373
app->refresh_drawing();
7474
return;

vpr/src/pack/post_routing_pb_pin_fixup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static void update_cluster_pin_with_post_routing_results(const DeviceContext& de
159159
if (!rr_node) {
160160
continue;
161161
}
162-
VTR_ASSERT((size_t)rr_node < device_ctx.rr_nodes.size());
162+
VTR_ASSERT((size_t)rr_node < device_ctx.rr_graph.num_nodes());
163163

164164
/* If the node has been visited on the other side, we just skip it */
165165
if (visited_rr_nodes.end() != std::find(visited_rr_nodes.begin(), visited_rr_nodes.end(), RRNodeId(rr_node))) {

vpr/src/power/power.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ void power_routing_init(const t_det_routing_arch* routing_arch) {
11921192
}
11931193

11941194
/* Initialize RR Graph Structures */
1195-
rr_node_power = (t_rr_node_power*)vtr::calloc(device_ctx.rr_nodes.size(),
1195+
rr_node_power = (t_rr_node_power*)vtr::calloc(rr_graph.num_nodes(),
11961196
sizeof(t_rr_node_power));
11971197
for (const RRNodeId& rr_id : device_ctx.rr_graph.nodes()) {
11981198
rr_node_power[(size_t)rr_id].driver_switch_type = OPEN;

vpr/src/route/annotate_routing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ vtr::vector<RRNodeId, ClusterNetId> annotate_rr_node_nets(const DeviceContext& d
2828
const auto& rr_graph = device_ctx.rr_graph;
2929

3030
vtr::vector<RRNodeId, ClusterNetId> rr_node_nets;
31-
rr_node_nets.resize(device_ctx.rr_nodes.size(), ClusterNetId::INVALID());
31+
rr_node_nets.resize(rr_graph.num_nodes(), ClusterNetId::INVALID());
3232

3333
for (auto net_id : clustering_ctx.clb_nlist.nets()) {
3434
if (clustering_ctx.clb_nlist.net_is_ignored(net_id)) {
@@ -52,7 +52,7 @@ vtr::vector<RRNodeId, ClusterNetId> annotate_rr_node_nets(const DeviceContext& d
5252
* whose capacity is 1
5353
*/
5454
if ((rr_node_nets[rr_node])
55-
&& (1 == device_ctx.rr_nodes.node_capacity(rr_node))
55+
&& (1 == rr_graph.node_capacity(rr_node))
5656
&& (net_id != rr_node_nets[rr_node])) {
5757
VPR_FATAL_ERROR(VPR_ERROR_ANALYSIS,
5858
"Detect two nets '%s' and '%s' that are mapped to the same rr_node '%ld'!\n%s\n",

vpr/src/route/check_route.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ void check_route(enum e_route_type route_type, e_check_route_option check_route_
7474

7575
check_locally_used_clb_opins(route_ctx.clb_opins_used_locally, route_type);
7676

77-
auto connected_to_route = std::make_unique<bool[]>(device_ctx.rr_nodes.size());
78-
std::fill_n(connected_to_route.get(), device_ctx.rr_nodes.size(), false);
77+
auto connected_to_route = std::make_unique<bool[]>(rr_graph.num_nodes());
78+
std::fill_n(connected_to_route.get(), rr_graph.num_nodes(), false);
7979

8080
max_pins = 0;
8181
for (auto net_id : cluster_ctx.clb_nlist.nets())
@@ -536,7 +536,7 @@ void recompute_occupancy_from_scratch() {
536536
/* Will always be 0 for pads or SINK classes. */
537537
for (ipin = 0; ipin < num_local_opins; ipin++) {
538538
inode = route_ctx.clb_opins_used_locally[blk_id][iclass][ipin];
539-
VTR_ASSERT(inode >= 0 && inode < (ssize_t)device_ctx.rr_nodes.size());
539+
VTR_ASSERT(inode >= 0 && inode < (ssize_t)device_ctx.rr_graph.num_nodes());
540540
route_ctx.rr_node_route_inf[inode].set_occ(route_ctx.rr_node_route_inf[inode].occ() + 1);
541541
}
542542
}
@@ -592,9 +592,9 @@ static void check_node_and_range(int inode, enum e_route_type route_type) {
592592

593593
auto& device_ctx = g_vpr_ctx.device();
594594

595-
if (inode < 0 || inode >= (int)device_ctx.rr_nodes.size()) {
595+
if (inode < 0 || inode >= (int)device_ctx.rr_graph.num_nodes()) {
596596
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
597-
"in check_node_and_range: rr_node #%d is out of legal, range (0 to %d).\n", inode, device_ctx.rr_nodes.size() - 1);
597+
"in check_node_and_range: rr_node #%d is out of legal, range (0 to %d).\n", inode, device_ctx.rr_graph.num_nodes() - 1);
598598
}
599599
check_rr_node(inode, route_type, device_ctx);
600600
}

0 commit comments

Comments
 (0)