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

Go to the source code of this file.

Data Structures

struct  s_heap
 
struct  t_rr_node_route_inf
 

Functions

void pathfinder_update_one_cost (struct s_trace *route_segment_start, int add_or_sub, float pres_fac)
 
void pathfinder_update_cost (float pres_fac, float acc_fac)
 
struct s_traceupdate_traceback (struct s_heap *hptr, int inet)
 
void reset_path_costs (void)
 
float get_rr_cong_cost (int inode)
 
void mark_ends (int inet)
 
void node_to_heap (int inode, float cost, int prev_node, int prev_edge, float backward_path_cost, float R_upstream)
 
boolean is_empty_heap (void)
 
void free_traceback (int inet)
 
void add_to_mod_list (float *fptr)
 
struct s_heapget_heap_head (void)
 
void empty_heap (void)
 
void free_heap_data (struct s_heap *hptr)
 
void invalidate_heap_entries (int sink_node, int ipin_node)
 
void init_route_structs (int bb_factor)
 
void free_rr_node_route_structs (void)
 
void alloc_and_load_rr_node_route_structs (void)
 
void reset_rr_node_route_structs (void)
 
void alloc_route_static_structs (void)
 
void free_trace_structs (void)
 
void reserve_locally_used_opins (float pres_fac, boolean rip_up_local_opins, t_ivec **clb_opins_used_locally)
 
void free_chunk_memory_trace (void)
 

Variables

t_rr_node_route_infrr_node_route_inf
 
struct s_bbroute_bb
 

Function Documentation

void add_to_mod_list ( float *  fptr)

Definition at line 898 of file route_common.c.

898  {
899 
900  /* This routine adds the floating point pointer (fptr) into a *
901  * linked list that indicates all the pathcosts that have been *
902  * modified thus far. */
903 
904  struct s_linked_f_pointer *mod_ptr;
905 
906  mod_ptr = alloc_linked_f_pointer();
907 
908  /* Add this element to the start of the modified list. */
909 
910  mod_ptr->next = rr_modified_head;
911  mod_ptr->fptr = fptr;
912  rr_modified_head = mod_ptr;
913 }
static struct s_linked_f_pointer * rr_modified_head
Definition: route_common.c:49
static struct s_linked_f_pointer * alloc_linked_f_pointer(void)
struct s_linked_f_pointer * next
Definition: vpr_types.h:842

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void alloc_and_load_rr_node_route_structs ( void  )

Definition at line 785 of file route_common.c.

785  {
786 
787  /* Allocates some extra information about each rr_node that is used only *
788  * during routing. */
789 
790  int inode;
791 
792  if (rr_node_route_inf != NULL) {
793  vpr_printf(TIO_MESSAGE_ERROR, "in alloc_and_load_rr_node_route_structs: old rr_node_route_inf array exists.\n");
794  exit(1);
795  }
796 
798 
799  for (inode = 0; inode < num_rr_nodes; inode++) {
802  rr_node_route_inf[inode].pres_cost = 1.;
803  rr_node_route_inf[inode].acc_cost = 1.;
805  rr_node_route_inf[inode].target_flag = 0;
806  }
807 }
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21
#define NO_PREVIOUS
Definition: vpr_types.h:887
#define HUGE_POSITIVE_FLOAT
Definition: vpr_types.h:79
static void * my_malloc(int ibytes)
Definition: graphics.c:499
int num_rr_nodes
Definition: globals.c:69
messagelogger vpr_printf
Definition: util.c:17

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void alloc_route_static_structs ( void  )

Definition at line 623 of file route_common.c.

623  {
624  trace_head = (struct s_trace **) my_calloc(num_nets,
625  sizeof(struct s_trace *));
626  trace_tail = (struct s_trace **) my_malloc(
627  num_nets * sizeof(struct s_trace *));
628 
629  heap_size = nx * ny;
630  heap = (struct s_heap **) my_malloc(heap_size * sizeof(struct s_heap *));
631  heap--; /* heap stores from [1..heap_size] */
632  heap_tail = 1;
633 
634  route_bb = (struct s_bb *) my_malloc(num_nets * sizeof(struct s_bb));
635 }
struct s_trace ** trace_tail
Definition: globals.c:65
void * my_calloc(size_t nelem, size_t size)
Definition: util.c:132
int num_nets
Definition: globals.c:27
static struct s_heap ** heap
Definition: route_common.c:29
static void * my_malloc(int ibytes)
Definition: graphics.c:499
int nx
Definition: globals.c:46
struct s_trace ** trace_head
Definition: globals.c:64
struct s_bb * route_bb
Definition: route_common.c:23
static int heap_tail
Definition: route_common.c:31
int ny
Definition: globals.c:47
static int heap_size
Definition: route_common.c:30

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void empty_heap ( void  )

Definition at line 991 of file route_common.c.

991  {
992 
993  int i;
994 
995  for (i = 1; i < heap_tail; i++)
996  free_heap_data(heap[i]);
997 
998  heap_tail = 1;
999 }
void free_heap_data(struct s_heap *hptr)
static struct s_heap ** heap
Definition: route_common.c:29
static int heap_tail
Definition: route_common.c:31

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void free_chunk_memory_trace ( void  )

Definition at line 1287 of file route_common.c.

1287  {
1288  if (trace_ch.chunk_ptr_head != NULL) {
1290  }
1291 }
struct s_linked_vptr * chunk_ptr_head
Definition: util.h:58
static t_chunk trace_ch
Definition: route_common.c:41
void free_chunk_memory(t_chunk *chunk_info)
Definition: util.c:270

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void free_heap_data ( struct s_heap hptr)

Definition at line 1019 of file route_common.c.

1019  {
1020 
1021  hptr->u.next = heap_free_head;
1022  heap_free_head = hptr;
1023 #ifdef DEBUG
1024  num_heap_allocated--;
1025 #endif
1026 }
struct s_heap * next
Definition: route_common.h:8
union s_heap::@0 u
static struct s_heap * heap_free_head
Definition: route_common.c:34

+ Here is the caller graph for this function:

void free_rr_node_route_structs ( void  )

Definition at line 828 of file route_common.c.

828  {
829 
830  /* Frees the extra information about each rr_node that is needed only *
831  * during routing. */
832 
833  free(rr_node_route_inf);
834  rr_node_route_inf = NULL; /* Mark as free */
835 }
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21

+ Here is the caller graph for this function:

void free_trace_structs ( void  )

Definition at line 733 of file route_common.c.

733  {
734  /*the trace lists are only freed after use by the timing-driven placer */
735  /*Do not free them after use by the router, since stats, and draw */
736  /*routines use the trace values */
737  int i;
738 
739  for (i = 0; i < num_nets; i++)
740  free_traceback(i);
741 
742  if(trace_head) {
743  free(trace_head);
744  free(trace_tail);
745  }
746  trace_head = NULL;
747  trace_tail = NULL;
748 }
struct s_trace ** trace_tail
Definition: globals.c:65
void free_traceback(int inet)
Definition: route_common.c:587
int num_nets
Definition: globals.c:27
struct s_trace ** trace_head
Definition: globals.c:64

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void free_traceback ( int  inet)

Definition at line 587 of file route_common.c.

587  {
588 
589  /* Puts the entire traceback (old routing) for this net on the free list *
590  * and sets the trace_head pointers etc. for the net to NULL. */
591 
592  struct s_trace *tptr, *tempptr;
593 
594  if(trace_head == NULL) {
595  return;
596  }
597 
598  tptr = trace_head[inet];
599 
600  while (tptr != NULL) {
601  tempptr = tptr->next;
602  free_trace_data(tptr);
603  tptr = tempptr;
604  }
605 
606  trace_head[inet] = NULL;
607  trace_tail[inet] = NULL;
608 }
static void free_trace_data(struct s_trace *tptr)
struct s_trace ** trace_tail
Definition: globals.c:65
struct s_trace * next
Definition: vpr_types.h:870
struct s_trace ** trace_head
Definition: globals.c:64

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct s_heap* get_heap_head ( void  )

Definition at line 949 of file route_common.c.

949  {
950 
951  /* Returns a pointer to the smallest element on the heap, or NULL if the *
952  * heap is empty. Invalid (index == OPEN) entries on the heap are never *
953  * returned -- they are just skipped over. */
954 
955  int ito, ifrom;
956  struct s_heap *heap_head, *temp_ptr;
957 
958  do {
959  if (heap_tail == 1) { /* Empty heap. */
960  vpr_printf(TIO_MESSAGE_WARNING, "Empty heap occurred in get_heap_head.\n");
961  vpr_printf(TIO_MESSAGE_WARNING, "Some blocks are impossible to connect in this architecture.\n");
962  return (NULL);
963  }
964 
965  heap_head = heap[1]; /* Smallest element. */
966 
967  /* Now fix up the heap */
968 
969  heap_tail--;
970  heap[1] = heap[heap_tail];
971  ifrom = 1;
972  ito = 2 * ifrom;
973 
974  while (ito < heap_tail) {
975  if (heap[ito + 1]->cost < heap[ito]->cost)
976  ito++;
977  if (heap[ito]->cost > heap[ifrom]->cost)
978  break;
979  temp_ptr = heap[ito];
980  heap[ito] = heap[ifrom];
981  heap[ifrom] = temp_ptr;
982  ifrom = ito;
983  ito = 2 * ifrom;
984  }
985 
986  } while (heap_head->index == OPEN); /* Get another one if invalid entry. */
987 
988  return (heap_head);
989 }
int index
Definition: route_common.h:4
static struct s_heap ** heap
Definition: route_common.c:29
float cost
Definition: route_common.h:5
Definition: slre.c:50
static int heap_tail
Definition: route_common.c:31
messagelogger vpr_printf
Definition: util.c:17

+ Here is the caller graph for this function:

float get_rr_cong_cost ( int  inode)

Definition at line 532 of file route_common.c.

532  {
533 
534  /* Returns the *congestion* cost of using this rr_node. */
535 
536  short cost_index;
537  float cost;
538 
539  cost_index = rr_node[inode].cost_index;
540  cost = rr_indexed_data[cost_index].base_cost
541  * rr_node_route_inf[inode].acc_cost
542  * rr_node_route_inf[inode].pres_cost;
543  return (cost);
544 }
short cost_index
Definition: vpr_types.h:897
t_rr_node * rr_node
Definition: globals.c:70
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21
t_rr_indexed_data * rr_indexed_data
Definition: globals.c:74
float cost
Definition: route_common.h:5

+ Here is the caller graph for this function:

void init_route_structs ( int  bb_factor)

Definition at line 394 of file route_common.c.

394  {
395 
396  /* Call this before you route any nets. It frees any old traceback and *
397  * sets the list of rr_nodes touched to empty. */
398 
399  int i;
400 
401  for (i = 0; i < num_nets; i++)
402  free_traceback(i);
403 
404  load_route_bb(bb_factor);
405 
406  /* Check that things that should have been emptied after the last routing *
407  * really were. */
408 
409  if (rr_modified_head != NULL) {
410  vpr_printf(TIO_MESSAGE_ERROR, "in init_route_structs. List of modified rr nodes is not empty.\n");
411  exit(1);
412  }
413 
414  if (heap_tail != 1) {
415  vpr_printf(TIO_MESSAGE_ERROR, "in init_route_structs. Heap is not empty.\n");
416  exit(1);
417  }
418 }
static void load_route_bb(int bb_factor)
Definition: route_common.c:838
void free_traceback(int inet)
Definition: route_common.c:587
static struct s_linked_f_pointer * rr_modified_head
Definition: route_common.c:49
int num_nets
Definition: globals.c:27
static int heap_tail
Definition: route_common.c:31
messagelogger vpr_printf
Definition: util.c:17

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void invalidate_heap_entries ( int  sink_node,
int  ipin_node 
)

Definition at line 1028 of file route_common.c.

1028  {
1029 
1030  /* Marks all the heap entries consisting of sink_node, where it was reached *
1031  * via ipin_node, as invalid (OPEN). Used only by the breadth_first router *
1032  * and even then only in rare circumstances. */
1033 
1034  int i;
1035 
1036  for (i = 1; i < heap_tail; i++) {
1037  if (heap[i]->index == sink_node && heap[i]->u.prev_node == ipin_node)
1038  heap[i]->index = OPEN; /* Invalid. */
1039  }
1040 }
int index
Definition: route_common.h:4
static struct s_heap ** heap
Definition: route_common.c:29
union s_heap::@0 u
Definition: slre.c:50
static int heap_tail
Definition: route_common.c:31

+ Here is the caller graph for this function:

boolean is_empty_heap ( void  )

Definition at line 944 of file route_common.c.

944  {
945  return (boolean)(heap_tail == 1);
946 }
static int heap_tail
Definition: route_common.c:31
void mark_ends ( int  inet)

Definition at line 546 of file route_common.c.

546  {
547 
548  /* Mark all the SINKs of this net as targets by setting their target flags *
549  * to the number of times the net must connect to each SINK. Note that *
550  * this number can occassionally be greater than 1 -- think of connecting *
551  * the same net to two inputs of an and-gate (and-gate inputs are logically *
552  * equivalent, so both will connect to the same SINK). */
553 
554  int ipin, inode;
555 
556  for (ipin = 1; ipin <= clb_net[inet].num_sinks; ipin++) {
557  inode = net_rr_terminals[inet][ipin];
559  }
560 }
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21
struct s_net * clb_net
Definition: globals.c:28
int ** net_rr_terminals
Definition: globals.c:78
int num_sinks
Definition: vpr_types.h:506

+ Here is the caller graph for this function:

void node_to_heap ( int  inode,
float  cost,
int  prev_node,
int  prev_edge,
float  backward_path_cost,
float  R_upstream 
)

Definition at line 562 of file route_common.c.

563  {
564 
565  /* Puts an rr_node on the heap, if the new cost given is lower than the *
566  * current path_cost to this channel segment. The index of its predecessor *
567  * is stored to make traceback easy. The index of the edge used to get *
568  * from its predecessor to it is also stored to make timing analysis, etc. *
569  * easy. The backward_path_cost and R_upstream values are used only by the *
570  * timing-driven router -- the breadth-first router ignores them. */
571 
572  struct s_heap *hptr;
573 
574  if (cost >= rr_node_route_inf[inode].path_cost)
575  return;
576 
577  hptr = alloc_heap_data();
578  hptr->index = inode;
579  hptr->cost = cost;
580  hptr->u.prev_node = prev_node;
581  hptr->prev_edge = prev_edge;
583  hptr->R_upstream = R_upstream;
584  add_to_heap(hptr);
585 }
int index
Definition: route_common.h:4
float backward_path_cost
Definition: route_common.h:11
int prev_node
Definition: route_common.h:7
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21
static struct s_heap * alloc_heap_data(void)
float R_upstream
Definition: route_common.h:12
static void add_to_heap(struct s_heap *hptr)
Definition: route_common.c:915
union s_heap::@0 u
int prev_edge
Definition: route_common.h:10
float cost
Definition: route_common.h:5

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void pathfinder_update_cost ( float  pres_fac,
float  acc_fac 
)

Definition at line 363 of file route_common.c.

363  {
364 
365  /* This routine recomputes the pres_cost and acc_cost of each routing *
366  * resource for the pathfinder algorithm after all nets have been routed. *
367  * It updates the accumulated cost to by adding in the number of extra *
368  * signals sharing a resource right now (i.e. after each complete iteration) *
369  * times acc_fac. It also updates pres_cost, since pres_fac may have *
370  * changed. THIS ROUTINE ASSUMES THE OCCUPANCY VALUES IN RR_NODE ARE UP TO *
371  * DATE. */
372 
373  int inode, occ, capacity;
374 
375  for (inode = 0; inode < num_rr_nodes; inode++) {
376  occ = rr_node[inode].occ;
377  capacity = rr_node[inode].capacity;
378 
379  if (occ > capacity) {
380  rr_node_route_inf[inode].acc_cost += (occ - capacity) * acc_fac;
381  rr_node_route_inf[inode].pres_cost = 1.
382  + (occ + 1 - capacity) * pres_fac;
383  }
384 
385  /* If occ == capacity, we don't need to increase acc_cost, but a change *
386  * in pres_fac could have made it necessary to recompute the cost anyway. */
387 
388  else if (occ == capacity) {
389  rr_node_route_inf[inode].pres_cost = 1. + pres_fac;
390  }
391  }
392 }
t_rr_node * rr_node
Definition: globals.c:70
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21
static float pres_fac
int num_rr_nodes
Definition: globals.c:69
short capacity
Definition: vpr_types.h:899
short occ
Definition: vpr_types.h:898

+ Here is the caller graph for this function:

void pathfinder_update_one_cost ( struct s_trace route_segment_start,
int  add_or_sub,
float  pres_fac 
)

Definition at line 315 of file route_common.c.

316  {
317 
318  /* This routine updates the occupancy and pres_cost of the rr_nodes that are *
319  * affected by the portion of the routing of one net that starts at *
320  * route_segment_start. If route_segment_start is trace_head[inet], the *
321  * cost of all the nodes in the routing of net inet are updated. If *
322  * add_or_sub is -1 the net (or net portion) is ripped up, if it is 1 the *
323  * net is added to the routing. The size of pres_fac determines how severly *
324  * oversubscribed rr_nodes are penalized. */
325 
326  struct s_trace *tptr;
327  int inode, occ, capacity;
328 
329  tptr = route_segment_start;
330  if (tptr == NULL) /* No routing yet. */
331  return;
332 
333  for (;;) {
334  inode = tptr->index;
335 
336  occ = rr_node[inode].occ + add_or_sub;
337  capacity = rr_node[inode].capacity;
338 
339  rr_node[inode].occ = occ;
340 
341  /* pres_cost is Pn in the Pathfinder paper. I set my pres_cost according to *
342  * the overuse that would result from having ONE MORE net use this routing *
343  * node. */
344 
345  if (occ < capacity) {
346  rr_node_route_inf[inode].pres_cost = 1.;
347  } else {
348  rr_node_route_inf[inode].pres_cost = 1.
349  + (occ + 1 - capacity) * pres_fac;
350  }
351 
352  if (rr_node[inode].type == SINK) {
353  tptr = tptr->next; /* Skip next segment. */
354  if (tptr == NULL)
355  break;
356  }
357 
358  tptr = tptr->next;
359 
360  } /* End while loop -- did an entire traceback. */
361 }
int index
Definition: vpr_types.h:866
t_rr_node * rr_node
Definition: globals.c:70
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21
static float pres_fac
struct s_trace * next
Definition: vpr_types.h:870
short capacity
Definition: vpr_types.h:899
short occ
Definition: vpr_types.h:898

+ Here is the caller graph for this function:

void reserve_locally_used_opins ( float  pres_fac,
boolean  rip_up_local_opins,
t_ivec **  clb_opins_used_locally 
)

Definition at line 1208 of file route_common.c.

1209  {
1210 
1211  /* In the past, this function implicitly allowed LUT duplication when there are free LUTs.
1212  This was especially important for logical equivalence; however, now that we have a very general
1213  logic cluster, it does not make sense to allow LUT duplication implicitly. we'll need to look into how we want to handle this case
1214 
1215  */
1216 
1217  int iblk, num_local_opin, inode, from_node, iconn, num_edges, to_node;
1218  int iclass, ipin;
1219  float cost;
1220  struct s_heap *heap_head_ptr;
1221  t_type_ptr type;
1222 
1223  if (rip_up_local_opins) {
1224  for (iblk = 0; iblk < num_blocks; iblk++) {
1225  type = block[iblk].type;
1226  for (iclass = 0; iclass < type->num_class; iclass++) {
1227  num_local_opin = clb_opins_used_locally[iblk][iclass].nelem;
1228  /* Always 0 for pads and for RECEIVER (IPIN) classes */
1229  for (ipin = 0; ipin < num_local_opin; ipin++) {
1230  inode = clb_opins_used_locally[iblk][iclass].list[ipin];
1232  }
1233  }
1234  }
1235  }
1236 
1237  for (iblk = 0; iblk < num_blocks; iblk++) {
1238  type = block[iblk].type;
1239  for (iclass = 0; iclass < type->num_class; iclass++) {
1240  num_local_opin = clb_opins_used_locally[iblk][iclass].nelem;
1241  /* Always 0 for pads and for RECEIVER (IPIN) classes */
1242 
1243  if (num_local_opin != 0) { /* Have to reserve (use) some OPINs */
1244  from_node = rr_blk_source[iblk][iclass];
1245  num_edges = rr_node[from_node].num_edges;
1246  for (iconn = 0; iconn < num_edges; iconn++) {
1247  to_node = rr_node[from_node].edges[iconn];
1248  cost = get_rr_cong_cost(to_node);
1249  node_to_heap(to_node, cost, OPEN, OPEN, 0., 0.);
1250  }
1251 
1252  for (ipin = 0; ipin < num_local_opin; ipin++) {
1253  heap_head_ptr = get_heap_head();
1254  inode = heap_head_ptr->index;
1256  clb_opins_used_locally[iblk][iclass].list[ipin] = inode;
1257  free_heap_data(heap_head_ptr);
1258  }
1259 
1260  empty_heap();
1261  }
1262  }
1263  }
1264 }
short num_edges
Definition: vpr_types.h:901
int index
Definition: route_common.h:4
float get_rr_cong_cost(int inode)
Definition: route_common.c:532
int * edges
Definition: vpr_types.h:903
struct s_heap * get_heap_head(void)
Definition: route_common.c:949
t_rr_node * rr_node
Definition: globals.c:70
int * list
Definition: util.h:49
void free_heap_data(struct s_heap *hptr)
t_type_ptr type
Definition: vpr_types.h:561
int num_blocks
Definition: globals.c:30
static float pres_fac
struct s_block * block
Definition: globals.c:31
int nelem
Definition: util.h:48
void node_to_heap(int inode, float cost, int prev_node, int prev_edge, float backward_path_cost, float R_upstream)
Definition: route_common.c:562
static void adjust_one_rr_occ_and_pcost(int inode, int add_or_sub, float pres_fac)
int ** rr_blk_source
Definition: globals.c:87
Definition: slre.c:50
void empty_heap(void)
Definition: route_common.c:991

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void reset_path_costs ( void  )

Definition at line 490 of file route_common.c.

490  {
491 
492  /* The routine sets the path_cost to HUGE_POSITIVE_FLOAT for all channel segments *
493  * touched by previous routing phases. */
494 
495  struct s_linked_f_pointer *mod_ptr;
496 
497 #ifdef DEBUG
498  int num_mod_ptrs;
499 #endif
500 
501  /* The traversal method below is slightly painful to make it faster. */
502 
503  if (rr_modified_head != NULL) {
504  mod_ptr = rr_modified_head;
505 
506 #ifdef DEBUG
507  num_mod_ptrs = 1;
508 #endif
509 
510  while (mod_ptr->next != NULL) {
511  *(mod_ptr->fptr) = HUGE_POSITIVE_FLOAT;
512  mod_ptr = mod_ptr->next;
513 #ifdef DEBUG
514  num_mod_ptrs++;
515 #endif
516  }
517  *(mod_ptr->fptr) = HUGE_POSITIVE_FLOAT; /* Do last one. */
518 
519  /* Reset the modified list and put all the elements back in the free *
520  * list. */
521 
522  mod_ptr->next = linked_f_pointer_free_head;
524  rr_modified_head = NULL;
525 
526 #ifdef DEBUG
527  num_linked_f_pointer_allocated -= num_mod_ptrs;
528 #endif
529  }
530 }
static struct s_linked_f_pointer * rr_modified_head
Definition: route_common.c:49
#define HUGE_POSITIVE_FLOAT
Definition: vpr_types.h:79
static struct s_linked_f_pointer * linked_f_pointer_free_head
Definition: route_common.c:50
struct s_linked_f_pointer * next
Definition: vpr_types.h:842

+ Here is the caller graph for this function:

void reset_rr_node_route_structs ( void  )

Definition at line 809 of file route_common.c.

809  {
810 
811  /* Allocates some extra information about each rr_node that is used only *
812  * during routing. */
813 
814  int inode;
815 
816  assert(rr_node_route_inf != NULL);
817 
818  for (inode = 0; inode < num_rr_nodes; inode++) {
821  rr_node_route_inf[inode].pres_cost = 1.;
822  rr_node_route_inf[inode].acc_cost = 1.;
824  rr_node_route_inf[inode].target_flag = 0;
825  }
826 }
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21
#define NO_PREVIOUS
Definition: vpr_types.h:887
#define HUGE_POSITIVE_FLOAT
Definition: vpr_types.h:79
int num_rr_nodes
Definition: globals.c:69

+ Here is the caller graph for this function:

struct s_trace* update_traceback ( struct s_heap hptr,
int  inet 
)

Definition at line 421 of file route_common.c.

421  {
422 
423  /* This routine adds the most recently finished wire segment to the *
424  * traceback linked list. The first connection starts with the net SOURCE *
425  * and begins at the structure pointed to by trace_head[inet]. Each *
426  * connection ends with a SINK. After each SINK, the next connection *
427  * begins (if the net has more than 2 pins). The first element after the *
428  * SINK gives the routing node on a previous piece of the routing, which is *
429  * the link from the existing net to this new piece of the net. *
430  * In each traceback I start at the end of a path and trace back through *
431  * its predecessors to the beginning. I have stored information on the *
432  * predecesser of each node to make traceback easy -- this sacrificies some *
433  * memory for easier code maintenance. This routine returns a pointer to *
434  * the first "new" node in the traceback (node not previously in trace). */
435 
436  struct s_trace *tptr, *prevptr, *temptail, *ret_ptr;
437  int inode;
438  short iedge;
439 
440 #ifdef DEBUG
441  t_rr_type rr_type;
442 #endif
443 
444  inode = hptr->index;
445 
446 #ifdef DEBUG
447  rr_type = rr_node[inode].type;
448  if (rr_type != SINK) {
449  vpr_printf(TIO_MESSAGE_ERROR, "in update_traceback. Expected type = SINK (%d).\n", SINK);
450  vpr_printf(TIO_MESSAGE_ERROR, "\tGot type = %d while tracing back net %d.\n", rr_type, inet);
451  exit(1);
452  }
453 #endif
454 
455  tptr = alloc_trace_data(); /* SINK on the end of the connection */
456  tptr->index = inode;
457  tptr->iswitch = OPEN;
458  tptr->next = NULL;
459  temptail = tptr; /* This will become the new tail at the end */
460  /* of the routine. */
461 
462  /* Now do it's predecessor. */
463 
464  inode = hptr->u.prev_node;
465  iedge = hptr->prev_edge;
466 
467  while (inode != NO_PREVIOUS) {
468  prevptr = alloc_trace_data();
469  prevptr->index = inode;
470  prevptr->iswitch = rr_node[inode].switches[iedge];
471  prevptr->next = tptr;
472  tptr = prevptr;
473 
474  iedge = rr_node_route_inf[inode].prev_edge;
475  inode = rr_node_route_inf[inode].prev_node;
476  }
477 
478  if (trace_tail[inet] != NULL) {
479  trace_tail[inet]->next = tptr; /* Traceback ends with tptr */
480  ret_ptr = tptr->next; /* First new segment. */
481  } else { /* This was the first "chunk" of the net's routing */
482  trace_head[inet] = tptr;
483  ret_ptr = tptr; /* Whole traceback is new. */
484  }
485 
486  trace_tail[inet] = temptail;
487  return (ret_ptr);
488 }
int index
Definition: route_common.h:4
int index
Definition: vpr_types.h:866
struct s_trace ** trace_tail
Definition: globals.c:65
t_rr_node * rr_node
Definition: globals.c:70
int prev_node
Definition: route_common.h:7
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21
short iswitch
Definition: vpr_types.h:867
#define NO_PREVIOUS
Definition: vpr_types.h:887
union s_heap::@0 u
struct s_trace * next
Definition: vpr_types.h:870
int prev_edge
Definition: route_common.h:10
struct s_trace ** trace_head
Definition: globals.c:64
enum e_rr_type t_rr_type
short * switches
Definition: vpr_types.h:904
Definition: slre.c:50
static struct s_trace * alloc_trace_data(void)
messagelogger vpr_printf
Definition: util.c:17
t_rr_type type
Definition: vpr_types.h:902

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct s_bb* route_bb

Definition at line 23 of file route_common.c.

t_rr_node_route_inf* rr_node_route_inf

Definition at line 21 of file route_common.c.