Skip to content

Commit 0280ba9

Browse files
Merge pull request #2926 from verilog-to-routing/overuse_node_report
Overused Node Report
2 parents eb54084 + b9d7b1a commit 0280ba9

File tree

2 files changed

+43
-17
lines changed

2 files changed

+43
-17
lines changed

vpr/src/route/overuse_report.cpp

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,28 @@ static void report_congested_nets(const Netlist<>& net_list,
3030

3131
static void log_overused_nodes_header();
3232
static void log_single_overused_node_status(int overuse_index, RRNodeId inode);
33-
void print_block_pins_nets(std::ostream& os,
34-
t_physical_tile_type_ptr physical_type,
35-
int layer,
36-
int root_x,
37-
int root_y,
38-
int pin_physical_num,
39-
const std::map<RRNodeId, std::set<ParentNetId>>& rr_node_to_net_map);
33+
34+
/**
35+
* @brief When reporting overused IPIN/OPIN nodes, we also print the nets
36+
* connected to other pins of the same block. This information may help
37+
* the user understand why the node is overused or why other pins are not
38+
* being utilized for routing the net.
39+
*
40+
* @param os The output stream to write the information to.
41+
* @param physical_type The physical type of the block.
42+
* @param layer The layer number of the block.
43+
* @param root_x The x coordinate of the root of the block.
44+
* @param root_y The y coordinate of the root of the block.
45+
* @param pin_physical_num The physical number of the pin.
46+
* @param rr_node_to_net_map A map of RR nodes to the nets that pass through them.
47+
*/
48+
static void print_block_pins_nets(std::ostream& os,
49+
t_physical_tile_type_ptr physical_type,
50+
int layer,
51+
int root_x,
52+
int root_y,
53+
int pin_physical_num,
54+
const std::map<RRNodeId, std::set<ParentNetId>>& rr_node_to_net_map);
4055
/**
4156
* @brief Print out RR node overuse info in the VPR logfile.
4257
*
@@ -438,17 +453,18 @@ static void log_single_overused_node_status(int overuse_index, RRNodeId node_id)
438453
fflush(stdout);
439454
}
440455

441-
void print_block_pins_nets(std::ostream& os,
442-
t_physical_tile_type_ptr physical_type,
443-
int layer,
444-
int root_x,
445-
int root_y,
446-
int pin_physical_num,
447-
const std::map<RRNodeId, std::set<ParentNetId>>& rr_node_to_net_map) {
456+
static void print_block_pins_nets(std::ostream& os,
457+
t_physical_tile_type_ptr physical_type,
458+
int layer,
459+
int root_x,
460+
int root_y,
461+
int pin_physical_num,
462+
const std::map<RRNodeId, std::set<ParentNetId>>& rr_node_to_net_map) {
448463
const auto& rr_graph = g_vpr_ctx.device().rr_graph;
449464

450465
t_pin_range pin_num_range;
451-
if (is_pin_on_tile(physical_type, pin_physical_num)) {
466+
bool pin_on_tile = is_pin_on_tile(physical_type, pin_physical_num);
467+
if (pin_on_tile) {
452468
pin_num_range.low = 0;
453469
pin_num_range.high = physical_type->num_pins - 1;
454470
} else {
@@ -470,7 +486,13 @@ void print_block_pins_nets(std::ostream& os,
470486
for (int pin = pin_num_range.low; pin <= pin_num_range.high; pin++) {
471487
t_rr_type rr_type = (get_pin_type_from_pin_physical_num(physical_type, pin) == DRIVER) ? t_rr_type::OPIN : t_rr_type::IPIN;
472488
RRNodeId node_id = get_pin_rr_node_id(rr_graph.node_lookup(), physical_type, layer, root_x, root_y, pin);
473-
VTR_ASSERT(node_id != RRNodeId::INVALID());
489+
// When flat router is enabled, RR Node chains collapse into a single node. Thus, when
490+
// looking up the RR Node ID, it may return an invalid node ID. In this case, we skip
491+
// this pin.
492+
if (!pin_on_tile && node_id == RRNodeId::INVALID()) {
493+
continue;
494+
}
495+
VTR_ASSERT(node_id.is_valid());
474496
auto search_result = rr_node_to_net_map.find(node_id);
475497
if (rr_type == t_rr_type::OPIN) {
476498
os << " OPIN - ";

vpr/src/route/overuse_report.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
* All the nets passing through an overused RR node are flagged as congested nets.
2121
*/
2222

23-
///@brief Print out RR node overuse info in the VPR logfile.
23+
/**
24+
* @brief Print out RR node overuse info in the VPR logfile.
25+
*
26+
* @param max_logged_overused_rr_nodes The maximum number of overused RR nodes to log.
27+
*/
2428
void log_overused_nodes_status(int max_logged_overused_rr_nodes);
2529

2630
///@brief Print out RR node overuse info in a post-VPR report file.

0 commit comments

Comments
 (0)