VPR-6.0

vpr/SRC/route/rr_graph_util.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_edge

Typedefs

typedef struct s_linked_edge t_linked_edge

Functions

t_linked_edgeinsert_in_edge_list (t_linked_edge *head, int edge, short iswitch)
void free_linked_edge_soft (t_linked_edge *edge_ptr, t_linked_edge **free_list_head_ptr)
int seg_index_of_cblock (t_rr_type from_rr_type, int to_node)
int seg_index_of_sblock (int from_node, int to_node)

Typedef Documentation

typedef struct s_linked_edge t_linked_edge

Definition at line 7 of file rr_graph_util.h.


Function Documentation

void free_linked_edge_soft ( t_linked_edge edge_ptr,
t_linked_edge **  free_list_head_ptr 
)
t_linked_edge* insert_in_edge_list ( t_linked_edge head,
int  edge,
short  iswitch 
)
int seg_index_of_cblock ( t_rr_type  from_rr_type,
int  to_node 
)

Returns the segment number (distance along the channel) of the connection box from from_rr_type (CHANX or CHANY) to to_node (IPIN).

Definition at line 49 of file rr_graph_util.c.

{

    if(from_rr_type == CHANX)
        return (rr_node[to_node].xlow);
    else                        /* CHANY */
        return (rr_node[to_node].ylow);
}

Here is the caller graph for this function:

int seg_index_of_sblock ( int  from_node,
int  to_node 
)

Returns the segment number (distance along the channel) of the switch box box from from_node (CHANX or CHANY) to to_node (CHANX or CHANY). The switch box on the left side of a CHANX segment at (i,j) has seg_index = i-1, while the switch box on the right side of that segment has seg_index = i. CHANY stuff works similarly. Hence the range of values returned is 0 to nx (if from_node is a CHANX) or 0 to ny (if from_node is a CHANY).

Definition at line 67 of file rr_graph_util.c.

{

    t_rr_type from_rr_type, to_rr_type;

    from_rr_type = rr_node[from_node].type;
    to_rr_type = rr_node[to_node].type;

    if(from_rr_type == CHANX)
        {
            if(to_rr_type == CHANY)
                {
                    return (rr_node[to_node].xlow);
                }
            else if(to_rr_type == CHANX)
                {
                    if(rr_node[to_node].xlow > rr_node[from_node].xlow)
                        {       /* Going right */
                            return (rr_node[from_node].xhigh);
                        }
                    else
                        {       /* Going left */
                            return (rr_node[to_node].xhigh);
                        }
                }
            else
                {
                    printf
                        ("Error in seg_index_of_sblock:  to_node %d is of type %d.\n",
                         to_node, to_rr_type);
                    exit(1);
                }
        }
    /* End from_rr_type is CHANX */
    else if(from_rr_type == CHANY)
        {
            if(to_rr_type == CHANX)
                {
                    return (rr_node[to_node].ylow);
                }
            else if(to_rr_type == CHANY)
                {
                    if(rr_node[to_node].ylow > rr_node[from_node].ylow)
                        {       /* Going up */
                            return (rr_node[from_node].yhigh);
                        }
                    else
                        {       /* Going down */
                            return (rr_node[to_node].yhigh);
                        }
                }
            else
                {
                    printf
                        ("Error in seg_index_of_sblock:  to_node %d is of type %d.\n",
                         to_node, to_rr_type);
                    exit(1);
                }
        }
    /* End from_rr_type is CHANY */
    else
        {
            printf
                ("Error in seg_index_of_sblock:  from_node %d is of type %d.\n",
                 from_node, from_rr_type);
            exit(1);
        }
}

Here is the caller graph for this function: