51 int itry, inet, ipin, i, bends, wirelength, total_wirelength, available_wirelength,
53 boolean success, is_routable, rip_up_local_opins;
55 critical_path_delay, init_timing_criticality_val;
65 heapsort(net_index, sinks, num_nets, 1);
75 if (timing_analysis_enabled) {
76 init_timing_criticality_val = 1.;
78 init_timing_criticality_val = 0.;
81 for (inet = 0; inet <
num_nets; inet++) {
86 slacks->path_criticality[inet][ipin] = init_timing_criticality_val;
104 vpr_printf(TIO_MESSAGE_INFO,
"Routing iteration: %d\n", itry);
114 sink_order, rt_node_of_sink,
net_delay[inet], slacks);
119 vpr_printf(TIO_MESSAGE_INFO,
"Routing failed.\n");
121 sink_order, rt_node_of_sink);
133 total_wirelength = 0;
134 available_wirelength = 0;
144 for (inet = 0; inet <
num_nets; inet++) {
146 &&
clb_net[inet].num_sinks != 0) {
150 total_wirelength += wirelength;
153 vpr_printf(TIO_MESSAGE_INFO,
"Wire length after first iteration %d, total available wire length %d, ratio %g\n",
154 total_wirelength, available_wirelength,
155 (
float) (total_wirelength) / (
float) (available_wirelength));
157 vpr_printf(TIO_MESSAGE_INFO,
"Wire length usage ratio exceeds limit of %g, fail routing.\n",
171 rip_up_local_opins =
FALSE;
173 rip_up_local_opins =
TRUE;
176 clb_opins_used_locally);
183 vpr_printf(TIO_MESSAGE_INFO,
"Successfully routed after %d routing iterations.\n", itry);
205 if (timing_analysis_enabled) {
211 #ifdef HACK_LUT_PIN_SWAPPING
219 vpr_printf(TIO_MESSAGE_INFO,
"Critical path: %g ns\n", critical_path_delay);
224 for (inet = 0; inet <
num_nets; inet++) {
228 slacks->path_criticality[inet][ipin] = 0.;
236 #ifdef CLOCKS_PER_SEC
237 vpr_printf(TIO_MESSAGE_INFO,
"Routing iteration took %g seconds.\n", (
float)(end - begin) / CLOCKS_PER_SEC);
239 vpr_printf(TIO_MESSAGE_INFO,
"Routing iteration took %g seconds.\n", (
float)(end - begin) / CLK_PER_SEC);
245 vpr_printf(TIO_MESSAGE_INFO,
"Routing failed.\n");
boolean feasible_routing(void)
void free_timing_driven_route_structs(float *pin_criticality, int *sink_order, t_rt_node **rt_node_of_sink)
void heapsort(int *sort_index, float *sort_values, int nelem, int start_index)
float get_critical_path_delay(void)
static float ** net_delay
int max_router_iterations
float first_iter_pres_fac
void pathfinder_update_cost(float pres_fac, float acc_fac)
#define FIRST_ITER_WIRELENTH_LIMIT
void do_timing_analysis(t_slack *slacks, boolean is_prepacked, boolean do_lut_input_balancing, boolean is_final_analysis)
void get_num_bends_and_length(int inet, int *bends_ptr, int *len_ptr, int *segments_ptr)
#define HUGE_POSITIVE_FLOAT
static void * my_malloc(int ibytes)
static float * pin_criticality
void alloc_timing_driven_route_structs(float **pin_criticality_ptr, int **sink_order_ptr, t_rt_node ***rt_node_of_sink_ptr)
static void timing_driven_check_net_delays(float **net_delay)
boolean timing_driven_route_net(int inet, float pres_fac, float max_criticality, float criticality_exp, float astar_fac, float bend_cost, float *pin_criticality, int *sink_order, t_rt_node **rt_node_of_sink, float *net_delay, t_slack *slacks)
float ** timing_criticality
void reserve_locally_used_opins(float pres_fac, boolean rip_up_local_opins, t_ivec **clb_opins_used_locally)
static t_rt_node ** rt_node_of_sink
void load_timing_graph_net_delays(float **net_delay)