Skip to content

Commit 6b834d8

Browse files
Changes reverted for validate()
1 parent 0e8ff51 commit 6b834d8

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

vpr/src/route/rr_node.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ bool t_rr_node::edge_is_configurable(t_edge_size iedge) const {
2121

2222
bool t_rr_node::validate() const {
2323
//Check internal assumptions about RR node are valid
24-
auto& device_ctx = g_vpr_ctx.device();
25-
26-
const auto& rr_graph = device_ctx.rr_graph;
2724

2825
t_edge_size iedge = 0;
29-
for (auto edge : rr_graph.edges(RRNodeId(id_))) {
30-
if (edge < rr_graph.num_configurable_edges(RRNodeId(id_))) {
26+
for (auto edge : edges()) {
27+
if (edge < num_configurable_edges()) {
3128
if (!edge_is_configurable(edge)) {
3229
VPR_FATAL_ERROR(VPR_ERROR_ROUTE, "RR Node non-configurable edge found in configurable edge list");
3330
}
@@ -39,7 +36,7 @@ bool t_rr_node::validate() const {
3936
++iedge;
4037
}
4138

42-
if (iedge != rr_graph.num_edges(RRNodeId(id_))) {
39+
if (iedge != num_edges()) {
4340
VPR_FATAL_ERROR(VPR_ERROR_ROUTE, "RR Node Edge iteration does not match edge size");
4441
}
4542

vpr/src/route/rr_node_impl.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ inline t_rr_node t_rr_graph_storage::back() {
7171
return t_rr_node(this, RRNodeId(size() - 1));
7272
}
7373

74+
inline t_edge_size t_rr_node::num_edges() const {
75+
return storage_->num_edges(id_);
76+
}
77+
78+
inline edge_idx_range t_rr_node::edges() const {
79+
return storage_->edges(id_);
80+
}
81+
82+
inline t_edge_size t_rr_node::num_configurable_edges() const {
83+
return storage_->num_configurable_edges(id_);
84+
}
85+
7486
inline int t_rr_node::edge_sink_node(t_edge_size iedge) const {
7587
size_t inode = (size_t)storage_->edge_sink_node(id_, iedge);
7688
return inode;

0 commit comments

Comments
 (0)