VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
place.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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)
 

Function Documentation

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 
)

Definition at line 310 of file place.c.

314  {
315 
316  /* Does almost all the work of placing a circuit. Width_fac gives the *
317  * width of the widest channel. Place_cost_exp says what exponent the *
318  * width should be taken to when calculating costs. This allows a *
319  * greater bias for anisotropic architectures. */
320 
321  int tot_iter, inner_iter, success_sum, move_lim, moves_since_cost_recompute, width_fac,
322  num_connections, inet, ipin, outer_crit_iter_count, inner_crit_iter_count,
323  inner_recompute_limit, swap_result;
324  float t, success_rat, rlim, cost, timing_cost, bb_cost, new_bb_cost, new_timing_cost,
325  delay_cost, new_delay_cost, place_delay_value, inverse_prev_bb_cost, inverse_prev_timing_cost,
326  oldt, **old_region_occ_x, **old_region_occ_y, **net_delay = NULL, crit_exponent,
327  first_rlim, final_rlim, inverse_delta_rlim, critical_path_delay = UNDEFINED,
328  **remember_net_delay_original_ptr; /*used to free net_delay if it is re-assigned */
329  double av_cost, av_bb_cost, av_timing_cost, av_delay_cost, sum_of_squares, std_dev;
330  int total_swap_attempts;
331  float reject_rate;
332  float accept_rate;
333  float abort_rate;
334  char msg[BUFSIZE];
335  t_slack * slacks = NULL;
336 
337  /* Allocated here because it goes into timing critical code where each memory allocation is expensive */
338 
339  remember_net_delay_original_ptr = NULL; /*prevents compiler warning */
340 
341  /* init file scope variables */
342  num_swap_rejected = 0;
343  num_swap_accepted = 0;
344  num_swap_aborted = 0;
345  num_ts_called = 0;
346 
347  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
348  || placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE
349  || placer_opts.enable_timing_computations) {
350  /*do this before the initial placement to avoid messing up the initial placement */
351  slacks = alloc_lookups_and_criticalities(chan_width_dist, router_opts,
352  det_routing_arch, segment_inf, timing_inf, &net_delay, directs, num_directs);
353 
354  remember_net_delay_original_ptr = net_delay;
355 
356  /*#define PRINT_LOWER_BOUND */
357 #ifdef PRINT_LOWER_BOUND
358  /*print the crit_path, assuming delay between blocks that are*
359  *block_dist apart*/
360 
361  if (placer_opts.block_dist <= nx)
362  place_delay_value =
363  delta_clb_to_clb[placer_opts.block_dist][0];
364  else if (placer_opts.block_dist <= ny)
365  place_delay_value =
366  delta_clb_to_clb[0][placer_opts.block_dist];
367  else
368  place_delay_value = delta_clb_to_clb[nx][ny];
369 
370  vpr_printf(TIO_MESSAGE_INFO, "\n");
371  vpr_printf(TIO_MESSAGE_INFO, "Lower bound assuming delay of %g\n", place_delay_value);
372 
373  load_constant_net_delay(net_delay, place_delay_value);
374  load_timing_graph_net_delays(net_delay);
375  do_timing_analysis(slacks, FALSE, FALSE, TRUE);
376 
377  if (getEchoEnabled()) {
384  }
385 
386  /*also print sink delays assuming 0 delay between blocks,
387  * this tells us how much logic delay is on each path */
388 
389  load_constant_net_delay(net_delay, 0);
390  load_timing_graph_net_delays(net_delay);
391  do_timing_analysis(slacks, FALSE, FALSE, TRUE);
392 
393 #endif
394 
395  }
396 
397  width_fac = placer_opts.place_chan_width;
398 
399  init_chan(width_fac, chan_width_dist);
400 
402  placer_opts.place_cost_exp,
403  &old_region_occ_x, &old_region_occ_y, placer_opts,
404  directs, num_directs);
405 
406  initial_placement(placer_opts.pad_loc_type, placer_opts.pad_loc_file);
407  init_draw_coords((float) width_fac);
408 
409  /* Storing the number of pins on each type of block makes the swap routine *
410  * slightly more efficient. */
411 
412  /* Gets initial cost and loads bounding boxes. */
413 
414  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
415  || placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE) {
416  bb_cost = comp_bb_cost(NORMAL);
417 
418  crit_exponent = placer_opts.td_place_exp_first; /*this will be modified when rlim starts to change */
419 
420  num_connections = count_connections();
421  vpr_printf(TIO_MESSAGE_INFO, "\n");
422  vpr_printf(TIO_MESSAGE_INFO, "There are %d point to point connections in this circuit.\n", num_connections);
423  vpr_printf(TIO_MESSAGE_INFO, "\n");
424 
425  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE) {
426  for (inet = 0; inet < num_nets; inet++)
427  for (ipin = 1; ipin <= clb_net[inet].num_sinks; ipin++)
428  timing_place_crit[inet][ipin] = 0; /*dummy crit values */
429 
430  comp_td_costs(&timing_cost, &delay_cost); /*first pass gets delay_cost, which is used
431  * in criticality computations in the next call
432  * to comp_td_costs. */
433  place_delay_value = delay_cost / num_connections; /*used for computing criticalities */
434  load_constant_net_delay(net_delay, place_delay_value, clb_net,
435  num_nets);
436 
437  } else
438  place_delay_value = 0;
439 
440  if (placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE) {
441  net_delay = point_to_point_delay_cost; /*this keeps net_delay up to date with *
442  * *the same values that the placer is using *
443  * *point_to_point_delay_cost is computed each*
444  * *time that comp_td_costs is called, and is *
445  * *also updated after any swap is accepted */
446  }
447 
448  load_timing_graph_net_delays(net_delay);
449  do_timing_analysis(slacks, FALSE, FALSE, FALSE);
450  load_criticalities(slacks, crit_exponent);
451  if (getEchoEnabled()) {
458  }
459  outer_crit_iter_count = 1;
460 
461  /*now we can properly compute costs */
462  comp_td_costs(&timing_cost, &delay_cost); /*also vpr_printf proper values into point_to_point_delay_cost */
463 
464  inverse_prev_timing_cost = 1 / timing_cost;
465  inverse_prev_bb_cost = 1 / bb_cost;
466  cost = 1; /*our new cost function uses normalized values of */
467  /*bb_cost and timing_cost, the value of cost will be reset */
468  /*to 1 at each temperature when *_TIMING_DRIVEN_PLACE is true */
469  } else { /*BOUNDING_BOX_PLACE */
470  cost = bb_cost = comp_bb_cost(NORMAL);
471  timing_cost = 0;
472  delay_cost = 0;
473  place_delay_value = 0;
474  outer_crit_iter_count = 0;
475  num_connections = 0;
476  crit_exponent = 0;
477 
478  inverse_prev_timing_cost = 0; /*inverses not used */
479  inverse_prev_bb_cost = 0;
480  }
481 
482  move_lim = (int) (annealing_sched.inner_num * pow(num_blocks, 1.3333));
483 
484  if (placer_opts.inner_loop_recompute_divider != 0)
485  inner_recompute_limit = (int) (0.5
486  + (float) move_lim
487  / (float) placer_opts.inner_loop_recompute_divider);
488  else
489  /*don't do an inner recompute */
490  inner_recompute_limit = move_lim + 1;
491 
492  /* Sometimes I want to run the router with a random placement. Avoid *
493  * using 0 moves to stop division by 0 and 0 length vector problems, *
494  * by setting move_lim to 1 (which is still too small to do any *
495  * significant optimization). */
496 
497  if (move_lim <= 0)
498  move_lim = 1;
499 
500  rlim = (float) std::max(nx + 1, ny + 1);
501 
502  first_rlim = rlim; /*used in timing-driven placement for exponent computation */
503  final_rlim = 1;
504  inverse_delta_rlim = 1 / (first_rlim - final_rlim);
505 
506  t = starting_t(&cost, &bb_cost, &timing_cost,
507  old_region_occ_x, old_region_occ_y,
508  annealing_sched, move_lim, rlim,
509  placer_opts.place_algorithm, placer_opts.timing_tradeoff,
510  inverse_prev_bb_cost, inverse_prev_timing_cost, &delay_cost);
511  tot_iter = 0;
512  moves_since_cost_recompute = 0;
513  vpr_printf(TIO_MESSAGE_INFO, "Initial placement cost: %g bb_cost: %g td_cost: %g delay_cost: %g\n",
514  cost, bb_cost, timing_cost, delay_cost);
515  vpr_printf(TIO_MESSAGE_INFO, "\n");
516 
517 #ifndef SPEC
518  vpr_printf(TIO_MESSAGE_INFO, "%9s %9s %11s %11s %11s %11s %8s %8s %7s %7s %7s %9s %7s\n",
519  "---------", "---------", "-----------", "-----------", "-----------", "-----------",
520  "--------", "--------", "-------", "-------", "-------", "---------", "-------");
521  vpr_printf(TIO_MESSAGE_INFO, "%9s %9s %11s %11s %11s %11s %8s %8s %7s %7s %7s %9s %7s\n",
522  "T", "Cost", "Av BB Cost", "Av TD Cost", "Av Tot Del",
523  "P to P Del", "d_max", "Ac Rate", "Std Dev", "R limit", "Exp",
524  "Tot Moves", "Alpha");
525  vpr_printf(TIO_MESSAGE_INFO, "%9s %9s %11s %11s %11s %11s %8s %8s %7s %7s %7s %9s %7s\n",
526  "---------", "---------", "-----------", "-----------", "-----------", "-----------",
527  "--------", "--------", "-------", "-------", "-------", "---------", "-------");
528 #endif
529 
530  sprintf(msg, "Initial Placement. Cost: %g BB Cost: %g TD Cost %g Delay Cost: %g \t Channel Factor: %d",
531  cost, bb_cost, timing_cost, delay_cost, width_fac);
533 
534  while (exit_crit(t, cost, annealing_sched) == 0) {
535 
536  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
537  || placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE) {
538  cost = 1;
539  }
540 
541  av_cost = 0.;
542  av_bb_cost = 0.;
543  av_delay_cost = 0.;
544  av_timing_cost = 0.;
545  sum_of_squares = 0.;
546  success_sum = 0;
547 
548  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
549  || placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE) {
550 
551  if (outer_crit_iter_count >= placer_opts.recompute_crit_iter
552  || placer_opts.inner_loop_recompute_divider != 0) {
553 #ifdef VERBOSE
554  vpr_printf(TIO_MESSAGE_INFO, "Outer loop recompute criticalities\n");
555 #endif
556  place_delay_value = delay_cost / num_connections;
557 
558  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE)
559  load_constant_net_delay(net_delay, place_delay_value,
560  clb_net, num_nets);
561  /*note, for path_based, the net delay is not updated since it is current,
562  *because it accesses point_to_point_delay array */
563 
564  load_timing_graph_net_delays(net_delay);
565  do_timing_analysis(slacks, FALSE, FALSE, FALSE);
566  load_criticalities(slacks, crit_exponent);
567  /*recompute costs from scratch, based on new criticalities */
568  comp_td_costs(&timing_cost, &delay_cost);
569  outer_crit_iter_count = 0;
570  }
571  outer_crit_iter_count++;
572 
573  /*at each temperature change we update these values to be used */
574  /*for normalizing the tradeoff between timing and wirelength (bb) */
575  inverse_prev_bb_cost = 1 / bb_cost;
576  /*Prevent inverse timing cost from going to infinity */
577  inverse_prev_timing_cost = std::min(1 / timing_cost, (float)MAX_INV_TIMING_COST);
578  }
579 
580  inner_crit_iter_count = 1;
581 
582  for (inner_iter = 0; inner_iter < move_lim; inner_iter++) {
583  swap_result = try_swap(t, &cost, &bb_cost, &timing_cost, rlim,
584  old_region_occ_x,
585  old_region_occ_y,
586  placer_opts.place_algorithm, placer_opts.timing_tradeoff,
587  inverse_prev_bb_cost, inverse_prev_timing_cost, &delay_cost);
588  if (swap_result == ACCEPTED) {
589 
590  /* Move was accepted. Update statistics that are useful for the annealing schedule. */
591  success_sum++;
592  av_cost += cost;
593  av_bb_cost += bb_cost;
594  av_timing_cost += timing_cost;
595  av_delay_cost += delay_cost;
596  sum_of_squares += cost * cost;
598  } else if (swap_result == ABORTED) {
600  } else { // swap_result == REJECTED
602  }
603 
604 
605  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
606  || placer_opts.place_algorithm
608 
609  /* Do we want to re-timing analyze the circuit to get updated slack and criticality values?
610  * We do this only once in a while, since it is expensive.
611  */
612  if (inner_crit_iter_count >= inner_recompute_limit
613  && inner_iter != move_lim - 1) { /*on last iteration don't recompute */
614 
615  inner_crit_iter_count = 0;
616 #ifdef VERBOSE
617  vpr_printf(TIO_MESSAGE_TRACE, "Inner loop recompute criticalities\n");
618 #endif
619  if (placer_opts.place_algorithm
621  /* Use a constant delay per connection as the delay estimate, rather than
622  * estimating based on the current placement. Not a great idea, but not the
623  * default.
624  */
625  place_delay_value = delay_cost / num_connections;
626  load_constant_net_delay(net_delay, place_delay_value,
627  clb_net, num_nets);
628  }
629 
630  /* Using the delays in net_delay, do a timing analysis to update slacks and
631  * criticalities; then update the timing cost since it will change.
632  */
633  load_timing_graph_net_delays(net_delay);
634  do_timing_analysis(slacks, FALSE, FALSE, FALSE);
635  load_criticalities(slacks, crit_exponent);
636  comp_td_costs(&timing_cost, &delay_cost);
637  }
638  inner_crit_iter_count++;
639  }
640 #ifdef VERBOSE
641  vpr_printf(TIO_MESSAGE_TRACE, "t = %g cost = %g bb_cost = %g timing_cost = %g move = %d dmax = %g\n",
642  t, cost, bb_cost, timing_cost, inner_iter, delay_cost);
643  if (fabs(bb_cost - comp_bb_cost(CHECK)) > bb_cost * ERROR_TOL)
644  exit(1);
645 #endif
646  }
647 
648  /* Lines below prevent too much round-off error from accumulating *
649  * in the cost over many iterations. This round-off can lead to *
650  * error checks failing because the cost is different from what *
651  * you get when you recompute from scratch. */
652 
653  moves_since_cost_recompute += move_lim;
654  if (moves_since_cost_recompute > MAX_MOVES_BEFORE_RECOMPUTE) {
655  new_bb_cost = recompute_bb_cost();
656  if (fabs(new_bb_cost - bb_cost) > bb_cost * ERROR_TOL) {
657  vpr_printf(TIO_MESSAGE_ERROR, "in try_place: new_bb_cost = %g, old bb_cost = %g\n",
658  new_bb_cost, bb_cost);
659  exit(1);
660  }
661  bb_cost = new_bb_cost;
662 
663  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
664  || placer_opts.place_algorithm
666  comp_td_costs(&new_timing_cost, &new_delay_cost);
667  if (fabs(new_timing_cost - timing_cost) > timing_cost * ERROR_TOL) {
668  vpr_printf(TIO_MESSAGE_ERROR, "in try_place: new_timing_cost = %g, old timing_cost = %g\n",
669  new_timing_cost, timing_cost);
670  exit(1);
671  }
672  if (fabs(new_delay_cost - delay_cost) > delay_cost * ERROR_TOL) {
673  vpr_printf(TIO_MESSAGE_ERROR, "in try_place: new_delay_cost = %g, old delay_cost = %g\n",
674  new_delay_cost, delay_cost);
675  exit(1);
676  }
677  timing_cost = new_timing_cost;
678  }
679 
680  if (placer_opts.place_algorithm == BOUNDING_BOX_PLACE) {
681  cost = new_bb_cost;
682  }
683  moves_since_cost_recompute = 0;
684  }
685 
686  tot_iter += move_lim;
687  success_rat = ((float) success_sum) / move_lim;
688  if (success_sum == 0) {
689  av_cost = cost;
690  av_bb_cost = bb_cost;
691  av_timing_cost = timing_cost;
692  av_delay_cost = delay_cost;
693  } else {
694  av_cost /= success_sum;
695  av_bb_cost /= success_sum;
696  av_timing_cost /= success_sum;
697  av_delay_cost /= success_sum;
698  }
699  std_dev = get_std_dev(success_sum, sum_of_squares, av_cost);
700 
701  oldt = t; /* for finding and printing alpha. */
702  update_t(&t, std_dev, rlim, success_rat, annealing_sched);
703 
704 #ifndef SPEC
705  critical_path_delay = get_critical_path_delay();
706  vpr_printf(TIO_MESSAGE_INFO, "%9.5f %9.5g %11.6g %11.6g %11.6g %11.6g %8.4f %8.4f %7.4f %7.4f %7.4f %9d %7.4f\n",
707  oldt, av_cost, av_bb_cost, av_timing_cost, av_delay_cost, place_delay_value,
708  critical_path_delay, success_rat, std_dev, rlim, crit_exponent, tot_iter, t / oldt);
709 #endif
710 
711  sprintf(msg, "Cost: %g BB Cost %g TD Cost %g Temperature: %g",
712  cost, bb_cost, timing_cost, t);
714  update_rlim(&rlim, success_rat);
715 
716  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
717  || placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE) {
718  crit_exponent = (1 - (rlim - final_rlim) * inverse_delta_rlim)
719  * (placer_opts.td_place_exp_last
720  - placer_opts.td_place_exp_first)
721  + placer_opts.td_place_exp_first;
722  }
723 #ifdef VERBOSE
724  if (getEchoEnabled()) {
725  print_clb_placement("first_iteration_clb_placement.echo");
726  }
727 #endif
728  }
729 
730  t = 0; /* freeze out */
731  av_cost = 0.;
732  av_bb_cost = 0.;
733  av_timing_cost = 0.;
734  sum_of_squares = 0.;
735  av_delay_cost = 0.;
736  success_sum = 0;
737 
738  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
739  || placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE) {
740  /*at each temperature change we update these values to be used */
741  /*for normalizing the tradeoff between timing and wirelength (bb) */
742  if (outer_crit_iter_count >= placer_opts.recompute_crit_iter
743  || placer_opts.inner_loop_recompute_divider != 0) {
744 
745 #ifdef VERBOSE
746  vpr_printf(TIO_MESSAGE_INFO, "Outer loop recompute criticalities\n");
747 #endif
748  place_delay_value = delay_cost / num_connections;
749 
750  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE)
751  load_constant_net_delay(net_delay, place_delay_value, clb_net,
752  num_nets);
753 
754  load_timing_graph_net_delays(net_delay);
755  do_timing_analysis(slacks, FALSE, FALSE, FALSE);
756  load_criticalities(slacks, crit_exponent);
757  /*recompute criticaliies */
758  comp_td_costs(&timing_cost, &delay_cost);
759  outer_crit_iter_count = 0;
760  }
761  outer_crit_iter_count++;
762 
763  inverse_prev_bb_cost = 1 / (bb_cost);
764  /*Prevent inverse timing cost from going to infinity */
765  inverse_prev_timing_cost = std::min(1 / timing_cost, (float)MAX_INV_TIMING_COST);
766  }
767 
768  inner_crit_iter_count = 1;
769 
770  for (inner_iter = 0; inner_iter < move_lim; inner_iter++) {
771  swap_result = try_swap(t, &cost, &bb_cost, &timing_cost, rlim,
772  old_region_occ_x, old_region_occ_y,
773  placer_opts.place_algorithm, placer_opts.timing_tradeoff,
774  inverse_prev_bb_cost, inverse_prev_timing_cost, &delay_cost);
775 
776  if (swap_result == ACCEPTED) {
777  success_sum++;
778  av_cost += cost;
779  av_bb_cost += bb_cost;
780  av_delay_cost += delay_cost;
781  av_timing_cost += timing_cost;
782  sum_of_squares += cost * cost;
783 
784  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
785  || placer_opts.place_algorithm
787 
788  if (inner_crit_iter_count >= inner_recompute_limit
789  && inner_iter != move_lim - 1) {
790 
791  inner_crit_iter_count = 0;
792 #ifdef VERBOSE
793  vpr_printf(TIO_MESSAGE_TRACE, "Inner loop recompute criticalities\n");
794 #endif
795  if (placer_opts.place_algorithm
797  place_delay_value = delay_cost / num_connections;
798  load_constant_net_delay(net_delay, place_delay_value,
799  clb_net, num_nets);
800  }
801 
802  load_timing_graph_net_delays(net_delay);
803  do_timing_analysis(slacks, FALSE, FALSE, FALSE);
804  load_criticalities(slacks, crit_exponent);
805  comp_td_costs(&timing_cost, &delay_cost);
806  }
807  inner_crit_iter_count++;
808  }
810  } else if (swap_result == ABORTED) {
812  } else {
814  }
815 
816 #ifdef VERBOSE
817  vpr_printf(TIO_MESSAGE_INFO, "t = %g, cost = %g, move = %d\n", t, cost, tot_iter);
818 #endif
819  }
820  tot_iter += move_lim;
821  success_rat = ((float) success_sum) / move_lim;
822  if (success_sum == 0) {
823  av_cost = cost;
824  av_bb_cost = bb_cost;
825  av_delay_cost = delay_cost;
826  av_timing_cost = timing_cost;
827  } else {
828  av_cost /= success_sum;
829  av_bb_cost /= success_sum;
830  av_delay_cost /= success_sum;
831  av_timing_cost /= success_sum;
832  }
833 
834  std_dev = get_std_dev(success_sum, sum_of_squares, av_cost);
835 
836 #ifndef SPEC
837  vpr_printf(TIO_MESSAGE_INFO, "%9.5f %9.5g %11.6g %11.6g %11.6g %11.6g %8s %8.4f %7.4f %7.4f %7.4f %9d\n",
838  t, av_cost, av_bb_cost, av_timing_cost, av_delay_cost, place_delay_value,
839  " ", success_rat, std_dev, rlim, crit_exponent, tot_iter);
840 #endif
841 
842  // TODO:
843  // 1. print a message about number of aborted moves.
844  // 2. add some subroutine hierarchy! Too big!
845  // 3. put statistics counters (av_cost, success_sum, etc.) in a struct so a
846  // pointer to it can be passed around.
847 
848 #ifdef VERBOSE
850  print_clb_placement(getEchoFileName(E_ECHO_END_CLB_PLACEMENT));
851  }
852 #endif
853 
854  check_place(bb_cost, timing_cost,
855  placer_opts.place_algorithm, delay_cost);
856 
857  if (placer_opts.enable_timing_computations
858  && placer_opts.place_algorithm == BOUNDING_BOX_PLACE) {
859  /*need this done since the timing data has not been kept up to date*
860  *in bounding_box mode */
861  for (inet = 0; inet < num_nets; inet++)
862  for (ipin = 1; ipin <= clb_net[inet].num_sinks; ipin++)
863  timing_place_crit[inet][ipin] = 0; /*dummy crit values */
864  comp_td_costs(&timing_cost, &delay_cost); /*computes point_to_point_delay_cost */
865  }
866 
867  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
868  || placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE
869  || placer_opts.enable_timing_computations) {
870  net_delay = point_to_point_delay_cost; /*this makes net_delay up to date with *
871  *the same values that the placer is using*/
872  load_timing_graph_net_delays(net_delay);
873 
874  do_timing_analysis(slacks, FALSE, FALSE, FALSE);
875 
876  if (getEchoEnabled()) {
887  }
888 
889  /* Print critical path delay. */
890  critical_path_delay = get_critical_path_delay();
891  vpr_printf(TIO_MESSAGE_INFO, "\n");
892  vpr_printf(TIO_MESSAGE_INFO, "Placement estimated critical path delay: %g ns\n", critical_path_delay);
893  }
894 
895  sprintf(msg, "Placement. Cost: %g bb_cost: %g td_cost: %g Channel Factor: %d",
896  cost, bb_cost, timing_cost, width_fac);
897  vpr_printf(TIO_MESSAGE_INFO, "Placement cost: %g, bb_cost: %g, td_cost: %g, delay_cost: %g\n",
898  cost, bb_cost, timing_cost, delay_cost);
900 
901  // Print out swap statistics
902  total_swap_attempts = num_swap_rejected + num_swap_accepted + num_swap_aborted;
903  reject_rate = num_swap_rejected / total_swap_attempts;
904  accept_rate = num_swap_accepted / total_swap_attempts;
905  abort_rate = num_swap_aborted / total_swap_attempts;
906  vpr_printf(TIO_MESSAGE_INFO, "Placement total # of swap attempts: %d\n", total_swap_attempts);
907  vpr_printf(TIO_MESSAGE_INFO, "\tSwap reject rate: %g\n", reject_rate);
908  vpr_printf(TIO_MESSAGE_INFO, "\tSwap accept rate: %g\n", accept_rate);
909  vpr_printf(TIO_MESSAGE_INFO, "\tSwap abort rate: %g\n", abort_rate);
910 
911 
912 #ifdef SPEC
913  vpr_printf(TIO_MESSAGE_INFO, "Total moves attempted: %d.0\n", tot_iter);
914 #endif
915 
917  old_region_occ_x, old_region_occ_y,
918  placer_opts);
919  if (placer_opts.place_algorithm == NET_TIMING_DRIVEN_PLACE
920  || placer_opts.place_algorithm == PATH_TIMING_DRIVEN_PLACE
921  || placer_opts.enable_timing_computations) {
922 
923  net_delay = remember_net_delay_original_ptr;
924  free_lookups_and_criticalities(&net_delay, slacks);
925  }
926 
928 }
static float comp_bb_cost(enum cost_methods method)
Definition: place.c:1866
#define MAX_MOVES_BEFORE_RECOMPUTE
Definition: place.c:36
static void free_try_swap_arrays(void)
Definition: place.c:3108
void update_screen(int priority, char *msg, enum pic_type pic_on_screen_val, boolean crit_path_button_enabled)
Definition: draw.c:156
static int num_swap_aborted
Definition: place.c:189
static void check_place(float bb_cost, float timing_cost, enum e_place_algorithm place_algorithm, float delay_cost)
Definition: place.c:2950
boolean enable_timing_computations
Definition: vpr_types.h:646
static void initial_placement(enum e_pad_loc_type pad_loc_type, char *pad_loc_file)
Definition: place.c:2772
char * pad_loc_file
Definition: vpr_types.h:643
#define MAJOR
Definition: vpr_types.h:73
float get_critical_path_delay(void)
Definition: path_delay.c:3060
enum e_pad_loc_type pad_loc_type
Definition: vpr_types.h:642
float ** timing_place_crit
Definition: timing_place.c:12
static float ** net_delay
static float recompute_bb_cost(void)
Definition: place.c:1630
float ** delta_clb_to_clb
void free_lookups_and_criticalities(float ***net_delay, t_slack *slacks)
Definition: timing_place.c:141
static double get_std_dev(int n, double sum_x_squared, double av_x)
Definition: place.c:947
float timing_tradeoff
Definition: vpr_types.h:638
int num_nets
Definition: globals.c:27
void print_critical_path(const char *fname)
Definition: path_delay.c:2458
void do_timing_analysis(t_slack *slacks, boolean is_prepacked, boolean do_lut_input_balancing, boolean is_final_analysis)
Definition: path_delay.c:1613
float ** slack
Definition: vpr_types.h:405
#define BUFSIZE
Definition: graphics.c:184
static float starting_t(float *cost_ptr, float *bb_cost_ptr, float *timing_cost_ptr, float **old_region_occ_x, float **old_region_occ_y, struct s_annealing_sched annealing_sched, int max_moves, float rlim, enum e_place_algorithm place_algorithm, float timing_tradeoff, float inverse_prev_bb_cost, float inverse_prev_timing_cost, float *delay_cost_ptr)
Definition: place.c:1045
int num_blocks
Definition: globals.c:30
static enum swap_result try_swap(float t, float *cost, float *bb_cost, float *timing_cost, float rlim, float **old_region_occ_x, float **old_region_occ_y, enum e_place_algorithm place_algorithm, float timing_tradeoff, float inverse_prev_bb_cost, float inverse_prev_timing_cost, float *delay_cost)
Definition: place.c:1252
#define UNDEFINED
Definition: vpr_types.h:103
boolean getEchoEnabled(void)
Definition: ReadOptions.c:67
#define ERROR_TOL
Definition: place.c:31
Definition: util.h:12
float td_place_exp_first
Definition: vpr_types.h:648
#define min(a, b)
Definition: graphics.c:174
static void comp_td_costs(float *timing_cost, float *connection_delay_sum)
Definition: place.c:1829
static int num_swap_accepted
Definition: place.c:188
static int num_ts_called
Definition: place.c:190
void init_draw_coords(float width_val)
Definition: draw.c:430
void load_criticalities(t_slack *slacks, float crit_exponent)
Definition: timing_place.c:81
#define max(a, b)
Definition: graphics.c:171
#define MAX_INV_TIMING_COST
Definition: place.c:64
struct s_net * clb_net
Definition: globals.c:28
float td_place_exp_last
Definition: vpr_types.h:650
int nx
Definition: globals.c:46
Definition: place.c:61
void init_chan(int cfactor, t_chan_width_dist chan_width_dist)
static void free_placement_structs(float **old_region_occ_x, float **old_region_occ_y, struct s_placer_opts placer_opts)
Definition: place.c:1913
static int num_swap_rejected
Definition: place.c:187
boolean isEchoFileEnabled(enum e_echo_files echo_option)
Definition: ReadOptions.c:115
static float ** point_to_point_delay_cost
Definition: place.c:142
void print_sink_delays(const char *fname)
Definition: timing_place.c:58
static void update_rlim(float *rlim, float success_rat)
Definition: place.c:969
static void alloc_and_load_placement_structs(float place_cost_exp, float ***old_region_occ_x, float ***old_region_occ_y, struct s_placer_opts placer_opts, t_direct_inf *directs, int num_directs)
Definition: place.c:1975
float place_cost_exp
Definition: vpr_types.h:640
Definition: place.c:54
int recompute_crit_iter
Definition: vpr_types.h:645
Definition: place.c:54
static int count_connections(void)
Definition: place.c:930
enum e_place_algorithm place_algorithm
Definition: vpr_types.h:637
void print_criticality(t_slack *slacks, boolean criticality_is_normalized, const char *fname)
Definition: path_delay.c:559
void load_constant_net_delay(float **net_delay, float delay_value, struct s_net *nets, int n_nets)
Definition: net_delay.c:175
static int exit_crit(float t, float cost, struct s_annealing_sched annealing_sched)
Definition: place.c:1023
t_slack * alloc_lookups_and_criticalities(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, float ***net_delay, INP t_direct_inf *directs, INP int num_directs)
Definition: timing_place.c:121
void print_slack(float **slack, boolean slack_is_normalized, const char *fname)
Definition: path_delay.c:441
void print_timing_graph(const char *fname)
Definition: path_delay.c:1388
int inner_loop_recompute_divider
Definition: vpr_types.h:647
char * getEchoFileName(enum e_echo_files echo_option)
Definition: ReadOptions.c:122
Definition: place.c:61
int place_chan_width
Definition: vpr_types.h:641
int ny
Definition: globals.c:47
messagelogger vpr_printf
Definition: util.c:17
static void update_t(float *t, float std_dev, float rlim, float success_rat, struct s_annealing_sched annealing_sched)
Definition: place.c:983
int num_sinks
Definition: vpr_types.h:506
#define MINOR
Definition: vpr_types.h:72
void load_timing_graph_net_delays(float **net_delay)
Definition: path_delay.c:368
swap_result
Definition: place.c:60
Definition: util.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function: