243 int current, low, high,
final;
244 int max_pins_per_clb, i;
245 boolean success, prev_success, prev2_success, Fc_clipped =
FALSE;
272 max_pins_per_clb = 0;
279 &saved_clb_opins_used_locally);
295 current = max_pins_per_clb + max_pins_per_clb % 2;
301 if (current % 2 != 0) {
302 vpr_printf(TIO_MESSAGE_ERROR,
"in pack_place_and_route.c: Tried odd chan width (%d) for udsd architecture.\n",
309 if (det_routing_arch.
Fs % 3) {
310 vpr_printf(TIO_MESSAGE_ERROR,
"Fs must be three in bidirectional mode.\n");
320 while (
final == -1) {
322 vpr_printf(TIO_MESSAGE_INFO,
"Using low: %d, high: %d, current: %d\n", low, high, current);
330 vpr_printf(TIO_MESSAGE_ERROR,
"This circuit appears to be unroutable with the current router options. Last failed at %d.\n", low);
331 vpr_printf(TIO_MESSAGE_INFO,
"Aborting routing procedure.\n");
335 if (current > 1000) {
336 vpr_printf(TIO_MESSAGE_ERROR,
"This circuit requires a channel width above 1000, probably is not going to route.\n");
337 vpr_printf(TIO_MESSAGE_INFO,
"Aborting routing procedure.\n");
342 if ((current * 3) < det_routing_arch.
Fs) {
343 vpr_printf(TIO_MESSAGE_INFO,
"Width factor is now below specified Fs. Stop search.\n");
350 try_place(placer_opts, annealing_sched, chan_width_dist,
351 router_opts, det_routing_arch, segment_inf, timing_inf,
352 directs, num_directs);
354 success =
try_route(current, router_opts, det_routing_arch, segment_inf,
355 timing_inf, net_delay, slacks, chan_width_dist,
356 clb_opins_used_locally, &Fc_clipped, directs, num_directs);
360 if (success && (Fc_clipped ==
FALSE)) {
363 && (Fc_clipped ==
FALSE
367 if (current == high) {
375 vpr_printf(TIO_MESSAGE_WARNING,
"Fc_output was too high and was clipped to full (maximum) connectivity.\n");
388 saved_clb_opins_used_locally);
390 if ((high - low) <= 1 * udsd_multiplier)
394 current = (high + low) / 2;
399 if (success && Fc_clipped) {
400 vpr_printf(TIO_MESSAGE_INFO,
"Routing rejected, Fc_output was too high.\n");
406 if ((high - low) <= 1 * udsd_multiplier)
409 current = (high + low) / 2;
414 current = low + 5 * udsd_multiplier;
416 vpr_printf(TIO_MESSAGE_ERROR,
"Aborting: Wneed = f(Fs) search found exceedingly large Wneed (at least %d).\n", low);
424 current = current + current % udsd_multiplier;
436 if (verify_binary_search) {
439 vpr_printf(TIO_MESSAGE_INFO,
"Verifying that binary search found min channel width...\n");
443 prev2_success =
TRUE;
447 while (prev2_success || prev_success) {
457 try_place(placer_opts, annealing_sched, chan_width_dist,
458 router_opts, det_routing_arch, segment_inf, timing_inf,
459 directs, num_directs);
461 success =
try_route(current, router_opts, det_routing_arch,
462 segment_inf, timing_inf, net_delay, slacks,
463 chan_width_dist, clb_opins_used_locally, &Fc_clipped, directs, num_directs);
465 if (success && Fc_clipped ==
FALSE) {
468 saved_clb_opins_used_locally);
475 prev2_success = prev_success;
476 prev_success = success;
491 vpr_printf(TIO_MESSAGE_INFO,
"Reading best placement back in.\n");
493 read_place(place_file, net_file, arch_file, placer_opts,
494 router_opts, chan_width_dist, det_routing_arch,
495 segment_inf, timing_inf);
507 directs, num_directs,
FALSE,
511 saved_clb_opins_used_locally);
513 clb_opins_used_locally);
516 vpr_printf(TIO_MESSAGE_WARNING,
"Best routing Fc_output too high, clipped to full (maximum) connectivity.\n");
518 vpr_printf(TIO_MESSAGE_INFO,
"Best routing used a channel width factor of %d.\n",
final);
533 sprintf(msg,
"Routing succeeded with a channel width factor of %d.",
final);
552 block[i].type->num_class - 1);
554 free(clb_opins_used_locally);
555 clb_opins_used_locally = NULL;
void update_screen(int priority, char *msg, enum pic_type pic_on_screen_val, boolean crit_path_button_enabled)
void print_timing_graph_as_blif(const char *fname, t_model *models)
void save_routing(struct s_trace **best_routing, t_ivec **clb_opins_used_locally, t_ivec **saved_clb_opins_used_locally)
void read_place(INP const char *place_file, INP const char *arch_file, INP const char *net_file, INP int L_nx, INP int L_ny, INP int L_num_blocks, INOUTP struct s_block block_list[])
short global_route_switch
static float ** net_delay
enum e_graph_type t_graph_type
boolean try_route(int width_fac, struct s_router_opts router_opts, struct s_det_routing_arch det_routing_arch, t_segment_inf *segment_inf, t_timing_inf timing_inf, float **net_delay, t_slack *slacks, t_chan_width_dist chan_width_dist, t_ivec **clb_opins_used_locally, boolean *Fc_clipped, t_direct_inf *directs, int num_directs)
boolean timing_analysis_enabled
void free_saved_routing(struct s_trace **best_routing, t_ivec **saved_clb_opins_used_locally)
void get_serial_num(void)
void check_route(enum e_route_type route_type, int num_switch, t_ivec **clb_opins_used_locally)
boolean getEchoEnabled(void)
static t_ivec ** clb_opins_used_locally
void init_draw_coords(float width_val)
void verilog_writer(void)
enum e_directionality directionality
void build_rr_graph(INP t_graph_type graph_type, INP int L_num_types, INP t_type_ptr types, INP int L_nx, INP int L_ny, INP struct s_grid_tile **L_grid, INP int chan_width, INP struct s_chan_width_dist *chan_capacity_inf, INP enum e_switch_block_type sb_type, INP int Fs, INP int num_seg_types, INP int num_switches, INP t_segment_inf *segment_inf, INP int global_route_switch, INP int delayless_switch, INP t_timing_inf timing_inf, INP int wire_to_ipin_switch, INP enum e_base_cost_type base_cost_type, INP t_direct_inf *directs, INP int num_directs, INP boolean ignore_Fc_0, OUTP int *Warnings)
void init_chan(int cfactor, t_chan_width_dist chan_width_dist)
void free_ivec_vector(struct s_ivec *ivec_vector, int nrmin, int nrmax)
static t_chunk net_delay_ch
t_ivec ** alloc_route_structs(void)
void print_route(char *route_file)
boolean isEchoFileEnabled(enum e_echo_files echo_option)
void print_sink_delays(const char *fname)
void restore_routing(struct s_trace **best_routing, t_ivec **clb_opins_used_locally, t_ivec **saved_clb_opins_used_locally)
void print_place(char *place_file, char *net_file, char *arch_file)
enum e_route_type route_type
struct s_grid_tile ** grid
void free_net_delay(float **net_delay, t_chunk *chunk_list_ptr)
boolean GetPostSynthesisOption(void)
float ** alloc_net_delay(t_chunk *chunk_list_ptr, struct s_net *nets, int n_nets)
t_slack * alloc_and_load_timing_graph(t_timing_inf timing_inf)
struct s_trace ** alloc_saved_routing(t_ivec **clb_opins_used_locally, t_ivec ***saved_clb_opins_used_locally_ptr)
enum e_switch_block_type switch_block_type
#define NO_FIXED_CHANNEL_WIDTH
struct s_type_descriptor * type_descriptors
char * getEchoFileName(enum e_echo_files echo_option)
void free_timing_graph(t_slack *slacks)
short wire_to_ipin_switch
enum e_base_cost_type base_cost_type
void routing_stats(boolean full_stats, enum e_route_type route_type, int num_switch, t_segment_inf *segment_inf, int num_segment, float R_minW_nmos, float R_minW_pmos, enum e_directionality directionality, boolean timing_analysis_enabled, float **net_delay, t_slack *slacks)
void try_place(struct s_placer_opts placer_opts, struct s_annealing_sched annealing_sched, t_chan_width_dist chan_width_dist, 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_direct_inf *directs, int num_directs)
static struct s_trace ** best_routing