Skip to content

Commit 63cbe06

Browse files
add rr_chanz_segment_width to DeviceContext
1 parent fd6d5c5 commit 63cbe06

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

vpr/src/base/vpr_context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ struct DeviceContext : public Context {
267267
vtr::NdMatrix<int, 3> rr_chanx_segment_width;
268268
/// Stores the number of CHANY wire segments in each routing channel segment at [layer][x][y]
269269
vtr::NdMatrix<int, 3> rr_chany_segment_width;
270+
/// Stores the number of CHANZ wire segments along Z-axis at each (x, y) location.
271+
vtr::NdMatrix<int, 2> rr_chanz_segment_width;
270272

271273
/// Stores the maximum channel segment width in each horizontal channel
272274
std::vector<int> rr_chanx_width;

vpr/src/route/rr_graph_generation/rr_graph.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,13 +1017,19 @@ static void alloc_and_init_channel_width() {
10171017

10181018
vtr::NdMatrix<int, 3>& chanx_width = mutable_device_ctx.rr_chanx_segment_width;
10191019
vtr::NdMatrix<int, 3>& chany_width = mutable_device_ctx.rr_chany_segment_width;
1020+
vtr::NdMatrix<int, 2>& chanz_width = mutable_device_ctx.rr_chanz_segment_width;
10201021

10211022
chanx_width.resize({grid.get_num_layers(), grid.width(), grid.height()});
10221023
chany_width.resize({grid.get_num_layers(), grid.width(), grid.height()});
10231024

10241025
chanx_width.fill(0);
10251026
chany_width.fill(0);
10261027

1028+
if (grid.get_num_layers() > 1) {
1029+
chanz_width.resize({grid.width(), grid.height()});
1030+
chanz_width.fill(0);
1031+
}
1032+
10271033
for (RRNodeId node_id : rr_graph.nodes()) {
10281034
e_rr_type rr_type = rr_graph.node_type(node_id);
10291035

@@ -1039,6 +1045,10 @@ static void alloc_and_init_channel_width() {
10391045
for (int y = rr_graph.node_ylow(node_id); y <= rr_graph.node_yhigh(node_id); y++) {
10401046
chany_width[layer][x][y] += rr_graph.node_capacity(node_id);
10411047
}
1048+
} else if (rr_type == e_rr_type::CHANZ) {
1049+
int x = rr_graph.node_xlow(node_id);
1050+
int y = rr_graph.node_ylow(node_id);
1051+
chanz_width[x][y]++;
10421052
}
10431053
}
10441054

0 commit comments

Comments
 (0)