VPR-6.0

vpr/SRC/timing/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 (struct s_linked_vptr **chunk_list_head_ptr, struct s_net *nets, int n_nets)
void free_net_delay (float **net_delay, struct s_linked_vptr **chunk_list_head_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)
void print_net_delay (float **net_delay, char *fname, struct s_net *nets, int n_nets)

Function Documentation

float** alloc_net_delay ( struct s_linked_vptr **  chunk_list_head_ptr,
struct s_net nets,
int  n_nets 
)

Allocates space for the net_delay data structure [0..num_nets-1][1..num_pins-1]. I chunk the data to save space on large problems.

Definition at line 130 of file net_delay.c.

{

    float **net_delay;          /* [0..num_nets-1][1..num_pins-1] */
    float *tmp_ptr;
    int inet;
    int chunk_bytes_avail;
    char *chunk_next_avail_mem;

    *chunk_list_head_ptr = NULL;
    chunk_bytes_avail = 0;
    chunk_next_avail_mem = NULL;

    net_delay = (float **)my_malloc(n_nets * sizeof(float *));

    for(inet = 0; inet < n_nets; inet++)
        {
            tmp_ptr =
                (float *)my_chunk_malloc(((nets[inet].num_sinks + 1) - 1) *
                                         sizeof(float), chunk_list_head_ptr,
                                         &chunk_bytes_avail,
                                         &chunk_next_avail_mem);
                
            net_delay[inet] = tmp_ptr - 1;      /* [1..num_pins-1] */
        }

    return (net_delay);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void free_net_delay ( float **  net_delay,
struct s_linked_vptr **  chunk_list_head_ptr 
)

Frees the net_delay structure. Assumes it was chunk allocated.

Definition at line 162 of file net_delay.c.

{
    free(net_delay);
    free_chunk_memory(*chunk_list_head_ptr);
    *chunk_list_head_ptr = NULL;
}

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 
)

Loads the net_delay array with delay_value for every source - sink connection that is not on a global resource, and with 0. for every source

  • sink connection on a global net. (This can be used to allow timing analysis before routing is done with a constant net delay model).

Definition at line 224 of file net_delay.c.

{

    int inet;

    for(inet = 0; inet < n_nets; inet++)
        {
            if(nets[inet].is_global)
                {
                    load_one_constant_net_delay(net_delay, inet, nets, 0.);
                }
            else
                {
                    load_one_constant_net_delay(net_delay, inet, nets, delay_value);
                }
        }
}

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 
)

This routine loads net_delay[0..num_nets-1][1..num_pins-1]. Each entry is the Elmore delay from the net source to the appropriate sink. Both the rr_graph and the routing traceback must be completely constructed before this routine is called, and the net_delay array must have been allocated.

Definition at line 177 of file net_delay.c.

{


    t_rc_node *rc_node_free_list, *rc_root;
    t_linked_rc_edge *rc_edge_free_list;
    int inet;
    t_linked_rc_ptr *rr_node_to_rc_node;        /* [0..num_rr_nodes-1]  */

    rr_node_to_rc_node = (t_linked_rc_ptr *) my_calloc(num_rr_nodes,
                                                       sizeof
                                                       (t_linked_rc_ptr));

    rc_node_free_list = NULL;
    rc_edge_free_list = NULL;

    for(inet = 0; inet < n_nets; inet++)
        {
            if(nets[inet].is_global)
                {
                    load_one_constant_net_delay(net_delay, inet, nets, 0.);
                }
            else
                {
                    rc_root = alloc_and_load_rc_tree(inet, &rc_node_free_list,
                                                     &rc_edge_free_list,
                                                     rr_node_to_rc_node);
                    load_rc_tree_C(rc_root);
                    load_rc_tree_T(rc_root, 0.);
                    load_one_net_delay(net_delay, inet, nets, rr_node_to_rc_node);
                    free_rc_tree(rc_root, &rc_node_free_list,
                                 &rc_edge_free_list);
                    reset_rr_node_to_rc_node(rr_node_to_rc_node, inet);
                }
        }

    free_rc_node_free_list(rc_node_free_list);
    free_rc_edge_free_list(rc_edge_free_list);
    free(rr_node_to_rc_node);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void print_net_delay ( float **  net_delay,
char *  fname,
struct s_net nets,
int  n_nets 
)

Dumps the net delays into file fname.

Definition at line 685 of file net_delay.c.

{
    FILE *fp;
    int inet, ipin;

    fp = my_fopen(fname, "w", 0);

    for(inet = 0; inet < n_nets; inet++)
        {
            fprintf(fp, "Net: %d.\n", inet);
            fprintf(fp, "Delays:");

            for(ipin = 1; ipin < (nets[inet].num_sinks + 1); ipin++)
                fprintf(fp, " %g", net_delay[inet][ipin]);

            fprintf(fp, "\n\n");
        }

    fclose(fp);
}

Here is the call graph for this function:

Here is the caller graph for this function: