VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
route_tree_timing.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_linked_rt_edge
 
struct  s_rt_node
 

Typedefs

typedef struct s_linked_rt_edge t_linked_rt_edge
 
typedef struct s_rt_node t_rt_node
 

Functions

void alloc_route_tree_timing_structs (void)
 
void free_route_tree_timing_structs (void)
 
t_rt_nodeinit_route_tree_to_source (int inet)
 
void free_route_tree (t_rt_node *rt_node)
 
t_rt_nodeupdate_route_tree (struct s_heap *hptr)
 
void update_net_delays_from_route_tree (float *net_delay, t_rt_node **rt_node_of_sink, int inet)
 

Typedef Documentation

Definition at line 9 of file route_tree_timing.h.

typedef struct s_rt_node t_rt_node

Definition at line 31 of file route_tree_timing.h.

Function Documentation

void alloc_route_tree_timing_structs ( void  )

Definition at line 53 of file route_tree_timing.c.

53  {
54 
55  /* Allocates any structures needed to build the routing trees. */
56 
57  if (rr_node_to_rt_node != NULL || rt_node_free_list != NULL
58  || rt_node_free_list != NULL) {
59  vpr_printf(TIO_MESSAGE_ERROR, "in alloc_route_tree_timing_structs: old structures already exist.\n");
60  exit(1);
61  }
62 
64  num_rr_nodes * sizeof(t_rt_node *));
65 }
static t_rt_node * rt_node_free_list
static void * my_malloc(int ibytes)
Definition: graphics.c:499
int num_rr_nodes
Definition: globals.c:69
static t_rt_node ** rr_node_to_rt_node
messagelogger vpr_printf
Definition: util.c:17

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void free_route_tree ( t_rt_node rt_node)

Definition at line 458 of file route_tree_timing.c.

458  {
459 
460  /* Puts the rt_nodes and edges in the tree rooted at rt_node back on the *
461  * free lists. Recursive, depth-first post-order traversal. */
462 
463  t_rt_node *child_node;
464  t_linked_rt_edge *rt_edge, *next_edge;
465 
466  rt_edge = rt_node->u.child_list;
467 
468  while (rt_edge != NULL) { /* For all children */
469  child_node = rt_edge->child;
470  free_route_tree(child_node);
471  next_edge = rt_edge->next;
472  free_linked_rt_edge(rt_edge);
473  rt_edge = next_edge;
474  }
475 
476  free_rt_node(rt_node);
477 }
struct s_linked_rt_edge * next
static void free_linked_rt_edge(t_linked_rt_edge *rt_edge)
void free_route_tree(t_rt_node *rt_node)
static void free_rt_node(t_rt_node *rt_node)
union s_rt_node::@1 u
t_linked_rt_edge * child_list
struct s_rt_node * child

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void free_route_tree_timing_structs ( void  )

Definition at line 67 of file route_tree_timing.c.

67  {
68 
69  /* Frees the structures needed to build routing trees, and really frees *
70  * (i.e. calls free) all the data on the free lists. */
71 
72  t_rt_node *rt_node, *next_node;
73  t_linked_rt_edge *rt_edge, *next_edge;
74 
75  free(rr_node_to_rt_node);
76  rr_node_to_rt_node = NULL;
77 
78  rt_node = rt_node_free_list;
79 
80  while (rt_node != NULL) {
81  next_node = rt_node->u.next;
82  free(rt_node);
83  rt_node = next_node;
84  }
85 
86  rt_node_free_list = NULL;
87 
88  rt_edge = rt_edge_free_list;
89 
90  while (rt_edge != NULL) {
91  next_edge = rt_edge->next;
92  free(rt_edge);
93  rt_edge = next_edge;
94  }
95 
96  rt_edge_free_list = NULL;
97 }
static t_rt_node * rt_node_free_list
static t_linked_rt_edge * rt_edge_free_list
struct s_linked_rt_edge * next
union s_rt_node::@1 u
static t_rt_node ** rr_node_to_rt_node
struct s_rt_node * next

+ Here is the caller graph for this function:

t_rt_node* init_route_tree_to_source ( int  inet)

Definition at line 155 of file route_tree_timing.c.

155  {
156 
157  /* Initializes the routing tree to just the net source, and returns the root *
158  * node of the rt_tree (which is just the net source). */
159 
160  t_rt_node *rt_root;
161  int inode;
162 
163  rt_root = alloc_rt_node();
164  rt_root->u.child_list = NULL;
165  rt_root->parent_node = NULL;
166  rt_root->parent_switch = OPEN;
167  rt_root->re_expand = TRUE;
168 
169  inode = net_rr_terminals[inet][0]; /* Net source */
170 
171  rt_root->inode = inode;
172  rt_root->C_downstream = rr_node[inode].C;
173  rt_root->R_upstream = rr_node[inode].R;
174  rt_root->Tdel = 0.5 * rr_node[inode].R * rr_node[inode].C;
175  rr_node_to_rt_node[inode] = rt_root;
176 
177  return (rt_root);
178 }
float R
Definition: vpr_types.h:906
float C_downstream
t_rr_node * rr_node
Definition: globals.c:70
struct s_rt_node * parent_node
float C
Definition: vpr_types.h:907
short parent_switch
union s_rt_node::@1 u
static t_rt_node ** rr_node_to_rt_node
static t_rt_node * alloc_rt_node(void)
t_linked_rt_edge * child_list
Definition: slre.c:50
int ** net_rr_terminals
Definition: globals.c:78
Definition: util.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void update_net_delays_from_route_tree ( float *  net_delay,
t_rt_node **  rt_node_of_sink,
int  inet 
)

Definition at line 479 of file route_tree_timing.c.

480  {
481 
482  /* Goes through all the sinks of this net and copies their delay values from *
483  * the route_tree to the net_delay array. */
484 
485  int isink;
486  t_rt_node *sink_rt_node;
487 
488  for (isink = 1; isink <= clb_net[inet].num_sinks; isink++) {
489  sink_rt_node = rt_node_of_sink[isink];
490  net_delay[isink] = sink_rt_node->Tdel;
491  }
492 }
static float ** net_delay
struct s_net * clb_net
Definition: globals.c:28
int num_sinks
Definition: vpr_types.h:506

+ Here is the caller graph for this function:

t_rt_node* update_route_tree ( struct s_heap hptr)

Definition at line 181 of file route_tree_timing.c.

181  {
182 
183  /* Adds the most recently finished wire segment to the routing tree, and *
184  * updates the Tdel, etc. numbers for the rest of the routing tree. hptr *
185  * is the heap pointer of the SINK that was reached. This routine returns *
186  * a pointer to the rt_node of the SINK that it adds to the routing. */
187 
188  t_rt_node *start_of_new_path_rt_node, *sink_rt_node;
189  t_rt_node *unbuffered_subtree_rt_root, *subtree_parent_rt_node;
190  float Tdel_start;
191  short iswitch;
192 
193  start_of_new_path_rt_node = add_path_to_route_tree(hptr, &sink_rt_node);
194  load_new_path_R_upstream(start_of_new_path_rt_node);
195  unbuffered_subtree_rt_root = update_unbuffered_ancestors_C_downstream(
196  start_of_new_path_rt_node);
197 
198  subtree_parent_rt_node = unbuffered_subtree_rt_root->parent_node;
199 
200  if (subtree_parent_rt_node != NULL) { /* Parent exists. */
201  Tdel_start = subtree_parent_rt_node->Tdel;
202  iswitch = unbuffered_subtree_rt_root->parent_switch;
203  Tdel_start += switch_inf[iswitch].R
204  * unbuffered_subtree_rt_root->C_downstream;
205  Tdel_start += switch_inf[iswitch].Tdel;
206  } else { /* Subtree starts at SOURCE */
207  Tdel_start = 0.;
208  }
209 
210  load_rt_subtree_Tdel(unbuffered_subtree_rt_root, Tdel_start);
211 
212  return (sink_rt_node);
213 }
static t_rt_node * add_path_to_route_tree(struct s_heap *hptr, t_rt_node **sink_rt_node_ptr)
float C_downstream
struct s_rt_node * parent_node
short iswitch
Definition: vpr_types.h:867
static void load_rt_subtree_Tdel(t_rt_node *subtree_rt_root, float Tarrival)
short parent_switch
struct s_switch_inf * switch_inf
Definition: globals.c:83
static t_rt_node * update_unbuffered_ancestors_C_downstream(t_rt_node *start_of_new_path_rt_node)
static void load_new_path_R_upstream(t_rt_node *start_of_new_path_rt_node)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: