VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
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 6 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 
)

Definition at line 40 of file rr_graph_util.c.

40  {
41 
42  /* Returns the segment number (distance along the channel) of the connection *
43  * box from from_rr_type (CHANX or CHANY) to to_node (IPIN). */
44 
45  if (from_rr_type == CHANX)
46  return (rr_node[to_node].xlow);
47  else
48  /* CHANY */
49  return (rr_node[to_node].ylow);
50 }
t_rr_node * rr_node
Definition: globals.c:70

+ Here is the caller graph for this function:

int seg_index_of_sblock ( int  from_node,
int  to_node 
)

Definition at line 52 of file rr_graph_util.c.

52  {
53 
54  /* Returns the segment number (distance along the channel) of the switch box *
55  * box from from_node (CHANX or CHANY) to to_node (CHANX or CHANY). The *
56  * switch box on the left side of a CHANX segment at (i,j) has seg_index = *
57  * i-1, while the switch box on the right side of that segment has seg_index *
58  * = i. CHANY stuff works similarly. Hence the range of values returned is *
59  * 0 to nx (if from_node is a CHANX) or 0 to ny (if from_node is a CHANY). */
60 
61  t_rr_type from_rr_type, to_rr_type;
62 
63  from_rr_type = rr_node[from_node].type;
64  to_rr_type = rr_node[to_node].type;
65 
66  if (from_rr_type == CHANX) {
67  if (to_rr_type == CHANY) {
68  return (rr_node[to_node].xlow);
69  } else if (to_rr_type == CHANX) {
70  if (rr_node[to_node].xlow > rr_node[from_node].xlow) { /* Going right */
71  return (rr_node[from_node].xhigh);
72  } else { /* Going left */
73  return (rr_node[to_node].xhigh);
74  }
75  } else {
76  vpr_printf(TIO_MESSAGE_ERROR, "in seg_index_of_sblock: to_node %d is of type %d.\n",
77  to_node, to_rr_type);
78  exit(1);
79  }
80  }
81  /* End from_rr_type is CHANX */
82  else if (from_rr_type == CHANY) {
83  if (to_rr_type == CHANX) {
84  return (rr_node[to_node].ylow);
85  } else if (to_rr_type == CHANY) {
86  if (rr_node[to_node].ylow > rr_node[from_node].ylow) { /* Going up */
87  return (rr_node[from_node].yhigh);
88  } else { /* Going down */
89  return (rr_node[to_node].yhigh);
90  }
91  } else {
92  vpr_printf(TIO_MESSAGE_ERROR, "in seg_index_of_sblock: to_node %d is of type %d.\n",
93  to_node, to_rr_type);
94  exit(1);
95  }
96  }
97  /* End from_rr_type is CHANY */
98  else {
99  vpr_printf(TIO_MESSAGE_ERROR, "in seg_index_of_sblock: from_node %d is of type %d.\n",
100  from_node, from_rr_type);
101  exit(1);
102  }
103 }
t_rr_node * rr_node
Definition: globals.c:70
enum e_rr_type t_rr_type
messagelogger vpr_printf
Definition: util.c:17
t_rr_type type
Definition: vpr_types.h:902

+ Here is the caller graph for this function: