@@ -249,23 +249,25 @@ t_rt_node* update_route_tree(t_heap* hptr, int target_net_pin_index, SpatialRout
249249 return (sink_rt_node);
250250}
251251
252- /* Records all nodes from the rt_tree into the rr_node_to_rt_node lookup, which
253- * maps the node's corresponding rr_node index (inode) to the node itself. This
254- * is done recursively, starting from the root of the tree to its leafs (SINKs)
255- * in a depth-first traversal. The rt_node we are currently processing should not
256- * have had its rr_node index mapped previously, with the exception of SINK nodes.
257- * Some netlists and input pin equivalence can lead to us routing to the same SINK
258- * more than once on a net (resulting in different rt_nodes sharing the same rr_node
259- * index). Hence for SINKs we assert on a weaker condition that if the rr_node index
260- * corresponding to this SINK is already mapped, the rr_node_to_rt_node mapping
261- * structure must be pointing to a different rt_node containing the SINK. */
252+ /* Records all nodes from the current routing (rt_tree) into the rr_node_to_rt_node
253+ * lookup, which maps the node's corresponding rr_node index (inode) to the node
254+ * itself. This is done recursively, starting from the root of the tree to its leafs
255+ * (SINKs) in a depth-first traversal. The rt_node we are currently processing has
256+ * either not been added to the routing for this net before or if it was added, the
257+ * rr_node_to_rt_node mapping structure should point back at the rt_node itself so
258+ * we are just branching off that point. Exceptions are the SINK nodes, some
259+ * netlists and input pin equivalence can lead to us routing to the same SINK more
260+ * than once on a net (resulting in different rt_nodes sharing the same rr_node index).
261+ * Hence for SINKs we assert on a weaker condition that if this SINK is already in the
262+ * rt_tree, the rr_node_to_rt_node mapping structure points to a legal rt_node (but
263+ * not necessarily the only one) containing the SINK */
262264void add_route_tree_to_rr_node_lookup (t_rt_node* node) {
263265 if (node) {
264266 auto & device_ctx = g_vpr_ctx.device ();
265267 if (device_ctx.rr_nodes [node->inode ].type () == SINK) {
266- VTR_ASSERT (rr_node_to_rt_node[node->inode ] == nullptr || rr_node_to_rt_node[node->inode ] != node);
268+ VTR_ASSERT (rr_node_to_rt_node[node->inode ] == nullptr || rr_node_to_rt_node[node->inode ]-> inode == node-> inode );
267269 } else {
268- VTR_ASSERT (rr_node_to_rt_node[node->inode ] == nullptr );
270+ VTR_ASSERT (rr_node_to_rt_node[node->inode ] == nullptr || rr_node_to_rt_node[node-> inode ] == node );
269271 }
270272
271273 rr_node_to_rt_node[node->inode ] = node;
0 commit comments