00069 {
00070
00071
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;
00079 t_mst_edge **mst = NULL;
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
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
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
00143
00144
00145
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;
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
00208 #endif
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
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 }