Skip to content

Commit 688ac55

Browse files
committed
Issue#1467: Added block information for the IPIN/OPIN grid location in the overuse report
1 parent 461f853 commit 688ac55

File tree

1 file changed

+101
-36
lines changed

1 file changed

+101
-36
lines changed

vpr/src/route/overuse_report.cpp

Lines changed: 101 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
#include "globals.h"
55
#include "vtr_log.h"
66

7+
static void report_overused_ipin_opin(std::ostream& os, RRNodeId node_id);
8+
static void report_overused_chanx_chany(std::ostream& os, RRNodeId node_id);
9+
static void report_overused_source_sink(std::ostream& os, RRNodeId node_id);
10+
static void report_congested_nets(std::ostream& os, const std::set<ClusterNetId>& congested_nets);
11+
712
static void log_overused_nodes_header();
813
static void log_single_overused_node_status(int overuse_index, RRNodeId inode);
914

@@ -34,9 +39,8 @@ void log_overused_nodes_status(int max_logged_overused_rr_nodes) {
3439
void report_overused_nodes() {
3540
const auto& device_ctx = g_vpr_ctx.device();
3641
const auto& route_ctx = g_vpr_ctx.routing();
37-
const auto& clb_nlist = g_vpr_ctx.clustering().clb_nlist;
3842

39-
//Generate overuse infor lookup table
43+
//Generate overuse info lookup table
4044
std::map<RRNodeId, std::set<ClusterNetId>> nodes_to_nets_lookup;
4145
generate_overused_nodes_to_congested_net_lookup(nodes_to_nets_lookup);
4246

@@ -45,8 +49,7 @@ void report_overused_nodes() {
4549
os << "Overused nodes information report on the final failed routing attempt" << '\n';
4650
os << "Total number of overused nodes = " << nodes_to_nets_lookup.size() << '\n';
4751

48-
int inode = 0;
49-
52+
size_t inode = 0;
5053
for (const auto& lookup_pair : nodes_to_nets_lookup) {
5154
const RRNodeId node_id = lookup_pair.first;
5255
const auto& congested_nets = lookup_pair.second;
@@ -57,45 +60,33 @@ void report_overused_nodes() {
5760
os << "Overused RR node #" << inode << '\n';
5861
os << "Node id = " << size_t(node_id) << '\n';
5962
os << "Occupancy = " << route_ctx.rr_node_route_inf[size_t(node_id)].occ() << '\n';
60-
os << "Capacity = " << device_ctx.rr_nodes.node_capacity(node_id) << '\n';
61-
os << "Node type = " << device_ctx.rr_nodes.node_type_string(node_id) << '\n';
62-
os << "PTC number = " << device_ctx.rr_nodes.node_ptc_num(node_id) << '\n';
63-
os << "Xlow = " << device_ctx.rr_nodes.node_xlow(node_id) << ", ";
64-
os << "Ylow = " << device_ctx.rr_nodes.node_ylow(node_id) << '\n';
65-
os << "Xhigh = " << device_ctx.rr_nodes.node_xhigh(node_id) << ", ";
66-
os << "Yhigh = " << device_ctx.rr_nodes.node_yhigh(node_id) << '\n';
63+
os << "Capacity = " << device_ctx.rr_nodes.node_capacity(node_id) << "\n\n";
6764

6865
//Report Selective info
69-
auto node_type = device_ctx.rr_nodes.node_type(node_id);
70-
71-
if (node_type == e_rr_type::CHANX || node_type == e_rr_type::CHANY) {
72-
os << "Direction = " << device_ctx.rr_nodes.node_direction_string(node_id) << '\n';
66+
os << "Node type = " << device_ctx.rr_nodes.node_type_string(node_id) << '\n';
7367

74-
os << "Resistance = " << device_ctx.rr_nodes.node_R(node_id) << '\n';
75-
os << "Capacitance = " << device_ctx.rr_nodes.node_C(node_id) << '\n';
76-
} else if (node_type == e_rr_type::IPIN || node_type == e_rr_type::OPIN) {
77-
os << "Side = " << device_ctx.rr_nodes.node_side_string(node_id) << '\n';
68+
auto node_type = device_ctx.rr_nodes.node_type(node_id);
69+
switch (node_type) {
70+
case IPIN:
71+
case OPIN:
72+
report_overused_ipin_opin(os, node_id);
73+
break;
74+
case CHANX:
75+
case CHANY:
76+
report_overused_chanx_chany(os, node_id);
77+
break;
78+
case SOURCE:
79+
case SINK:
80+
report_overused_source_sink(os, node_id);
81+
break;
82+
83+
default:
84+
break;
7885
}
7986

8087
os << "-----------------------------\n"; //Node/net info separation line
88+
report_congested_nets(os, congested_nets);
8189

82-
//Reported corresponding congested nets
83-
int inet = 0;
84-
85-
os << "Number of nets passing through this RR node = " << congested_nets.size() << '\n';
86-
for (ClusterNetId net_id : congested_nets) {
87-
ClusterBlockId block_id = clb_nlist.net_driver_block(net_id);
88-
89-
os << "Net #" << inet << ": ";
90-
os << "Net ID = " << size_t(net_id) << ", ";
91-
os << "Net name = " << clb_nlist.net_name(net_id) << ", ";
92-
os << "Driving block name = " << clb_nlist.block_pb(block_id)->name << ", ";
93-
os << "Driving block type = " << clb_nlist.block_type(block_id)->name << '\n';
94-
95-
++inet;
96-
}
97-
98-
os << '\n';
9990
++inode;
10091
}
10192

@@ -121,6 +112,80 @@ void generate_overused_nodes_to_congested_net_lookup(std::map<RRNodeId, std::set
121112
}
122113
}
123114

115+
static void report_overused_ipin_opin(std::ostream& os, RRNodeId node_id) {
116+
const auto& device_ctx = g_vpr_ctx.device();
117+
const auto& place_ctx = g_vpr_ctx.placement();
118+
119+
auto grid_x = device_ctx.rr_nodes.node_xlow(node_id);
120+
auto grid_y = device_ctx.rr_nodes.node_ylow(node_id);
121+
VTR_ASSERT_MSG(
122+
grid_x == device_ctx.rr_nodes.node_xhigh(node_id) && grid_y == device_ctx.rr_nodes.node_yhigh(node_id),
123+
"Non-track RR node should not span across multiple grid blocks.");
124+
125+
os << "Pin number = " << device_ctx.rr_nodes.node_pin_num(node_id) << '\n';
126+
os << "Side = " << device_ctx.rr_nodes.node_side_string(node_id) << "\n\n";
127+
128+
//Add block type for IPINs/OPINs in overused rr-node report
129+
const auto& clb_nlist = g_vpr_ctx.clustering().clb_nlist;
130+
auto& grid_info = place_ctx.grid_blocks[grid_x][grid_y];
131+
auto& grid_blocks = grid_info.blocks;
132+
133+
os << "Grid location: X = " << grid_x << ", Y = " << grid_y << '\n';
134+
os << "Number of blocks currently at this grid location = " << grid_info.usage << '\n';
135+
for (size_t iblock = 0; iblock < grid_blocks.size(); ++iblock) {
136+
ClusterBlockId block_id = grid_blocks[iblock];
137+
os << "Block #" << iblock << ": ";
138+
os << "Block name = " << clb_nlist.block_pb(block_id)->name << ", ";
139+
os << "Block type = " << clb_nlist.block_type(block_id)->name << '\n';
140+
}
141+
}
142+
143+
static void report_overused_chanx_chany(std::ostream& os, RRNodeId node_id) {
144+
const auto& device_ctx = g_vpr_ctx.device();
145+
146+
os << "Track number = " << device_ctx.rr_nodes.node_track_num(node_id) << '\n';
147+
os << "Direction = " << device_ctx.rr_nodes.node_direction_string(node_id) << "\n\n";
148+
149+
os << "Grid location: " << '\n';
150+
os << "Xlow = " << device_ctx.rr_nodes.node_xlow(node_id) << ", ";
151+
os << "Ylow = " << device_ctx.rr_nodes.node_ylow(node_id) << '\n';
152+
os << "Xhigh = " << device_ctx.rr_nodes.node_xhigh(node_id) << ", ";
153+
os << "Yhigh = " << device_ctx.rr_nodes.node_yhigh(node_id) << '\n';
154+
os << "Resistance = " << device_ctx.rr_nodes.node_R(node_id) << '\n';
155+
os << "Capacitance = " << device_ctx.rr_nodes.node_C(node_id) << '\n';
156+
}
157+
158+
static void report_overused_source_sink(std::ostream& os, RRNodeId node_id) {
159+
const auto& device_ctx = g_vpr_ctx.device();
160+
161+
auto grid_x = device_ctx.rr_nodes.node_xlow(node_id);
162+
auto grid_y = device_ctx.rr_nodes.node_ylow(node_id);
163+
VTR_ASSERT_MSG(
164+
grid_x == device_ctx.rr_nodes.node_xhigh(node_id) && grid_y == device_ctx.rr_nodes.node_yhigh(node_id),
165+
"Non-track RR node should not span across multiple grid blocks.");
166+
167+
os << "Class number = " << device_ctx.rr_nodes.node_class_num(node_id) << '\n';
168+
os << "Grid location: X = " << grid_x << ", Y = " << grid_y << '\n';
169+
}
170+
171+
//Reported congested nets at a specific rr node
172+
static void report_congested_nets(std::ostream& os, const std::set<ClusterNetId>& congested_nets) {
173+
const auto& clb_nlist = g_vpr_ctx.clustering().clb_nlist;
174+
os << "Number of nets passing through this RR node = " << congested_nets.size() << '\n';
175+
176+
size_t inet = 0;
177+
for (ClusterNetId net_id : congested_nets) {
178+
ClusterBlockId block_id = clb_nlist.net_driver_block(net_id);
179+
os << "Net #" << inet << ": ";
180+
os << "Net ID = " << size_t(net_id) << ", ";
181+
os << "Net name = " << clb_nlist.net_name(net_id) << ", ";
182+
os << "Driving block name = " << clb_nlist.block_pb(block_id)->name << ", ";
183+
os << "Driving block type = " << clb_nlist.block_type(block_id)->name << '\n';
184+
++inet;
185+
}
186+
os << '\n';
187+
}
188+
124189
static void log_overused_nodes_header() {
125190
VTR_LOG("Routing Failure Diagnostics: Printing Overused Nodes Information\n");
126191
VTR_LOG("------ ------- ---------- --------- -------- ------------ ------- ------- ------- ------- ------- -------\n");

0 commit comments

Comments
 (0)