VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
net_delay.c File Reference
#include <stdio.h>
#include "util.h"
#include "vpr_types.h"
#include "globals.h"
#include "net_delay.h"
+ Include dependency graph for net_delay.c:

Go to the source code of this file.

Data Structures

struct  s_linked_rc_edge
 
struct  s_rc_node
 
struct  s_linked_rc_ptr
 

Typedefs

typedef struct s_linked_rc_edge t_linked_rc_edge
 
typedef struct s_rc_node t_rc_node
 
typedef struct s_linked_rc_ptr t_linked_rc_ptr
 

Functions

static t_rc_nodealloc_and_load_rc_tree (int inet, t_rc_node **rc_node_free_list_ptr, t_linked_rc_edge **rc_edge_free_list_ptr, t_linked_rc_ptr *rr_node_to_rc_node)
 
static void add_to_rc_tree (t_rc_node *parent_rc, t_rc_node *child_rc, short iswitch, int inode, t_linked_rc_edge **rc_edge_free_list_ptr)
 
static t_rc_nodealloc_rc_node (t_rc_node **rc_node_free_list_ptr)
 
static void free_rc_node (t_rc_node *rc_node, t_rc_node **rc_node_free_list_ptr)
 
static t_linked_rc_edgealloc_linked_rc_edge (t_linked_rc_edge **rc_edge_free_list_ptr)
 
static void free_linked_rc_edge (t_linked_rc_edge *rc_edge, t_linked_rc_edge **rc_edge_free_list_ptr)
 
static float load_rc_tree_C (t_rc_node *rc_node)
 
static void load_rc_tree_T (t_rc_node *rc_node, float T_arrival)
 
static void load_one_net_delay (float **net_delay, int inet, struct s_net *nets, t_linked_rc_ptr *rr_node_to_rc_node)
 
static void load_one_constant_net_delay (float **net_delay, int inet, struct s_net *nets, float delay_value)
 
static void free_rc_tree (t_rc_node *rc_root, t_rc_node **rc_node_free_list_ptr, t_linked_rc_edge **rc_edge_free_list_ptr)
 
static void reset_rr_node_to_rc_node (t_linked_rc_ptr *rr_node_to_rc_node, int inet)
 
static void free_rc_node_free_list (t_rc_node *rc_node_free_list)
 
static void free_rc_edge_free_list (t_linked_rc_edge *rc_edge_free_list)
 
float ** alloc_net_delay (t_chunk *chunk_list_ptr, struct s_net *nets, int n_nets)
 
void free_net_delay (float **net_delay, t_chunk *chunk_list_ptr)
 
void load_net_delay_from_routing (float **net_delay, struct s_net *nets, int n_nets)
 
void load_constant_net_delay (float **net_delay, float delay_value, struct s_net *nets, int n_nets)
 

Typedef Documentation

Definition at line 15 of file net_delay.c.

Definition at line 52 of file net_delay.c.

typedef struct s_rc_node t_rc_node

Definition at line 33 of file net_delay.c.

Function Documentation

static void add_to_rc_tree ( t_rc_node parent_rc,
t_rc_node child_rc,
short  iswitch,
int  inode,
t_linked_rc_edge **  rc_edge_free_list_ptr 
)
static

Definition at line 280 of file net_delay.c.

281  {
282 
283  /* Adds child_rc to the child list of parent_rc, and sets the switch between *
284  * them to iswitch. This routine also intitializes the child_rc properly *
285  * and sets its node value to inode. */
286 
287  t_linked_rc_edge *linked_rc_edge;
288 
289  linked_rc_edge = alloc_linked_rc_edge(rc_edge_free_list_ptr);
290 
291  linked_rc_edge->next = parent_rc->u.child_list;
292  parent_rc->u.child_list = linked_rc_edge;
293 
294  linked_rc_edge->child = child_rc;
295  linked_rc_edge->iswitch = iswitch;
296 
297  child_rc->u.child_list = NULL;
298  child_rc->inode = inode;
299 }
struct s_rc_node * child
Definition: net_delay.c:10
union s_rc_node::@3 u
struct s_linked_rc_edge * next
Definition: net_delay.c:12
static t_linked_rc_edge * alloc_linked_rc_edge(t_linked_rc_edge **rc_edge_free_list_ptr)
Definition: net_delay.c:330
t_linked_rc_edge * child_list
Definition: net_delay.c:25
int inode
Definition: net_delay.c:28

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static t_rc_node * alloc_and_load_rc_tree ( int  inet,
t_rc_node **  rc_node_free_list_ptr,
t_linked_rc_edge **  rc_edge_free_list_ptr,
t_linked_rc_ptr rr_node_to_rc_node 
)
static

Definition at line 195 of file net_delay.c.

197  {
198 
199  /* Builds a tree describing the routing of net inet. Allocates all the data *
200  * and inserts all the connections in the tree. */
201 
202  t_rc_node *curr_rc, *prev_rc, *root_rc;
203  struct s_trace *tptr;
204  int inode, prev_node;
205  short iswitch;
206  t_linked_rc_ptr *linked_rc_ptr;
207 
208  root_rc = alloc_rc_node(rc_node_free_list_ptr);
209  tptr = trace_head[inet];
210 
211  if (tptr == NULL) {
212  vpr_printf(TIO_MESSAGE_ERROR, "in alloc_and_load_rc_tree: Traceback for net %d does not exist.\n", inet);
213  exit(1);
214  }
215 
216  inode = tptr->index;
217  iswitch = tptr->iswitch;
218  root_rc->inode = inode;
219  root_rc->u.child_list = NULL;
220  rr_node_to_rc_node[inode].rc_node = root_rc;
221 
222  prev_rc = root_rc;
223  tptr = tptr->next;
224 
225  while (tptr != NULL) {
226  inode = tptr->index;
227 
228  /* Is this node a "stitch-in" point to part of the existing routing or a *
229  * new piece of routing along the current routing "arm?" */
230 
231  if (rr_node_to_rc_node[inode].rc_node == NULL) { /* Part of current "arm" */
232  curr_rc = alloc_rc_node(rc_node_free_list_ptr);
233  add_to_rc_tree(prev_rc, curr_rc, iswitch, inode,
234  rc_edge_free_list_ptr);
235  rr_node_to_rc_node[inode].rc_node = curr_rc;
236  prev_rc = curr_rc;
237  }
238 
239  else if (rr_node[inode].type != SINK) { /* Connection to old stuff. */
240 
241 #ifdef DEBUG
242  prev_node = prev_rc->inode;
243  if (rr_node[prev_node].type != SINK) {
244  vpr_printf(TIO_MESSAGE_ERROR, "in alloc_and_load_rc_tree: Routing of net %d is not a tree.\n", inet);
245  exit(1);
246  }
247 #endif
248 
249  prev_rc = rr_node_to_rc_node[inode].rc_node;
250  }
251 
252  else { /* SINK that this net has connected to more than once. */
253 
254  /* I can connect to a SINK node more than once in some weird architectures. *
255  * That means the routing isn't really a tree -- there is reconvergent *
256  * fanout from two or more IPINs into one SINK. I convert this structure *
257  * into a true RC tree on the fly by creating a new rc_node each time I hit *
258  * the same sink. This means I need to keep a linked list of the rc_nodes *
259  * associated with the rr_node (inode) associated with that SINK. */
260 
261  curr_rc = alloc_rc_node(rc_node_free_list_ptr);
262  add_to_rc_tree(prev_rc, curr_rc, iswitch, inode,
263  rc_edge_free_list_ptr);
264 
265  linked_rc_ptr = (t_linked_rc_ptr *) my_malloc(
266  sizeof(t_linked_rc_ptr));
267  linked_rc_ptr->next = rr_node_to_rc_node[inode].next;
268  rr_node_to_rc_node[inode].next = linked_rc_ptr;
269  linked_rc_ptr->rc_node = curr_rc;
270 
271  prev_rc = curr_rc;
272  }
273  iswitch = tptr->iswitch;
274  tptr = tptr->next;
275  }
276 
277  return (root_rc);
278 }
int index
Definition: vpr_types.h:866
static void add_to_rc_tree(t_rc_node *parent_rc, t_rc_node *child_rc, short iswitch, int inode, t_linked_rc_edge **rc_edge_free_list_ptr)
Definition: net_delay.c:280
union s_rc_node::@3 u
t_rr_node * rr_node
Definition: globals.c:70
short iswitch
Definition: vpr_types.h:867
struct s_linked_rc_ptr * next
Definition: net_delay.c:49
struct s_trace * next
Definition: vpr_types.h:870
static void * my_malloc(int ibytes)
Definition: graphics.c:499
struct s_trace ** trace_head
Definition: globals.c:64
t_linked_rc_edge * child_list
Definition: net_delay.c:25
struct s_rc_node * rc_node
Definition: net_delay.c:48
messagelogger vpr_printf
Definition: util.c:17
int inode
Definition: net_delay.c:28
static t_rc_node * alloc_rc_node(t_rc_node **rc_node_free_list_ptr)
Definition: net_delay.c:302

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static t_linked_rc_edge * alloc_linked_rc_edge ( t_linked_rc_edge **  rc_edge_free_list_ptr)
static

Definition at line 330 of file net_delay.c.

330  {
331 
332  /* Allocates a new linked_rc_edge, from the free list if possible, from the *
333  * free store otherwise. */
334 
335  t_linked_rc_edge *linked_rc_edge;
336 
337  linked_rc_edge = *rc_edge_free_list_ptr;
338 
339  if (linked_rc_edge != NULL) {
340  *rc_edge_free_list_ptr = linked_rc_edge->next;
341  } else {
342  linked_rc_edge = (t_linked_rc_edge *) my_malloc(
343  sizeof(t_linked_rc_edge));
344  }
345 
346  return (linked_rc_edge);
347 }
struct s_linked_rc_edge * next
Definition: net_delay.c:12
static void * my_malloc(int ibytes)
Definition: graphics.c:499

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float** alloc_net_delay ( t_chunk chunk_list_ptr,
struct s_net nets,
int  n_nets 
)

Definition at line 103 of file net_delay.c.

104  {
105 
106  /* Allocates space for the net_delay data structure *
107  * [0..num_nets-1][1..num_pins-1]. I chunk the data to save space on large *
108  * problems. */
109 
110  float **net_delay; /* [0..num_nets-1][1..num_pins-1] */
111  float *tmp_ptr;
112  int inet;
113 
114  net_delay = (float **) my_malloc(n_nets * sizeof(float *));
115 
116  for (inet = 0; inet < n_nets; inet++) {
117  tmp_ptr = (float *) my_chunk_malloc(
118  ((nets[inet].num_sinks + 1) - 1) * sizeof(float),
119  chunk_list_ptr);
120 
121  net_delay[inet] = tmp_ptr - 1; /* [1..num_pins-1] */
122  }
123 
124  return (net_delay);
125 }
static float ** net_delay
void * my_chunk_malloc(size_t size, t_chunk *chunk_info)
Definition: util.c:184
static void * my_malloc(int ibytes)
Definition: graphics.c:499

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static t_rc_node * alloc_rc_node ( t_rc_node **  rc_node_free_list_ptr)
static

Definition at line 302 of file net_delay.c.

302  {
303 
304  /* Allocates a new rc_node, from the free list if possible, from the free *
305  * store otherwise. */
306 
307  t_rc_node *rc_node;
308 
309  rc_node = *rc_node_free_list_ptr;
310 
311  if (rc_node != NULL) {
312  *rc_node_free_list_ptr = rc_node->u.next;
313  } else {
314  rc_node = (t_rc_node *) my_malloc(sizeof(t_rc_node));
315  }
316 
317  return (rc_node);
318 }
struct s_rc_node * next
Definition: net_delay.c:26
union s_rc_node::@3 u
static void * my_malloc(int ibytes)
Definition: graphics.c:499

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void free_linked_rc_edge ( t_linked_rc_edge rc_edge,
t_linked_rc_edge **  rc_edge_free_list_ptr 
)
static

Definition at line 349 of file net_delay.c.

350  {
351 
352  /* Adds the rc_edge to the rc_edge free list. */
353 
354  rc_edge->next = *rc_edge_free_list_ptr;
355  *rc_edge_free_list_ptr = rc_edge;
356 }
struct s_linked_rc_edge * next
Definition: net_delay.c:12

+ Here is the caller graph for this function:

void free_net_delay ( float **  net_delay,
t_chunk chunk_list_ptr 
)

Definition at line 127 of file net_delay.c.

128  {
129 
130  /* Frees the net_delay structure. Assumes it was chunk allocated. */
131 
132  free(net_delay);
133  free_chunk_memory(chunk_list_ptr);
134 }
static float ** net_delay
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:

static void free_rc_edge_free_list ( t_linked_rc_edge rc_edge_free_list)
static

Definition at line 559 of file net_delay.c.

559  {
560 
561  /* Really frees (i.e. calls free()) all the rc_edges on the free list. */
562 
563  t_linked_rc_edge *rc_edge, *next_edge;
564 
565  rc_edge = rc_edge_free_list;
566 
567  while (rc_edge != NULL) {
568  next_edge = rc_edge->next;
569  free(rc_edge);
570  rc_edge = next_edge;
571  }
572 }
struct s_linked_rc_edge * next
Definition: net_delay.c:12

+ Here is the caller graph for this function:

static void free_rc_node ( t_rc_node rc_node,
t_rc_node **  rc_node_free_list_ptr 
)
static

Definition at line 320 of file net_delay.c.

321  {
322 
323  /* Adds rc_node to the proper free list. */
324 
325  rc_node->u.next = *rc_node_free_list_ptr;
326  *rc_node_free_list_ptr = rc_node;
327 }
struct s_rc_node * next
Definition: net_delay.c:26
union s_rc_node::@3 u

+ Here is the caller graph for this function:

static void free_rc_node_free_list ( t_rc_node rc_node_free_list)
static

Definition at line 544 of file net_delay.c.

544  {
545 
546  /* Really frees (i.e. calls free()) all the rc_nodes on the free list. */
547 
548  t_rc_node *rc_node, *next_node;
549 
550  rc_node = rc_node_free_list;
551 
552  while (rc_node != NULL) {
553  next_node = rc_node->u.next;
554  free(rc_node);
555  rc_node = next_node;
556  }
557 }
struct s_rc_node * next
Definition: net_delay.c:26
union s_rc_node::@3 u

+ Here is the caller graph for this function:

static void free_rc_tree ( t_rc_node rc_root,
t_rc_node **  rc_node_free_list_ptr,
t_linked_rc_edge **  rc_edge_free_list_ptr 
)
static

Definition at line 500 of file net_delay.c.

502  {
503 
504  /* Puts the rc tree pointed to by rc_root back on the free list. Depth- *
505  * first post-order traversal via recursion. */
506 
507  t_rc_node *rc_node, *child_node;
508  t_linked_rc_edge *rc_edge, *next_edge;
509 
510  rc_node = rc_root;
511  rc_edge = rc_node->u.child_list;
512 
513  while (rc_edge != NULL) { /* For all children */
514  child_node = rc_edge->child;
515  free_rc_tree(child_node, rc_node_free_list_ptr, rc_edge_free_list_ptr);
516  next_edge = rc_edge->next;
517  free_linked_rc_edge(rc_edge, rc_edge_free_list_ptr);
518  rc_edge = next_edge;
519  }
520 
521  free_rc_node(rc_node, rc_node_free_list_ptr);
522 }
struct s_rc_node * child
Definition: net_delay.c:10
union s_rc_node::@3 u
struct s_linked_rc_edge * next
Definition: net_delay.c:12
static void free_linked_rc_edge(t_linked_rc_edge *rc_edge, t_linked_rc_edge **rc_edge_free_list_ptr)
Definition: net_delay.c:349
static void free_rc_node(t_rc_node *rc_node, t_rc_node **rc_node_free_list_ptr)
Definition: net_delay.c:320
t_linked_rc_edge * child_list
Definition: net_delay.c:25
static void free_rc_tree(t_rc_node *rc_root, t_rc_node **rc_node_free_list_ptr, t_linked_rc_edge **rc_edge_free_list_ptr)
Definition: net_delay.c:500

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void load_constant_net_delay ( float **  net_delay,
float  delay_value,
struct s_net nets,
int  n_nets 
)

Definition at line 175 of file net_delay.c.

176  {
177 
178  /* Loads the net_delay array with delay_value for every source - sink *
179  * connection that is not on a global resource, and with 0. for every source *
180  * - sink connection on a global net. (This can be used to allow timing *
181  * analysis before routing is done with a constant net delay model). */
182 
183  int inet;
184 
185  for (inet = 0; inet < n_nets; inet++) {
186  if (nets[inet].is_global) {
187  load_one_constant_net_delay(net_delay, inet, nets, 0.);
188  } else {
189  load_one_constant_net_delay(net_delay, inet, nets, delay_value);
190  }
191  }
192 }
static void load_one_constant_net_delay(float **net_delay, int inet, struct s_net *nets, float delay_value)
Definition: net_delay.c:489
static float ** net_delay
boolean * is_global

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void load_net_delay_from_routing ( float **  net_delay,
struct s_net nets,
int  n_nets 
)

Definition at line 136 of file net_delay.c.

137  {
138 
139  /* This routine loads net_delay[0..num_nets-1][1..num_pins-1]. Each entry *
140  * is the Elmore delay from the net source to the appropriate sink. Both *
141  * the rr_graph and the routing traceback must be completely constructed *
142  * before this routine is called, and the net_delay array must have been *
143  * allocated. */
144 
145  t_rc_node *rc_node_free_list, *rc_root;
146  t_linked_rc_edge *rc_edge_free_list;
147  int inet;
148  t_linked_rc_ptr *rr_node_to_rc_node; /* [0..num_rr_nodes-1] */
149 
150  rr_node_to_rc_node = (t_linked_rc_ptr *) my_calloc(num_rr_nodes,
151  sizeof(t_linked_rc_ptr));
152 
153  rc_node_free_list = NULL;
154  rc_edge_free_list = NULL;
155 
156  for (inet = 0; inet < n_nets; inet++) {
157  if (nets[inet].is_global) {
158  load_one_constant_net_delay(net_delay, inet, nets, 0.);
159  } else {
160  rc_root = alloc_and_load_rc_tree(inet, &rc_node_free_list,
161  &rc_edge_free_list, rr_node_to_rc_node);
162  load_rc_tree_C(rc_root);
163  load_rc_tree_T(rc_root, 0.);
164  load_one_net_delay(net_delay, inet, nets, rr_node_to_rc_node);
165  free_rc_tree(rc_root, &rc_node_free_list, &rc_edge_free_list);
166  reset_rr_node_to_rc_node(rr_node_to_rc_node, inet);
167  }
168  }
169 
170  free_rc_node_free_list(rc_node_free_list);
171  free_rc_edge_free_list(rc_edge_free_list);
172  free(rr_node_to_rc_node);
173 }
static t_rc_node * alloc_and_load_rc_tree(int inet, t_rc_node **rc_node_free_list_ptr, t_linked_rc_edge **rc_edge_free_list_ptr, t_linked_rc_ptr *rr_node_to_rc_node)
Definition: net_delay.c:195
static void free_rc_edge_free_list(t_linked_rc_edge *rc_edge_free_list)
Definition: net_delay.c:559
static void load_one_constant_net_delay(float **net_delay, int inet, struct s_net *nets, float delay_value)
Definition: net_delay.c:489
static void load_rc_tree_T(t_rc_node *rc_node, float T_arrival)
Definition: net_delay.c:389
static float ** net_delay
void * my_calloc(size_t nelem, size_t size)
Definition: util.c:132
static void free_rc_node_free_list(t_rc_node *rc_node_free_list)
Definition: net_delay.c:544
boolean * is_global
int num_rr_nodes
Definition: globals.c:69
static void free_rc_tree(t_rc_node *rc_root, t_rc_node **rc_node_free_list_ptr, t_linked_rc_edge **rc_edge_free_list_ptr)
Definition: net_delay.c:500
static void load_one_net_delay(float **net_delay, int inet, struct s_net *nets, t_linked_rc_ptr *rr_node_to_rc_node)
Definition: net_delay.c:437
static float load_rc_tree_C(t_rc_node *rc_node)
Definition: net_delay.c:358
static void reset_rr_node_to_rc_node(t_linked_rc_ptr *rr_node_to_rc_node, int inet)
Definition: net_delay.c:524

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_one_constant_net_delay ( float **  net_delay,
int  inet,
struct s_net nets,
float  delay_value 
)
static

Definition at line 489 of file net_delay.c.

490  {
491 
492  /* Sets each entry of the net_delay array for net inet to delay_value. */
493 
494  int ipin;
495 
496  for (ipin = 1; ipin < (nets[inet].num_sinks + 1); ipin++)
497  net_delay[inet][ipin] = delay_value;
498 }
static float ** net_delay
int num_sinks
Definition: vpr_types.h:506

+ Here is the caller graph for this function:

static void load_one_net_delay ( float **  net_delay,
int  inet,
struct s_net nets,
t_linked_rc_ptr rr_node_to_rc_node 
)
static

Definition at line 437 of file net_delay.c.

438  {
439 
440  /* Loads the net delay array for net inet. The rc tree for that net must *
441  * have already been completely built and loaded. */
442 
443  int ipin, inode;
444  float Tmax;
445  t_rc_node *rc_node;
446  t_linked_rc_ptr *linked_rc_ptr, *next_ptr;
447 
448  for (ipin = 1; ipin < (nets[inet].num_sinks + 1); ipin++) {
449 
450  inode = net_rr_terminals[inet][ipin];
451 
452  linked_rc_ptr = rr_node_to_rc_node[inode].next;
453  rc_node = rr_node_to_rc_node[inode].rc_node;
454  Tmax = rc_node->Tdel;
455 
456  /* If below only executes when one net connects several times to the *
457  * same SINK. In this case, I can't tell which net pin each connection *
458  * to this SINK corresponds to (I can just choose arbitrarily). To make *
459  * sure the timing behaviour converges, I pessimistically set the delay *
460  * for all of the connections to this SINK by this net to be the max. of *
461  * the delays from this net to this SINK. NB: This code only occurs *
462  * when a net connect more than once to the same pin class on the same *
463  * logic block. Only a weird architecture would allow this. */
464 
465  if (linked_rc_ptr != NULL) {
466 
467  /* The first time I hit a multiply-used SINK, I choose the largest delay *
468  * from this net to this SINK and use it for every connection to this *
469  * SINK by this net. */
470 
471  do {
472  rc_node = linked_rc_ptr->rc_node;
473  if (rc_node->Tdel > Tmax) {
474  Tmax = rc_node->Tdel;
475  rr_node_to_rc_node[inode].rc_node = rc_node;
476  }
477  next_ptr = linked_rc_ptr->next;
478  free(linked_rc_ptr);
479  linked_rc_ptr = next_ptr;
480  } while (linked_rc_ptr != NULL); /* End do while */
481 
482  rr_node_to_rc_node[inode].next = NULL;
483  }
484  /* End of if multiply-used SINK */
485  net_delay[inet][ipin] = Tmax;
486  }
487 }
static float ** net_delay
struct s_linked_rc_ptr * next
Definition: net_delay.c:49
float Tdel
Definition: net_delay.c:30
struct s_rc_node * rc_node
Definition: net_delay.c:48
int ** net_rr_terminals
Definition: globals.c:78
int num_sinks
Definition: vpr_types.h:506

+ Here is the caller graph for this function:

static float load_rc_tree_C ( t_rc_node rc_node)
static

Definition at line 358 of file net_delay.c.

358  {
359 
360  /* Does a post-order traversal of the rc tree to load each node's *
361  * C_downstream with the proper sum of all the downstream capacitances. *
362  * This routine calls itself recursively to perform the traversal. */
363 
364  t_linked_rc_edge *linked_rc_edge;
365  t_rc_node *child_node;
366  int inode;
367  short iswitch;
368  float C, C_downstream;
369 
370  linked_rc_edge = rc_node->u.child_list;
371  inode = rc_node->inode;
372  C = rr_node[inode].C;
373 
374  while (linked_rc_edge != NULL) { /* For all children */
375  iswitch = linked_rc_edge->iswitch;
376  child_node = linked_rc_edge->child;
377  C_downstream = load_rc_tree_C(child_node);
378 
379  if (switch_inf[iswitch].buffered == FALSE)
380  C += C_downstream;
381 
382  linked_rc_edge = linked_rc_edge->next;
383  }
384 
385  rc_node->C_downstream = C;
386  return (C);
387 }
struct s_rc_node * child
Definition: net_delay.c:10
union s_rc_node::@3 u
t_rr_node * rr_node
Definition: globals.c:70
float C_downstream
Definition: net_delay.c:29
short iswitch
Definition: vpr_types.h:867
struct s_linked_rc_edge * next
Definition: net_delay.c:12
float C
Definition: vpr_types.h:907
Definition: util.h:12
struct s_switch_inf * switch_inf
Definition: globals.c:83
t_linked_rc_edge * child_list
Definition: net_delay.c:25
int inode
Definition: net_delay.c:28
static float load_rc_tree_C(t_rc_node *rc_node)
Definition: net_delay.c:358

+ Here is the caller graph for this function:

static void load_rc_tree_T ( t_rc_node rc_node,
float  T_arrival 
)
static

Definition at line 389 of file net_delay.c.

389  {
390 
391  /* This routine does a pre-order depth-first traversal of the rc tree to *
392  * compute the Tdel to each node in the rc tree. The T_arrival is the time *
393  * at which the signal hits the input to this node. This routine calls *
394  * itself recursively to perform the traversal. */
395 
396  float Tdel, Rmetal, Tchild;
397  t_linked_rc_edge *linked_rc_edge;
398  t_rc_node *child_node;
399  short iswitch;
400  int inode;
401 
402  Tdel = T_arrival;
403  inode = rc_node->inode;
404  Rmetal = rr_node[inode].R;
405 
406  /* NB: rr_node[inode].C gives the capacitance of this node, while *
407  * rc_node->C_downstream gives the unbuffered downstream capacitance rooted *
408  * at this node, including the C of the node itself. I want to multiply *
409  * the C of this node by 0.5 Rmetal, since it's a distributed RC line. *
410  * Hence 0.5 Rmetal * Cnode is a pessimistic estimate of delay (i.e. end to *
411  * end). For the downstream capacitance rooted at this node (not including *
412  * the capacitance of the node itself), I assume it is, on average, *
413  * connected halfway along the line, so I also multiply by 0.5 Rmetal. To *
414  * be totally pessimistic I would multiply the downstream part of the *
415  * capacitance by Rmetal. Play with this equation if you like. */
416 
417  /* Rmetal is distributed so x0.5 */
418  Tdel += 0.5 * rc_node->C_downstream * Rmetal;
419  rc_node->Tdel = Tdel;
420 
421  /* Now expand the children of this node to load their Tdel values. */
422 
423  linked_rc_edge = rc_node->u.child_list;
424 
425  while (linked_rc_edge != NULL) { /* For all children */
426  iswitch = linked_rc_edge->iswitch;
427  child_node = linked_rc_edge->child;
428 
429  Tchild = Tdel + switch_inf[iswitch].R * child_node->C_downstream;
430  Tchild += switch_inf[iswitch].Tdel; /* Intrinsic switch delay. */
431  load_rc_tree_T(child_node, Tchild);
432 
433  linked_rc_edge = linked_rc_edge->next;
434  }
435 }
float R
Definition: vpr_types.h:906
struct s_rc_node * child
Definition: net_delay.c:10
union s_rc_node::@3 u
t_rr_node * rr_node
Definition: globals.c:70
static void load_rc_tree_T(t_rc_node *rc_node, float T_arrival)
Definition: net_delay.c:389
float C_downstream
Definition: net_delay.c:29
short iswitch
Definition: vpr_types.h:867
struct s_linked_rc_edge * next
Definition: net_delay.c:12
float Tdel
Definition: net_delay.c:30
struct s_switch_inf * switch_inf
Definition: globals.c:83
t_linked_rc_edge * child_list
Definition: net_delay.c:25
int inode
Definition: net_delay.c:28

+ Here is the caller graph for this function:

static void reset_rr_node_to_rc_node ( t_linked_rc_ptr rr_node_to_rc_node,
int  inet 
)
static

Definition at line 524 of file net_delay.c.

525  {
526 
527  /* Resets the rr_node_to_rc_node mapping entries that were set during *
528  * construction of the RC tree for net inet. Any extra linked list entries *
529  * added to deal with a SINK being connected to multiple times have already *
530  * been freed by load_one_net_delay. */
531 
532  struct s_trace *tptr;
533  int inode;
534 
535  tptr = trace_head[inet];
536 
537  while (tptr != NULL) {
538  inode = tptr->index;
539  rr_node_to_rc_node[inode].rc_node = NULL;
540  tptr = tptr->next;
541  }
542 }
int index
Definition: vpr_types.h:866
struct s_trace * next
Definition: vpr_types.h:870
struct s_trace ** trace_head
Definition: globals.c:64
struct s_rc_node * rc_node
Definition: net_delay.c:48

+ Here is the caller graph for this function: