VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
route_common.h
Go to the documentation of this file.
1 /************ Defines and types shared by all route files ********************/
2 
3 struct s_heap {
4  int index;
5  float cost;
6  union {
7  int prev_node;
8  struct s_heap *next;
9  } u;
10  int prev_edge;
12  float R_upstream;
13 };
14 
15 /* Used by the heap as its fundamental data structure. *
16  * index: Index (ID) of this routing resource node. *
17  * cost: Cost up to and including this node. *
18  * u.prev_node: Index (ID) of the predecessor to this node for *
19  * use in traceback. NO_PREVIOUS if none. *
20  * u.next: pointer to the next s_heap structure in the free *
21  * linked list. Not used when on the heap. *
22  * prev_edge: Index of the edge (between 0 and num_edges-1) used to *
23  * connect the previous node to this one. NO_PREVIOUS if *
24  * there is no previous node. *
25  * backward_path_cost: Used only by the timing-driven router. The "known" *
26  * cost of the path up to and including this node. *
27  * In this case, the .cost member contains not only *
28  * the known backward cost but also an expected cost *
29  * to the target. *
30  * R_upstream: Used only by the timing-driven router. Stores the upstream *
31  * resistance to ground from this node, including the *
32  * resistance of the node itself (rr_node[index].R). */
33 
34 typedef struct {
35  int prev_node;
36  float pres_cost;
37  float acc_cost;
38  float path_cost;
40  short prev_edge;
41  short target_flag;
43 
44 /* Extra information about each rr_node needed only during routing (i.e. *
45  * during the maze expansion). *
46  * *
47  * prev_node: Index of the previous node used to reach this one; *
48  * used to generate the traceback. If there is no *
49  * predecessor, prev_node = NO_PREVIOUS. *
50  * pres_cost: Present congestion cost term for this node. *
51  * acc_cost: Accumulated cost term from previous Pathfinder iterations. *
52  * path_cost: Total cost of the path up to and including this node + *
53  * the expected cost to the target if the timing_driven router *
54  * is being used. *
55  * backward_path_cost: Total cost of the path up to and including this *
56  * node. Not used by breadth-first router. *
57  * prev_edge: Index of the edge (from 0 to num_edges-1) that was used *
58  * to reach this node from the previous node. If there is *
59  * no predecessor, prev_edge = NO_PREVIOUS. *
60  * target_flag: Is this node a target (sink) for the current routing? *
61  * Number of times this node must be reached to fully route. */
62 
63 /**************** Variables shared by all route_files ***********************/
64 
65 extern t_rr_node_route_inf *rr_node_route_inf; /* [0..num_rr_nodes-1] */
66 extern struct s_bb *route_bb; /* [0..num_nets-1] */
67 
68 /******* Subroutines in route_common used only by other router modules ******/
69 
70 void pathfinder_update_one_cost(struct s_trace *route_segment_start,
71  int add_or_sub, float pres_fac);
72 
73 void pathfinder_update_cost(float pres_fac, float acc_fac);
74 
75 struct s_trace *update_traceback(struct s_heap *hptr, int inet);
76 
77 void reset_path_costs(void);
78 
79 float get_rr_cong_cost(int inode);
80 
81 void mark_ends(int inet);
82 
83 void node_to_heap(int inode, float cost, int prev_node, int prev_edge,
84  float backward_path_cost, float R_upstream);
85 
86 boolean is_empty_heap(void);
87 
88 void free_traceback(int inet);
89 
90 void add_to_mod_list(float *fptr);
91 
92 struct s_heap *get_heap_head(void);
93 
94 void empty_heap(void);
95 
96 void free_heap_data(struct s_heap *hptr);
97 
98 void invalidate_heap_entries(int sink_node, int ipin_node);
99 
100 void init_route_structs(int bb_factor);
101 
102 void free_rr_node_route_structs(void);
103 
105 
106 void reset_rr_node_route_structs(void);
107 
108 void alloc_route_static_structs(void);
109 
110 void free_trace_structs(void);
111 
112 void reserve_locally_used_opins(float pres_fac, boolean rip_up_local_opins,
114 
115 void free_chunk_memory_trace(void);
116 
117 
int index
Definition: route_common.h:4
void free_heap_data(struct s_heap *hptr)
float backward_path_cost
Definition: route_common.h:11
int prev_node
Definition: route_common.h:7
void invalidate_heap_entries(int sink_node, int ipin_node)
void free_traceback(int inet)
Definition: route_common.c:587
void reset_path_costs(void)
Definition: route_common.c:490
struct s_heap * next
Definition: route_common.h:8
float R_upstream
Definition: route_common.h:12
void node_to_heap(int inode, float cost, int prev_node, int prev_edge, float backward_path_cost, float R_upstream)
Definition: route_common.c:562
void free_chunk_memory_trace(void)
struct s_bb * route_bb
Definition: route_common.c:23
void empty_heap(void)
Definition: route_common.c:991
float get_rr_cong_cost(int inode)
Definition: route_common.c:532
static float pres_fac
void pathfinder_update_cost(float pres_fac, float acc_fac)
Definition: route_common.c:363
static t_ivec ** clb_opins_used_locally
union s_heap::@0 u
void free_rr_node_route_structs(void)
Definition: route_common.c:828
int prev_edge
Definition: route_common.h:10
boolean is_empty_heap(void)
Definition: route_common.c:944
void alloc_route_static_structs(void)
Definition: route_common.c:623
void free_trace_structs(void)
Definition: route_common.c:733
void alloc_and_load_rr_node_route_structs(void)
Definition: route_common.c:785
void mark_ends(int inet)
Definition: route_common.c:546
float cost
Definition: route_common.h:5
void pathfinder_update_one_cost(struct s_trace *route_segment_start, int add_or_sub, float pres_fac)
Definition: route_common.c:315
Definition: util.h:47
void reserve_locally_used_opins(float pres_fac, boolean rip_up_local_opins, t_ivec **clb_opins_used_locally)
struct s_trace * update_traceback(struct s_heap *hptr, int inet)
Definition: route_common.c:421
struct s_heap * get_heap_head(void)
Definition: route_common.c:949
t_rr_node_route_inf * rr_node_route_inf
Definition: route_common.c:21
void add_to_mod_list(float *fptr)
Definition: route_common.c:898
void reset_rr_node_route_structs(void)
Definition: route_common.c:809
void init_route_structs(int bb_factor)
Definition: route_common.c:394