87 struct s_net *nets,
float delay_value);
114 net_delay = (
float **)
my_malloc(n_nets *
sizeof(
float *));
116 for (inet = 0; inet < n_nets; inet++) {
118 ((nets[inet].num_sinks + 1) - 1) *
sizeof(
float),
121 net_delay[inet] = tmp_ptr - 1;
153 rc_node_free_list = NULL;
154 rc_edge_free_list = NULL;
156 for (inet = 0; inet < n_nets; inet++) {
161 &rc_edge_free_list, rr_node_to_rc_node);
165 free_rc_tree(rc_root, &rc_node_free_list, &rc_edge_free_list);
172 free(rr_node_to_rc_node);
176 struct s_net *nets,
int n_nets) {
185 for (inet = 0; inet < n_nets; inet++) {
204 int inode, prev_node;
212 vpr_printf(TIO_MESSAGE_ERROR,
"in alloc_and_load_rc_tree: Traceback for net %d does not exist.\n", inet);
218 root_rc->
inode = inode;
220 rr_node_to_rc_node[inode].
rc_node = root_rc;
225 while (tptr != NULL) {
231 if (rr_node_to_rc_node[inode].rc_node == NULL) {
234 rc_edge_free_list_ptr);
235 rr_node_to_rc_node[inode].
rc_node = curr_rc;
242 prev_node = prev_rc->
inode;
244 vpr_printf(TIO_MESSAGE_ERROR,
"in alloc_and_load_rc_tree: Routing of net %d is not a tree.\n", inet);
249 prev_rc = rr_node_to_rc_node[inode].
rc_node;
263 rc_edge_free_list_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;
294 linked_rc_edge->
child = child_rc;
298 child_rc->
inode = inode;
309 rc_node = *rc_node_free_list_ptr;
311 if (rc_node != NULL) {
312 *rc_node_free_list_ptr = rc_node->
u.
next;
325 rc_node->
u.
next = *rc_node_free_list_ptr;
326 *rc_node_free_list_ptr = rc_node;
337 linked_rc_edge = *rc_edge_free_list_ptr;
339 if (linked_rc_edge != NULL) {
340 *rc_edge_free_list_ptr = linked_rc_edge->
next;
346 return (linked_rc_edge);
354 rc_edge->
next = *rc_edge_free_list_ptr;
355 *rc_edge_free_list_ptr = rc_edge;
368 float C, C_downstream;
371 inode = rc_node->
inode;
374 while (linked_rc_edge != NULL) {
375 iswitch = linked_rc_edge->
iswitch;
376 child_node = linked_rc_edge->
child;
382 linked_rc_edge = linked_rc_edge->
next;
396 float Tdel, Rmetal, Tchild;
403 inode = rc_node->
inode;
419 rc_node->
Tdel = Tdel;
425 while (linked_rc_edge != NULL) {
426 iswitch = linked_rc_edge->
iswitch;
427 child_node = linked_rc_edge->
child;
433 linked_rc_edge = linked_rc_edge->
next;
448 for (ipin = 1; ipin < (nets[inet].
num_sinks + 1); ipin++) {
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;
465 if (linked_rc_ptr != NULL) {
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;
477 next_ptr = linked_rc_ptr->
next;
479 linked_rc_ptr = next_ptr;
480 }
while (linked_rc_ptr != NULL);
482 rr_node_to_rc_node[inode].
next = NULL;
485 net_delay[inet][ipin] = Tmax;
490 struct s_net *nets,
float delay_value) {
496 for (ipin = 1; ipin < (nets[inet].
num_sinks + 1); ipin++)
497 net_delay[inet][ipin] = delay_value;
513 while (rc_edge != NULL) {
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;
537 while (tptr != NULL) {
539 rr_node_to_rc_node[inode].
rc_node = NULL;
550 rc_node = rc_node_free_list;
552 while (rc_node != NULL) {
553 next_node = rc_node->
u.
next;
565 rc_edge = rc_edge_free_list;
567 while (rc_edge != NULL) {
568 next_edge = rc_edge->
next;
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)
void load_net_delay_from_routing(float **net_delay, struct s_net *nets, int n_nets)
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 void free_rc_edge_free_list(t_linked_rc_edge *rc_edge_free_list)
static void load_one_constant_net_delay(float **net_delay, int inet, struct s_net *nets, float delay_value)
static void load_rc_tree_T(t_rc_node *rc_node, float T_arrival)
struct s_linked_rc_edge * next
static float ** net_delay
static t_linked_rc_edge * alloc_linked_rc_edge(t_linked_rc_edge **rc_edge_free_list_ptr)
void * my_chunk_malloc(size_t size, t_chunk *chunk_info)
void * my_calloc(size_t nelem, size_t size)
static void free_rc_node_free_list(t_rc_node *rc_node_free_list)
static void free_linked_rc_edge(t_linked_rc_edge *rc_edge, t_linked_rc_edge **rc_edge_free_list_ptr)
struct s_linked_rc_ptr * next
static void * my_malloc(int ibytes)
static void free_rc_node(t_rc_node *rc_node, t_rc_node **rc_node_free_list_ptr)
struct s_trace ** trace_head
struct s_switch_inf * switch_inf
t_linked_rc_edge * child_list
void free_net_delay(float **net_delay, t_chunk *chunk_list_ptr)
float ** alloc_net_delay(t_chunk *chunk_list_ptr, 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)
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)
struct s_rc_node * rc_node
static void load_one_net_delay(float **net_delay, int inet, struct s_net *nets, t_linked_rc_ptr *rr_node_to_rc_node)
void free_chunk_memory(t_chunk *chunk_info)
static float load_rc_tree_C(t_rc_node *rc_node)
static t_rc_node * alloc_rc_node(t_rc_node **rc_node_free_list_ptr)
static void reset_rr_node_to_rc_node(t_linked_rc_ptr *rr_node_to_rc_node, int inet)