SRC/route_directed_search.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

boolean try_directed_search_route (struct s_router_opts router_opts, t_ivec **fb_opins_used_locally, int width_fac, t_mst_edge **mst)

Function Documentation

boolean try_directed_search_route ( struct s_router_opts  router_opts,
t_ivec **  fb_opins_used_locally,
int  width_fac,
t_mst_edge **  mst 
)

Definition at line 48 of file route_directed_search.c.

00052 {
00053 
00054 /* Iterated maze router ala Pathfinder Negotiated Congestion algorithm,  *
00055  * (FPGA 95 p. 111).  Returns TRUE if it can route this FPGA, FALSE if   *
00056  * it can't.                                                             */
00057 
00058     float pres_fac;
00059     boolean success, is_routable, rip_up_local_opins;
00060     int itry, inet;
00061 
00062     /* char msg[100]; */
00063 
00064     /* mst not built as good as it should, ideally, just have it after placement once only
00065          however, rr_node numbers changed when the channel width changes so forced to do it here */
00066     if(mst)
00067         {
00068             for(inet = 0; inet < num_nets; inet++)
00069                 {
00070                     free(mst[inet]);
00071                     mst[inet] = get_mst_of_net(inet);
00072                 }
00073         }
00074 
00075 /* Usually the first iteration uses a very small (or 0) pres_fac to find  *
00076  * the shortest path and get a congestion map.  For fast compiles, I set  *
00077  * pres_fac high even for the first iteration.                            */
00078 
00079     pres_fac = router_opts.first_iter_pres_fac;
00080 
00081     for(itry = 1; itry <= router_opts.max_router_iterations; itry++)
00082         {
00083 
00084             for(inet = 0; inet < num_nets; inet++)
00085                 {
00086                     if(net[inet].is_global == FALSE)
00087                         {       /* Skip global nets. */
00088 
00089                             is_routable =
00090                                 directed_search_route_net(inet, pres_fac,
00091                                                           router_opts.
00092                                                           astar_fac,
00093                                                           router_opts.
00094                                                           bend_cost, mst);
00095 
00096                             /* Impossible to route? (disconnected rr_graph) */
00097 
00098                             if(!is_routable)
00099                                 {
00100                                     printf("Routing failed.\n");
00101                                     return (FALSE);
00102                                 }
00103 
00104                         }
00105                 }
00106 
00107             /* Make sure any FB OPINs used up by subblocks being hooked directly     *
00108              * to them are reserved for that purpose.                                 */
00109 
00110             if(itry == 1)
00111                 rip_up_local_opins = FALSE;
00112             else
00113                 rip_up_local_opins = TRUE;
00114 
00115             reserve_locally_used_opins(pres_fac, rip_up_local_opins,
00116                                        fb_opins_used_locally);
00117 
00118             success = feasible_routing();
00119             if(success)
00120                 {
00121                     printf
00122                         ("Successfully routed after %d routing iterations by Directed Search.\n",
00123                          itry);
00124                     return (TRUE);
00125                 }
00126 #if 0
00127             else
00128                 {
00129                     sprintf(msg,
00130                             "After iteration %d routing failed (A*) with a channel width factor of %d and Fc_int of %d, Fs_int of %d.",
00131                             itry, width_fac, Fc_int, Fs_int);
00132                     init_draw_coords(pins_per_clb);
00133                     update_screen(MAJOR, msg, ROUTING, FALSE);
00134                 }
00135 #endif
00136 
00137 
00138             if(itry == 1)
00139                 {
00140                     pres_fac = router_opts.initial_pres_fac;
00141                     pathfinder_update_cost(pres_fac, 0.);       /* Acc_fac=0 for first iter. */
00142                 }
00143             else
00144                 {
00145                     pres_fac *= router_opts.pres_fac_mult;
00146                     pathfinder_update_cost(pres_fac, router_opts.acc_fac);
00147                 }
00148 
00149         }
00150 
00151     printf("Routing failed.\n");
00152 
00153     return (FALSE);
00154 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Tue Jan 5 15:26:13 2010 for VPR5.0 by  doxygen 1.6.1