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

Go to the source code of this file.

Functions

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)
 

Function Documentation

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:

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:

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: