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

Go to the source code of this file.

Functions

boolean try_breadth_first_route (struct s_router_opts router_opts, t_ivec **clb_opins_used_locally, int width_fac)
 

Function Documentation

boolean try_breadth_first_route ( struct s_router_opts  router_opts,
t_ivec **  clb_opins_used_locally,
int  width_fac 
)

Definition at line 23 of file route_breadth_first.c.

24  {
25 
26  /* Iterated maze router ala Pathfinder Negotiated Congestion algorithm, *
27  * (FPGA 95 p. 111). Returns TRUE if it can route this FPGA, FALSE if *
28  * it can't. */
29 
30  float pres_fac;
31  boolean success, is_routable, rip_up_local_opins;
32  int itry, inet;
33 
34  /* Usually the first iteration uses a very small (or 0) pres_fac to find *
35  * the shortest path and get a congestion map. For fast compiles, I set *
36  * pres_fac high even for the first iteration. */
37 
38  pres_fac = router_opts.first_iter_pres_fac;
39 
40  for (itry = 1; itry <= router_opts.max_router_iterations; itry++) {
41 
42  for (inet = 0; inet < num_nets; inet++) {
43  if (clb_net[inet].is_global == FALSE) { /* Skip global nets. */
44 
45  pathfinder_update_one_cost(trace_head[inet], -1, pres_fac);
46 
47  is_routable = breadth_first_route_net(inet,
48  router_opts.bend_cost);
49 
50  /* Impossible to route? (disconnected rr_graph) */
51 
52  if (!is_routable) {
53  vpr_printf(TIO_MESSAGE_INFO, "Routing failed.\n");
54  return (FALSE);
55  }
56 
57  pathfinder_update_one_cost(trace_head[inet], 1, pres_fac);
58 
59  }
60  }
61 
62  /* Make sure any CLB OPINs used up by subblocks being hooked directly *
63  * to them are reserved for that purpose. */
64 
65  if (itry == 1)
66  rip_up_local_opins = FALSE;
67  else
68  rip_up_local_opins = TRUE;
69 
70  reserve_locally_used_opins(pres_fac, rip_up_local_opins,
71  clb_opins_used_locally);
72 
73  success = feasible_routing();
74  if (success) {
75  vpr_printf(TIO_MESSAGE_INFO, "Successfully routed after %d routing iterations.\n", itry);
76  return (TRUE);
77  }
78 
79  if (itry == 1)
80  pres_fac = router_opts.initial_pres_fac;
81  else
82  pres_fac *= router_opts.pres_fac_mult;
83 
84  pres_fac = std::min(pres_fac, static_cast<float>(HUGE_POSITIVE_FLOAT / 1e5));
85 
86  pathfinder_update_cost(pres_fac, router_opts.acc_fac);
87  }
88 
89  vpr_printf(TIO_MESSAGE_INFO, "Routing failed.\n");
90  return (FALSE);
91 }
boolean feasible_routing(void)
Definition: route_common.c:298
static boolean breadth_first_route_net(int inet, float bend_cost)
float pres_fac_mult
Definition: vpr_types.h:698
int max_router_iterations
Definition: vpr_types.h:701
float first_iter_pres_fac
Definition: vpr_types.h:696
void pathfinder_update_cost(float pres_fac, float acc_fac)
Definition: route_common.c:363
int num_nets
Definition: globals.c:27
Definition: util.h:12
static float pres_fac
#define min(a, b)
Definition: graphics.c:174
float bend_cost
Definition: vpr_types.h:700
#define HUGE_POSITIVE_FLOAT
Definition: vpr_types.h:79
boolean * is_global
struct s_net * clb_net
Definition: globals.c:28
float initial_pres_fac
Definition: vpr_types.h:697
struct s_trace ** trace_head
Definition: globals.c:64
void pathfinder_update_one_cost(struct s_trace *route_segment_start, int add_or_sub, float pres_fac)
Definition: route_common.c:315
void reserve_locally_used_opins(float pres_fac, boolean rip_up_local_opins, t_ivec **clb_opins_used_locally)
float acc_fac
Definition: vpr_types.h:699
messagelogger vpr_printf
Definition: util.c:17
Definition: util.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function: