Skip to content

Commit 8908655

Browse files
committed
Replaced calls to node.capacity() with
rr_graph.node_capacity(RRNodeId(inode)) Signed-off-by: Ethan Rogers <[email protected]>
1 parent 93ec814 commit 8908655

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

vpr/src/route/route_tree_timing.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,13 +1276,14 @@ static void print_node_inf(const t_rt_node* rt_node) {
12761276

12771277
static void print_node_congestion(const t_rt_node* rt_node) {
12781278
auto& device_ctx = g_vpr_ctx.device();
1279+
const auto& rr_graph = device_ctx.rr_graph;
12791280
auto& route_ctx = g_vpr_ctx.routing();
12801281

12811282
int inode = rt_node->inode;
12821283
const auto& node_inf = route_ctx.rr_node_route_inf[inode];
1283-
const auto& node = device_ctx.rr_nodes[inode];
1284+
const short& node_capacity = rr_graph.node_capacity(RRNodeId(inode));
12841285
VTR_LOG("%2d %2d|%-6d-> ", node_inf.acc_cost, rt_node->Tdel,
1285-
node_inf.occ(), node.capacity(), inode);
1286+
node_inf.occ(), node_capacity, inode);
12861287
}
12871288

12881289
void print_route_tree_inf(const t_rt_node* rt_root) {

vpr/src/route/route_util.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,23 @@ vtr::Matrix<float> calculate_routing_avail(t_rr_type rr_type) {
6161
vtr::Matrix<float> avail({{device_ctx.grid.width(), device_ctx.grid.height()}}, 0.);
6262
for (size_t inode = 0; inode < device_ctx.rr_nodes.size(); ++inode) {
6363
auto& rr_node = device_ctx.rr_nodes[inode];
64+
const short& rr_node_capacity = rr_graph.node_capacity(RRNodeId(inode));
6465

6566
if (rr_graph.node_type(RRNodeId(inode)) == CHANX && rr_type == CHANX) {
6667
VTR_ASSERT(rr_graph.node_type(RRNodeId(inode)) == CHANX);
6768
VTR_ASSERT(rr_node.ylow() == rr_node.yhigh());
6869

6970
int y = rr_node.ylow();
7071
for (int x = rr_node.xlow(); x <= rr_node.xhigh(); ++x) {
71-
avail[x][y] += rr_node.capacity();
72+
avail[x][y] += rr_node_capacity;
7273
}
7374
} else if (rr_graph.node_type(RRNodeId(inode)) == CHANY && rr_type == CHANY) {
7475
VTR_ASSERT(rr_graph.node_type(RRNodeId(inode)) == CHANY);
7576
VTR_ASSERT(rr_node.xlow() == rr_node.xhigh());
7677

7778
int x = rr_node.xlow();
7879
for (int y = rr_node.ylow(); y <= rr_node.yhigh(); ++y) {
79-
avail[x][y] += rr_node.capacity();
80+
avail[x][y] += rr_node_capacity;
8081
}
8182
}
8283
}

vpr/src/route/router_lookahead_sampling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static std::tuple<int, int, int> get_node_info(const t_rr_node& node, int num_se
134134
return std::tuple<int, int, int>(OPEN, OPEN, OPEN);
135135
}
136136

137-
if (node.capacity() == 0 || node.num_edges() == 0) {
137+
if (rr_graph.node_capacity(node.id()) == 0 || node.num_edges() == 0) {
138138
return std::tuple<int, int, int>(OPEN, OPEN, OPEN);
139139
}
140140

@@ -205,7 +205,7 @@ std::vector<SampleRegion> find_sample_regions(int num_segments) {
205205
std::vector<vtr::Rect<int>> bounding_box_for_segment(num_segments, vtr::Rect<int>());
206206
for (auto& node : rr_nodes) {
207207
if (rr_graph.node_type(node.id()) != CHANX && rr_graph.node_type(node.id()) != CHANY) continue;
208-
if (node.capacity() == 0 || node.num_edges() == 0) continue;
208+
if (rr_graph.node_capacity(node.id()) == 0 || node.num_edges() == 0) continue;
209209
int seg_index = device_ctx.rr_indexed_data[node.cost_index()].seg_index;
210210

211211
VTR_ASSERT(seg_index != OPEN);

vpr/src/route/rr_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2483,7 +2483,7 @@ std::string describe_rr_node(int inode) {
24832483
msg += vtr::string_fmt(" class: %d", rr_node.class_num());
24842484
}
24852485

2486-
msg += vtr::string_fmt(" capacity: %d", rr_node.capacity());
2486+
msg += vtr::string_fmt(" capacity: %d", rr_graph.node_capacity(RRNodeId(inode)));
24872487
msg += vtr::string_fmt(" fan-in: %d", rr_node.fan_in());
24882488
msg += vtr::string_fmt(" fan-out: %d", rr_node.num_edges());
24892489

vpr/src/route/rr_graph_uxsdcxx_serializer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,8 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
801801
}
802802

803803
inline unsigned int get_node_capacity(const t_rr_node& node) final {
804-
return node.capacity();
804+
const auto& rr_graph = (*rr_graph_);
805+
return rr_graph.node_capacity(node.id());
805806
}
806807
inline unsigned int get_node_id(const t_rr_node& node) final {
807808
return size_t(node.id());

vpr/src/route/rr_node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class t_rr_node {
100100
short yhigh() const;
101101
signed short length() const;
102102

103-
short capacity() const;
103+
//short capacity() const; // ESR API This function has been replaced by RRGraphView::node_capacity()
104104

105105
short ptc_num() const;
106106
short pin_num() const; //Same as ptc_num() but checks that type() is consistent

vpr/src/route/rr_node_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ inline short t_rr_node::yhigh() const {
123123
return storage_->node_yhigh(id_);
124124
}
125125

126-
inline short t_rr_node::capacity() const {
126+
/*inline short t_rr_node::capacity() const { // no longer used
127127
return storage_->node_capacity(id_);
128-
}
128+
}*/
129129

130130
inline short t_rr_node::ptc_num() const {
131131
return storage_->node_ptc_num(id_);

0 commit comments

Comments
 (0)