VPR-6.0

vpr/SRC/route/route_common.h

Go to the documentation of this file.
00001 /************ Defines and types shared by all route files ********************/
00002 
00003 /** Used by the heap as its fundamental data structure.                     
00004  * - index:   Index (ID) of this routing resource node.                      
00005  * - cost:    Cost up to and including this node.                            
00006  * - u.prev_node:  Index (ID) of the predecessor to this node for            
00007  *          use in traceback.  NO_PREVIOUS if none.                         
00008  * - u.next:  pointer to the next s_heap structure in the free               
00009  *          linked list.  Not used when on the heap.                        
00010  * - prev_edge:  Index of the edge (between 0 and num_edges-1) used to      
00011  *             connect the previous node to this one.  NO_PREVIOUS if       
00012  *             there is no previous node.                                   
00013  * - backward_path_cost:  Used only by the timing-driven router.  The "known" 
00014  *                      cost of the path up to and including this node.     
00015  *                      In this case, the .cost member contains not only    
00016  *                      the known backward cost but also an expected cost   
00017  *                      to the target.                                      
00018  * - R_upstream: Used only by the timing-driven router.  Stores the upstream  
00019  *             resistance to ground from this node, including the           
00020  *             resistance of the node itself (rr_node[index].R).            
00021  */
00022 struct s_heap
00023 {
00024     int index;
00025     float cost;
00026     union
00027     {
00028         int prev_node;
00029         struct s_heap *next;
00030     }
00031     u;
00032     int prev_edge;
00033     float backward_path_cost;
00034     float R_upstream;
00035 };
00036 
00037 
00038 /* Extra information about each rr_node needed only during routing (i.e.    
00039  * during the maze expansion).                                              
00040  *                                                                          
00041  * - prev_node:  Index of the previous node used to reach this one;           
00042  *             used to generate the traceback.  If there is no              
00043  *             predecessor, prev_node = NO_PREVIOUS.                        
00044  * - pres_cost:  Present congestion cost term for this node.                  
00045  * - acc_cost:   Accumulated cost term from previous Pathfinder iterations.   
00046  * - path_cost:  Total cost of the path up to and including this node +       
00047  *             the expected cost to the target if the timing_driven router  
00048  *             is being used.                                               
00049  * - backward_path_cost:  Total cost of the path up to and including this     
00050  *                      node.  Not used by breadth-first router.            
00051  * - prev_edge:  Index of the edge (from 0 to num_edges-1) that was used      
00052  *             to reach this node from the previous node.  If there is      
00053  *             no predecessor, prev_edge = NO_PREVIOUS.                     
00054  * - target_flag:  Is this node a target (sink) for the current routing?      
00055  *               Number of times this node must be reached to fully route.  
00056  */
00057 typedef struct
00058 {
00059     int prev_node;
00060     float pres_cost;
00061     float acc_cost;
00062     float path_cost;
00063     float backward_path_cost;
00064     short prev_edge;
00065     short target_flag;
00066 }
00067 t_rr_node_route_inf;
00068 
00069 
00070 
00071 
00072 /**************** Variables shared by all route_files ***********************/
00073 
00074 extern t_rr_node_route_inf *rr_node_route_inf;  /**< [0..num_rr_nodes-1] */
00075 extern struct s_bb *route_bb;   /**< [0..num_nets-1]     */
00076 
00077 /******* Subroutines in route_common used only by other router modules ******/
00078 
00079 void pathfinder_update_one_cost(struct s_trace *route_segment_start,
00080                                 int add_or_sub,
00081                                 float pres_fac);
00082 
00083 void pathfinder_update_cost(float pres_fac,
00084                             float acc_fac);
00085 
00086 struct s_trace *update_traceback(struct s_heap *hptr,
00087                                  int inet);
00088 
00089 void reset_path_costs(void);
00090 
00091 float get_rr_cong_cost(int inode);
00092 
00093 void mark_ends(int inet);
00094 
00095 void node_to_heap(int inode,
00096                   float cost,
00097                   int prev_node,
00098                   int prev_edge,
00099                   float backward_path_cost,
00100                   float R_upstream);
00101 
00102 boolean is_empty_heap(void);
00103 
00104 void free_traceback(int inet);
00105 
00106 void add_to_mod_list(float *fptr);
00107 
00108 struct s_heap *get_heap_head(void);
00109 
00110 void empty_heap(void);
00111 
00112 void free_heap_data(struct s_heap *hptr);
00113 
00114 void invalidate_heap_entries(int sink_node,
00115                              int ipin_node);
00116 
00117 void init_route_structs(int bb_factor);
00118 
00119 void free_rr_node_route_structs(void);
00120 
00121 void alloc_and_load_rr_node_route_structs(void);
00122 
00123 void reset_rr_node_route_structs(void);
00124 
00125 void alloc_route_static_structs();
00126 
00127 void free_trace_structs(void);
00128 
00129 void reserve_locally_used_opins(float pres_fac,
00130                                 boolean rip_up_local_opins,
00131                                 t_ivec ** clb_opins_used_locally);