Skip to content

Commit c6d6a40

Browse files
update edge_switch_offset_inf_ in the edge is already mapped
1 parent e0f3483 commit c6d6a40

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

libs/librrgraph/src/base/rr_graph_builder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void RRGraphBuilder::reorder_nodes(e_rr_node_reorder_algorithm reorder_rr_graph_
9393
n = RRNodeId(cur_idx++);
9494
}
9595

96-
// This method works well. The intution is that highly connected nodes are enumerated first (together),
96+
// This method works well. The intuition is that highly connected nodes are enumerated first (together),
9797
// and since there will be a lot of nodes with the same degree, they are then ordered based on some
9898
// distance from the starting node.
9999
if (reorder_rr_graph_nodes_algorithm == DEGREE_BFS) {

libs/librrgraph/src/base/rr_graph_storage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void t_rr_graph_storage::emplace_back_edge(RRNodeId src, RRNodeId dest, short ed
2020
edge_src_node_.emplace_back(src);
2121
edge_dest_node_.emplace_back(dest);
2222
edge_switch_.emplace_back(edge_switch);
23-
edge_switch_offset_inf_.emplace_back(RRSwitchOffsetInfoId::INVALID());
23+
edge_switch_offset_inf_.emplace_back(remapped ? (RRSwitchOffsetInfoId)edge_switch : RRSwitchOffsetInfoId::INVALID());
2424
edge_remapped_.emplace_back(remapped);
2525
}
2626

@@ -101,7 +101,7 @@ struct edge_swapper {
101101
storage_->edge_src_node_[RREdgeId(idx_)] = RRNodeId(edge.from_node);
102102
storage_->edge_dest_node_[RREdgeId(idx_)] = RRNodeId(edge.to_node);
103103
storage_->edge_switch_[RREdgeId(idx_)] = edge.switch_type;
104-
storage_->edge_switch_offset_inf_[RREdgeId(idx_)] = RRSwitchOffsetInfoId::INVALID();
104+
storage_->edge_switch_offset_inf_[RREdgeId(idx_)] = edge.remapped ? (RRSwitchOffsetInfoId)edge.switch_type : RRSwitchOffsetInfoId::INVALID();
105105
storage_->edge_remapped_[RREdgeId(idx_)] = edge.remapped;
106106
return *this;
107107
}
@@ -167,7 +167,7 @@ class edge_sort_iterator {
167167
// it needs to "act" like a pointer. One thing that it should do is that a
168168
// const variable of this type should be de-referenceable. Therefore, this
169169
// method should be const method; however, this requires modifying the class
170-
// and may yield worst performance. For now the std::stable_sort allows this
170+
// and may yield worse performance. For now the std::stable_sort allows this
171171
// but in the future it may not. If this breaks, this is why.
172172
// See issue #2517 and PR #2522
173173
edge_swapper& operator*() {

vpr/src/route/rr_graph.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include <cstdio>
2-
#include <cstring>
32
#include <cmath>
4-
#include <ctime>
53
#include <algorithm>
64
#include <utility>
75
#include <vector>
@@ -21,7 +19,6 @@
2119
#include "rr_graph_utils.h"
2220
#include "rr_graph.h"
2321
#include "rr_graph_area.h"
24-
#include "rr_graph_utils.h"
2522
#include "rr_graph2.h"
2623
#include "rr_graph_sbox.h"
2724
#include "rr_graph_timing_params.h"

0 commit comments

Comments
 (0)