30 char *place_file,
char *net_file,
char *arch_file,
char *route_file,
31 boolean full_stats,
boolean verify_binary_search,
48 struct s_placer_opts placer_opts,
char *place_file,
char *net_file,
49 char *arch_file,
char *route_file,
60 boolean success, Fc_clipped;
87 try_place(placer_opts, annealing_sched, chan_width_dist, router_opts,
88 det_routing_arch, segment_inf, timing_inf, directs, num_directs);
92 vpr_printf(TIO_MESSAGE_INFO,
"Placement took %g seconds.\n", (
float)(end - begin) / CLOCKS_PER_SEC);
94 vpr_printf(TIO_MESSAGE_INFO,
"Placement took %g seconds.\n", (
float)(end - begin) / CLK_PER_SEC);
110 arch_file, route_file, router_opts.
full_stats,
112 det_routing_arch, segment_inf, timing_inf, chan_width_dist,
113 models, directs, num_directs);
117 if (width_fac % 2 != 0) {
118 vpr_printf(TIO_MESSAGE_ERROR,
"in pack_place_and_route.c: Given odd chan width (%d) for udsd architecture.\n",
133 success =
try_route(width_fac, router_opts, det_routing_arch,
134 segment_inf, timing_inf, net_delay, slacks, chan_width_dist,
135 clb_opins_used_locally, &Fc_clipped, directs, num_directs);
138 vpr_printf(TIO_MESSAGE_WARNING,
"Fc_output was too high and was clipped to full (maximum) connectivity.\n");
141 if (success ==
FALSE) {
142 vpr_printf(TIO_MESSAGE_INFO,
"Circuit is unrouteable with a channel width factor of %d.\n", width_fac);
144 sprintf(msg,
"Routing failed with a channel width factor of %d. ILLEGAL routing shown.", width_fac);
151 vpr_printf(TIO_MESSAGE_INFO,
"Circuit successfully routed with a channel width factor of %d.\n", width_fac);
167 sprintf(msg,
"Routing succeeded with a channel width factor of %d.\n\n",
178 assert(slacks->
slack);
199 if (clb_opins_used_locally != NULL) {
202 block[i].type->num_class - 1);
204 free(clb_opins_used_locally);
205 clb_opins_used_locally = NULL;
213 #ifdef CLOCKS_PER_SEC
214 vpr_printf(TIO_MESSAGE_INFO,
"Routing took %g seconds.\n", (
float) (end - begin) / CLOCKS_PER_SEC);
216 vpr_printf(TIO_MESSAGE_INFO,
"Routing took %g seconds.\n", (
float)(end - begin) / CLK_PER_SEC);
230 char *place_file,
char *net_file,
char *arch_file,
char *route_file,
231 boolean full_stats,
boolean verify_binary_search,
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;
571 float x, separation, chan_width_io;
573 t_chan chan_x_dist, chan_y_dist;
581 nio = (int) floor(cfactor * chan_width_io + 0.5);
589 separation = 1. / (
ny - 2.);
592 cfactor *
comp_width(&chan_x_dist, x, separation) + 0.5);
597 for (i = 1; i <
ny - 1; i++) {
598 x = (float) i / ((
float) (ny - 2.));
600 cfactor *
comp_width(&chan_x_dist, x, separation) + 0.5);
606 separation = 1. / (
nx - 2.);
609 cfactor *
comp_width(&chan_y_dist, x, separation) + 0.5);
613 for (i = 1; i <
nx - 1; i++) {
614 x = (float) i / ((
float) (nx - 2.));
616 cfactor *
comp_width(&chan_y_dist, x, separation) + 0.5);
622 vpr_printf(TIO_MESSAGE_INFO,
"chan_width_x:\n");
623 for (i = 0; i <=
ny; i++)
626 vpr_printf(TIO_MESSAGE_INFO,
"chan_width_y:\n");
627 for (i = 0; i <=
nx; i++)
643 switch (chan->
type) {
652 val = chan->
peak * exp(-val);
657 val = (float) fabs((
double) (x - chan->
xpeak));
658 if (val > chan->
width / 2.) {
667 val = x - chan->
xpeak;
668 if (val > -separation / 2. && val <= separation / 2.)
676 vpr_printf(TIO_MESSAGE_ERROR,
"in comp_width: Unknown channel type %d.\n", chan->
type);
688 int iblk, j, k, inet;
690 int max_num_block_pins;
693 for (iblk = 0; iblk < L_num_blocks; ++iblk) {
699 for (j = 0; j < max_num_block_pins; j++) {
703 block[iblk]. nets[j +
block[iblk].z * max_num_block_pins] ==
OPEN);
706 block[iblk].nets[j] =
OPEN;
708 if (
clb_net[inet].node_block[k] == iblk &&
clb_net[inet]. node_block_pin[k] == j) {
710 + block[iblk].z * max_num_block_pins;
714 assert(k <=
clb_net[inet].num_sinks);
725 if (pb == NULL || pb->
name == 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)
struct s_pb_type * pb_type_children
void free_port_pin_from_blk_pin(void)
struct s_rr_node * rr_graph
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 sync_grid_to_blocks(INP int L_num_blocks, INP const struct s_block block_list[], INP int L_nx, INP int L_ny, INOUTP struct s_grid_tile **L_grid)
void get_serial_num(void)
static int binary_search_place_and_route(struct s_placer_opts placer_opts, char *place_file, char *net_file, char *arch_file, char *route_file, boolean full_stats, boolean verify_binary_search, 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_chan_width_dist chan_width_dist, t_model *models, t_direct_inf *directs, int num_directs)
void check_route(enum e_route_type route_type, int num_switch, t_ivec **clb_opins_used_locally)
static float comp_width(t_chan *chan, float x, float separation)
boolean getEchoEnabled(void)
t_solution_inf g_solution_inf
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 free_blk_pin_from_port_pin(void)
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)
void post_place_sync(INP int L_num_blocks, INOUTP const struct s_block block_list[])
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_pb_type * pb_type
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_pb_data(t_pb *pb)
t_pb_graph_node * pb_graph_node
void free_timing_graph(t_slack *slacks)
short wire_to_ipin_switch
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_chan_width_dist chan_width_dist, struct s_model *models, t_direct_inf *directs, int num_directs)
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)
boolean verify_binary_search
static struct s_trace ** best_routing