Index: trunk/src/plugins/rt_topo/crbs.h =================================================================== --- trunk/src/plugins/rt_topo/crbs.h (revision 1446) +++ trunk/src/plugins/rt_topo/crbs.h (revision 1447) @@ -63,6 +63,7 @@ void *first_mark, *target_mark; grbs_2net_t *routing_tn; int max_ripup; /* how many times are we willing to rip up a 2net (total within a layer routing) */ + long max_hop_cnt; /* stop hopeless searches after this many hops */ } crbs_t; int rt_topo_crbs(rtrnd_t *ctx, rt_topo_laa2rbs_t *src); Index: trunk/src/plugins/rt_topo/crbs_route.c =================================================================== --- trunk/src/plugins/rt_topo/crbs_route.c (revision 1446) +++ trunk/src/plugins/rt_topo/crbs_route.c (revision 1447) @@ -483,12 +483,14 @@ ast.get_mark = crbs_ast_get_mark; ast.user_data = crbs; + crbs->max_hop_cnt = hop_cnt + crbs->grbs.all_points.length * 1000.0 * rt_topo_cfg.max_hop_mult; + cnt_grbs++; - printf(" route_net: from P%ld to P%ld (step 3_GRBS_routed_%d)\n", + printf(" route_net: from P%ld to P%ld (step 3_GRBS_routed_%d) max_hop %ld\n", ((crbs_point_t *)(ctn->cstart->data))->gpt->uid, ((crbs_point_t *)(ctn->cend->data))->gpt->uid, - cnt_grbs); + cnt_grbs, crbs->max_hop_cnt); sres = usrch_a_star_start(&ast, first); if (sres != USRCH_RES_SUCCESS) { @@ -496,7 +498,12 @@ goto err; } - while((sres = usrch_a_star_iter(&ast)) == USRCH_RES_CONTINUE) ; + while((sres = usrch_a_star_iter(&ast)) == USRCH_RES_CONTINUE) { + if (hop_cnt > crbs->max_hop_cnt) { + printf(" a* search fail: giving up on too many hops\n"); + goto err; + } + } if (sres != USRCH_RES_FOUND) { printf(" a* search fail 2\n"); Index: trunk/src/plugins/rt_topo/rt_topo.c =================================================================== --- trunk/src/plugins/rt_topo/rt_topo.c (revision 1446) +++ trunk/src/plugins/rt_topo/rt_topo.c (revision 1447) @@ -44,6 +44,8 @@ RTRND_CONF_COORD("via_clr", 0.20, 0.01, 10, "clearance around via copper", &rt_topo_cfg.via_clr) RTRND_CONF_DOUBLE("beta", 50, 0, 100, "via vs. wire length preference; high value = short wires, low value = less vias", &rt_topo_cfg.beta) RTRND_CONF_BOOLEAN("mid_virt", 0, "split long triangulation edges in half by inserting 0 sized virtual points; makes more routes possible but also makes tracks longer with unnecessary curves and detours", &rt_topo_cfg.beta) + RTRND_CONF_DOUBLE("max_hop_mult", 1, 0.1, 10000, "when to give up the search for a route on a layer; higher value means give up later", &rt_topo_cfg.max_hop_mult) + /* RTRND_CONF_BOOLEAN("octilinear", 0, "draw 90 and 45 degree lines", &rt_topo_cfg.octilin)*/ RTRND_CONF_TERMINATE }; Index: trunk/src/plugins/rt_topo/rt_topo.h =================================================================== --- trunk/src/plugins/rt_topo/rt_topo.h (revision 1446) +++ trunk/src/plugins/rt_topo/rt_topo.h (revision 1447) @@ -18,6 +18,7 @@ /* configured */ double wire_thick, wire_clr, via_dia, via_clr, beta; int octilin, algo, mid_virt; + double max_hop_mult; /* calculated */ double alpha, alpha2;