Index: trunk/src/plugins/rt_topo/crbs_cdt.c =================================================================== --- trunk/src/plugins/rt_topo/crbs_cdt.c (revision 1358) +++ trunk/src/plugins/rt_topo/crbs_cdt.c (revision 1359) @@ -96,9 +96,9 @@ } e->is_constrained = 1; } -#warning TODO: this 0.01 should be 0, grbs shoudl support virtual vias +#warning TODO: this should be 0,0 for copper and clearance once grbs supports convex implicit attachments for(n = 0; n < np.used; n+=2) - crbs_make_point(crbs, np.array[n], np.array[n+1], 0.01, 0, NULL); + crbs_make_point(crbs, np.array[n], np.array[n+1], rt_topo_cfg.wire_thick/2, rt_topo_cfg.wire_clr, NULL); vtd0_uninit(&np); } Index: trunk/src/plugins/rt_topo/crbs_route.c =================================================================== --- trunk/src/plugins/rt_topo/crbs_route.c (revision 1358) +++ trunk/src/plugins/rt_topo/crbs_route.c (revision 1359) @@ -66,6 +66,7 @@ grbs_detached_addr_t *from = from_, *to = to_; double ex, ey, tx, ty, tune = 1; long cost; + int from_dir = 0, to_dir = 0; switch(from->type & 0x0F) { case ADDR_ARC_CONCAVE: @@ -74,6 +75,7 @@ ex = from->pt->x + cos(from->new_sa + from->new_da) * from->new_r; ey = from->pt->y + sin(from->new_sa + from->new_da) * from->new_r; cost = floor(from->new_r * from->new_da * DIST_HEUR_MULT * tune); + from_dir = from->new_adir; break; case ADDR_POINT: @@ -83,13 +85,26 @@ break; } - if ((to->type & 0x0F) == ADDR_ARC_CONCAVE) - tune = tune * (2.0/3.0); + switch(to->type & 0x0F) { + case ADDR_ARC_CONCAVE: + tune = tune * (2.0/3.0); + case ADDR_ARC_CONVEX: + to_dir = to->new_adir; + case ADDR_POINT: + break; + } tx = to->pt->x + cos(to->new_sa) * to->new_r; ty = to->pt->y + sin(to->new_sa) * to->new_r; cost += crbs_dist_heur(ex, ey, tx, ty); + /* in an arc-arc path prefer not switching between cw and ccw by increasing + the path cost by 1% on a switch - trying to keep the situation convex; + this is supposed to help in situations when there are two equally cheap + paths without blocking switches where they are reasonable */ + if ((from_dir != 0) && (to_dir != 0) && (from_dir != to_dir)) + cost *= 1.01; + return cost; }