SRC/place_and_route.h File Reference

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

Go to the source code of this file.

Data Structures

struct  s_fmap_cell

Defines

#define INFINITE   -1
#define NOT_FOUND   0
#define WNEED   1
#define WL   2
#define PROC_TIME   3

Typedefs

typedef struct s_fmap_cell t_fmap_cell

Functions

void place_and_route (enum e_operation operation, struct s_placer_opts placer_opts, char *place_file, char *net_file, char *arch_file, char *route_file, struct s_annealing_sched annealing_sched, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, t_subblock_data *subblock_data_ptr, t_chan_width_dist chan_width_dist)
void init_chan (int cfactor, t_chan_width_dist chan_width_dist)

Define Documentation

#define INFINITE   -1

Definition at line 1 of file place_and_route.h.

#define NOT_FOUND   0

Definition at line 2 of file place_and_route.h.

#define PROC_TIME   3

Definition at line 6 of file place_and_route.h.

#define WL   2

Definition at line 5 of file place_and_route.h.

#define WNEED   1

Definition at line 4 of file place_and_route.h.


Typedef Documentation

typedef struct s_fmap_cell t_fmap_cell

Function Documentation

void init_chan ( int  cfactor,
t_chan_width_dist  chan_width_dist 
)

Definition at line 653 of file place_and_route.c.

00655 {
00656 
00657 /* Assigns widths to channels (in tracks).  Minimum one track          * 
00658  * per channel.  io channels are io_rat * maximum in interior          * 
00659  * tracks wide.  The channel distributions read from the architecture  *
00660  * file are scaled by cfactor.                                         */
00661 
00662     float x, separation, chan_width_io;
00663     int nio, i;
00664     t_chan chan_x_dist, chan_y_dist;
00665 
00666     chan_width_io = chan_width_dist.chan_width_io;
00667     chan_x_dist = chan_width_dist.chan_x_dist;
00668     chan_y_dist = chan_width_dist.chan_y_dist;
00669 
00670 /* io channel widths */
00671 
00672     nio = (int)floor(cfactor * chan_width_io + 0.5);
00673     if(nio == 0)
00674         nio = 1;                /* No zero width channels */
00675 
00676     chan_width_x[0] = chan_width_x[ny] = nio;
00677     chan_width_y[0] = chan_width_y[nx] = nio;
00678 
00679     if(ny > 1)
00680         {
00681             separation = 1. / (ny - 2.);        /* Norm. distance between two channels. */
00682             x = 0.;             /* This avoids div by zero if ny = 2. */
00683             chan_width_x[1] = (int)floor(cfactor * comp_width(&chan_x_dist, x,
00684                                                               separation) +
00685                                          0.5);
00686 
00687             /* No zero width channels */
00688             chan_width_x[1] = max(chan_width_x[1], 1);
00689 
00690             for(i = 1; i < ny - 1; i++)
00691                 {
00692                     x = (float)i / ((float)(ny - 2.));
00693                     chan_width_x[i + 1] =
00694                         (int)floor(cfactor *
00695                                    comp_width(&chan_x_dist, x,
00696                                               separation) + 0.5);
00697                     chan_width_x[i + 1] = max(chan_width_x[i + 1], 1);
00698                 }
00699         }
00700 
00701     if(nx > 1)
00702         {
00703             separation = 1. / (nx - 2.);        /* Norm. distance between two channels. */
00704             x = 0.;             /* Avoids div by zero if nx = 2. */
00705             chan_width_y[1] = (int)floor(cfactor * comp_width(&chan_y_dist, x,
00706                                                               separation) +
00707                                          0.5);
00708 
00709             chan_width_y[1] = max(chan_width_y[1], 1);
00710 
00711             for(i = 1; i < nx - 1; i++)
00712                 {
00713                     x = (float)i / ((float)(nx - 2.));
00714                     chan_width_y[i + 1] =
00715                         (int)floor(cfactor *
00716                                    comp_width(&chan_y_dist, x,
00717                                               separation) + 0.5);
00718                     chan_width_y[i + 1] = max(chan_width_y[i + 1], 1);
00719                 }
00720         }
00721 #ifdef VERBOSE
00722     printf("\nchan_width_x:\n");
00723     for(i = 0; i <= ny; i++)
00724         printf("%d  ", chan_width_x[i]);
00725     printf("\n\nchan_width_y:\n");
00726     for(i = 0; i <= nx; i++)
00727         printf("%d  ", chan_width_y[i]);
00728     printf("\n\n");
00729 #endif
00730 
00731 }

Here is the call graph for this function:

Here is the caller graph for this function:

void place_and_route ( enum e_operation  operation,
struct s_placer_opts  placer_opts,
char *  place_file,
char *  net_file,
char *  arch_file,
char *  route_file,
struct s_annealing_sched  annealing_sched,
struct s_router_opts  router_opts,
struct s_det_routing_arch  det_routing_arch,
t_segment_inf segment_inf,
t_timing_inf  timing_inf,
t_subblock_data subblock_data_ptr,
t_chan_width_dist  chan_width_dist 
)

Definition at line 56 of file place_and_route.c.

00069 {
00070 
00071 /* This routine controls the overall placement and routing of a circuit. */
00072 
00073     char msg[BUFSIZE];
00074     int width_fac, inet, i;
00075     boolean success, Fc_clipped;
00076     float **net_delay, **net_slack;
00077     struct s_linked_vptr *net_delay_chunk_list_head;
00078     t_ivec **fb_opins_used_locally;     /* [0..num_blocks-1][0..num_class-1] */
00079     t_mst_edge **mst = NULL;    /* Make sure mst is never undefined */
00080     int max_pins_per_fb;
00081 
00082         Fc_clipped = FALSE;
00083 
00084     max_pins_per_fb = 0;
00085     for(i = 0; i < num_types; i++)
00086         {
00087             if(type_descriptors[i].num_pins > max_pins_per_fb)
00088                 {
00089                     max_pins_per_fb = type_descriptors[i].num_pins;
00090                 }
00091         }
00092 
00093     if(placer_opts.place_freq == PLACE_NEVER)
00094         {
00095             /* Read the placement from a file */
00096             read_place(place_file, net_file, arch_file, nx, ny, num_blocks,
00097                        block);
00098             sync_grid_to_blocks(num_blocks, block, nx, ny, grid);
00099         }
00100     else
00101         {
00102             assert((PLACE_ONCE == placer_opts.place_freq) ||
00103                    (PLACE_ALWAYS == placer_opts.place_freq));
00104 
00105             try_place(placer_opts, annealing_sched, chan_width_dist,
00106                       router_opts, det_routing_arch, segment_inf,
00107                       timing_inf, subblock_data_ptr, &mst);
00108             print_place(place_file, net_file, arch_file);
00109         }
00110     post_place_sync(num_blocks, block, subblock_data_ptr);
00111 
00112 
00113     fflush(stdout);
00114     if(operation == PLACE_ONLY)
00115         return;
00116 
00117     width_fac = router_opts.fixed_channel_width;
00118 
00119     /* If channel width not fixed, use binary search to find min W */
00120     if(NO_FIXED_CHANNEL_WIDTH == width_fac)
00121         {
00122             binary_search_place_and_route(placer_opts, place_file,
00123                                           net_file, arch_file, route_file,
00124                                           router_opts.full_stats, router_opts.verify_binary_search,
00125                                           annealing_sched, router_opts,
00126                                           det_routing_arch, segment_inf,
00127                                           timing_inf, subblock_data_ptr,
00128                                           chan_width_dist, mst);
00129         }
00130     else
00131         {
00132             if(det_routing_arch.directionality == UNI_DIRECTIONAL)
00133                 {
00134                     if(width_fac % 2 != 0)
00135                         {
00136                             printf
00137                                 ("Error: place_and_route.c: given odd chan width (%d) for udsd architecture\n",
00138                                  width_fac);
00139                             exit(1);
00140                         }
00141                 }
00142             /* Other constraints can be left to rr_graph to check since this is one pass routing */
00143 
00144 
00145             /* Allocate the major routing structures. */
00146 
00147             fb_opins_used_locally = alloc_route_structs(*subblock_data_ptr);
00148 
00149             if(timing_inf.timing_analysis_enabled)
00150                 {
00151                     net_slack =
00152                         alloc_and_load_timing_graph(timing_inf,
00153                                                     *subblock_data_ptr);
00154                     net_delay = alloc_net_delay(&net_delay_chunk_list_head);
00155                 }
00156             else
00157                 {
00158                     net_delay = NULL;   /* Defensive coding. */
00159                     net_slack = NULL;
00160                 }
00161 
00162             success =
00163                 try_route(width_fac, router_opts, det_routing_arch,
00164                           segment_inf, timing_inf, net_slack, net_delay,
00165                           chan_width_dist, fb_opins_used_locally, mst,
00166                           &Fc_clipped);
00167 
00168             if(Fc_clipped)
00169                 {
00170                     printf
00171                         ("Warning: Fc_output was too high and was clipped to full (maximum) connectivity.\n");
00172                 }
00173 
00174             if(success == FALSE)
00175                 {
00176                     printf
00177                         ("Circuit is unrouteable with a channel width factor of %d\n\n",
00178                          width_fac);
00179                     sprintf(msg,
00180                             "Routing failed with a channel width factor of %d.  ILLEGAL routing shown.",
00181                             width_fac);
00182                 }
00183 
00184             else
00185                 {
00186                     check_route(router_opts.route_type,
00187                                 det_routing_arch.num_switch,
00188                                 fb_opins_used_locally);
00189                     get_serial_num();
00190 
00191                     printf
00192                         ("Circuit successfully routed with a channel width factor of %d.\n\n",
00193                          width_fac);
00194 
00195                         routing_stats(router_opts.full_stats, router_opts.route_type,
00196                                   det_routing_arch.num_switch, segment_inf,
00197                                   det_routing_arch.num_segment,
00198                                   det_routing_arch.R_minW_nmos,
00199                                   det_routing_arch.R_minW_pmos,
00200                                   det_routing_arch.directionality,
00201                                   timing_inf.timing_analysis_enabled,
00202                                   net_slack, net_delay, *subblock_data_ptr);
00203 
00204                     print_route(route_file);
00205 
00206 #ifdef CREATE_ECHO_FILES
00207                     /*print_sink_delays("routing_sink_delays.echo"); */
00208 #endif /* CREATE_ECHO_FILES */
00209 
00210                     sprintf(msg,
00211                             "Routing succeeded with a channel width factor of %d.\n\n",
00212                             width_fac);
00213                 }
00214             free_subblock_data(subblock_data_ptr);
00215 
00216             init_draw_coords(max_pins_per_fb);
00217             update_screen(MAJOR, msg, ROUTING,
00218                           timing_inf.timing_analysis_enabled);
00219 
00220             if(timing_inf.timing_analysis_enabled)
00221                 {
00222                     assert(net_slack);
00223                     free_timing_graph(net_slack);
00224 
00225                     assert(net_delay);
00226                     free_net_delay(net_delay, &net_delay_chunk_list_head);
00227                 }
00228 
00229             free_route_structs(fb_opins_used_locally);
00230             fflush(stdout);
00231         }
00232 
00233     /*WMF: cleaning up memory usage */
00234     if(mst)
00235         {
00236             for(inet = 0; inet < num_nets; inet++)
00237                 {
00238                     assert(mst[inet]);
00239                     free(mst[inet]);
00240                 }
00241             free(mst);
00242             mst = NULL;
00243         }
00244 
00245 }

Here is the call graph for this function:

Here is the caller graph for this function:


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