1 /************************************************************
3 ** COPYRIGHT (C) 1993 UNIVERSITY OF PITTSBURGH
4 ** COPYRIGHT (C) 1996 GANNON UNIVERSITY
7 ** This software is distributed on an as-is basis
8 ** with no warranty implied or intended. No author
9 ** or distributor takes responsibility to anyone
10 ** regarding its use of or suitability.
12 ** The software may be distributed and modified
13 ** freely for academic and other non-commercial
14 ** use but may NOT be utilized or included in whole
15 ** or part within any commercial product.
17 ** This copyright notice must remain on all copies
18 ** and modified versions of this software.
20 ************************************************************/
24 * As part of MS Thesis Work, S T Frezza, UPitt Engineering
27 * This file contains the global and local routing structures used to perform the routing fns
39 #define GRAY_MARGIN 0.05
41 #define TRACK_WEIGHT 30.0
42 #define LENGTH_WEIGHT 1.0
43 #define FORWARD_EST_MULTIPLIER 0.80
44 #define EXPECTED_CORNERS 3
73 /* Structure Definitions and type definitions: */
74 typedef struct arc_struct asg_arc
;
75 typedef struct arc_list_struct arclist
;
76 typedef struct expansion_struct expn
;
77 typedef struct expn_list_struct expnlist
;
78 typedef struct trail_struct trail
;
79 typedef struct trail_ilist_str trailist
;
80 typedef struct trail_list_str trlist
;
81 typedef struct range_struct range
;
82 typedef struct range_list_str rnglist
;
83 typedef struct corner_struct corner
;
84 typedef struct corner_list_str crnlist
;
87 /* structure to manage arcs in the global router */
89 nlist
*nets
; /* nets that use this arc for their GR */
90 crnlist
*corners
; /* local routing corners that currently use this arc */
91 int congestion
; /* congestion level */
92 int page
; /* Indicates which page this tile belongs to. */
93 int vcap
, hcap
; /* Vertical and Horizontal capacities (# of tracks) */
94 tile
*t
; /* tile associated with this arc */
95 module
*mod
; /* Used to hold the original contents of the tile */
96 trailist
*trails
[HASH_SIZE
];/* pointers to trails that use this tile */
97 int local
, count
; /* used for stats */
100 struct expansion_struct
101 /* structure to manage multipoint, pseudo-similtaneous expansions within the
102 * arc/edge configuration. One of these should be used for every terminal in
105 net
*n
; /* Net to which the terminal belongs */
106 term
*t
; /* Terminal from which the expansions began */
107 tilist
*seen
; /* list of tiles that this expn has visited */
108 trailist
*queue
[HASH_SIZE
]; /* Hash table of trails, from which the
109 next move is selected */
110 expnlist
*siblings
; /* (shared) list of expns that make up this expansion group */
111 trlist
*connections
;/* (shared) list of trails that form complete paths */
112 int eCount
; /* for statistics */
117 /* This is a possible global route; Only if *used is set are there
118 ranges associated with the trail. */
120 expn
*ex
; /* Parent expansion */
121 expn
*jEx
; /* Who was contacted at termination */
122 tilist
*tr
; /* ordered list of tiles traversed */
123 int page
, direction
;/* array indecies to the root tile for the next expansion set */
124 crnlist
*used
; /* Pointer to the set of corners that
125 comprise this trail (when constructed) */
129 struct trail_ilist_str
/* Indexed form */
131 int index
; /* trail cost */
136 struct trail_list_str
/* Non-indexed form */
143 struct expn_list_struct
149 struct arc_list_struct
156 /* The following are used to implement the local router: */
159 srange
*sr
; /* The min/max limits of this range. */
161 net
*n
; /* The net that this range is a part of */
162 crnlist
*corners
; /* Corners linked by this range */
163 crnlist
*dep
; /* Corners who's placement this range is constrained by */
166 struct range_list_str
176 int vertOrder
, horzOrder
;
181 struct corner_list_str
189 /* Shared info between global and local router: */
190 /*---------------------------------------------------------------
191 * Defined in global_route.c
192 *---------------------------------------------------------------
194 extern asg_arc
*next_arc();
195 extern int net_using_edge();
196 extern int congestion_cost();
197 extern int decision_box
[];
198 extern tilist
*collect_tiles();
200 /*---------------------------------------------------------------
201 * Defined in local_route.c
202 *---------------------------------------------------------------
204 extern corner
*create_corner();
205 extern int in_x_order();
206 extern int divide_sranges();
207 extern int overlapped_p();