28
28
static t_bb get_net_bounding_box (const AtomNetId atom_net_id) {
29
29
const auto & route_trees = g_vpr_ctx.routing ().route_trees ;
30
30
const auto & rr_graph = g_vpr_ctx.device ().rr_graph ;
31
- const bool flat_router = g_vpr_ctx.routing ().is_flat ;
32
31
33
32
// Lambda to get the bounding box of a route tree
34
33
auto route_tree_bb = [](const RRGraphView& rr_graph, const RouteTree& route_tree) {
@@ -46,21 +45,26 @@ static t_bb get_net_bounding_box(const AtomNetId atom_net_id) {
46
45
// Iterate over all nodes in the route tree and update the bounding box
47
46
for (auto & rt_node : route_tree.all_nodes ()) {
48
47
RRNodeId inode = rt_node.inode ;
48
+
49
49
if (rr_graph.node_xlow (inode) < bb.xmin )
50
50
bb.xmin = rr_graph.node_xlow (inode);
51
51
if (rr_graph.node_xhigh (inode) > bb.xmax )
52
52
bb.xmax = rr_graph.node_xhigh (inode);
53
+
53
54
if (rr_graph.node_ylow (inode) < bb.ymin )
54
55
bb.ymin = rr_graph.node_ylow (inode);
55
- if (rr_graph.node_layer (inode) > bb.layer_min )
56
+ if (rr_graph.node_yhigh (inode) > bb.ymax )
57
+ bb.ymax = rr_graph.node_yhigh (inode);
58
+
59
+ if (rr_graph.node_layer (inode) < bb.layer_min )
56
60
bb.layer_min = rr_graph.node_layer (inode);
57
61
if (rr_graph.node_layer (inode) > bb.layer_max )
58
62
bb.layer_max = rr_graph.node_layer (inode);
59
63
}
60
64
return bb;
61
65
};
62
66
63
- if (flat_router ) {
67
+ if (g_vpr_ctx. routing (). is_flat ) {
64
68
// If flat router is used, route tree data structure can be used
65
69
// directly to get the bounding box of the net
66
70
const auto & route_tree = route_trees[atom_net_id];
@@ -85,6 +89,9 @@ static t_bb get_net_bounding_box(const AtomNetId atom_net_id) {
85
89
continue ;
86
90
bbs.push_back (route_tree_bb (rr_graph, *route_tree));
87
91
}
92
+ if (bbs.empty ()) {
93
+ return t_bb ();
94
+ }
88
95
// Assign the first cluster net's bounding box to the final bounding box
89
96
// and then iteratively update it with the union of bounding boxes of
90
97
// all cluster nets
@@ -97,6 +104,7 @@ static t_bb get_net_bounding_box(const AtomNetId atom_net_id) {
97
104
max_bb.layer_min = std::min (bbs[i].layer_min , max_bb.layer_min );
98
105
max_bb.layer_max = std::max (bbs[i].layer_max , max_bb.layer_max );
99
106
}
107
+ return max_bb;
100
108
} else {
101
109
// If there is no cluster net corresponding to the atom net,
102
110
// it means the net is completely absorbed into a cluster block.
@@ -192,7 +200,7 @@ void generate_net_timing_report(const std::string& prefix,
192
200
os << " # Revision: " << vtr::VCS_REVISION << std::endl;
193
201
os << " # For each net, the timing information is reported in the following format:" << std::endl;
194
202
os << " # netname : Fanout : "
195
- << " bounding_box_xmin,bounding_box_ymin,bounding_box_xmax,bounding_box_ymax : "
203
+ << " ( bounding_box_xmin,bounding_box_ymin,bounding_box_layermin),( bounding_box_xmax,bounding_box_ymax,bounding_box_layermax) : "
196
204
<< " source_instance <slack_on source pin> : "
197
205
<< " <load pin name1> <slack on load pin name1> <net delay for this net> : "
198
206
<< " <load pin name2> <slack on load pin name2> <net delay for this net> : ..."
@@ -219,7 +227,8 @@ void generate_net_timing_report(const std::string& prefix,
219
227
const auto & net_bb = get_net_bounding_box (net);
220
228
os << net_name << " : "
221
229
<< fanout << " : "
222
- << net_bb.xmin << " ," << net_bb.ymin << " ," << net_bb.xmax << " ," << net_bb.ymax << " : "
230
+ << " (" << net_bb.xmin << " ," << net_bb.ymin << " ," << net_bb.layer_min << " ),("
231
+ << net_bb.xmax << " ," << net_bb.ymax << " ," << net_bb.layer_max << " ) : "
223
232
<< atom_netlist.pin_name (source_pin).c_str () << " " << source_pin_slack << " : " ;
224
233
225
234
/* Iterate over all fanout pins and print their timing information */
0 commit comments