11 * Definition of the Design
12 * M is the set of all modules
13 * N is the set of all nets
14 * ST the set of system terminals
15 * T the set of sub-system terminals
16 * terms(module) : returns the subset of T for that module
17 * type(terminal(tUst)): returns its type (in, out, inout)
18 * postion-terminal(terminal(t)) : returns its (x,y) position
19 * net(terminal(tUst)) : returns the Net for this terminal
20 * size(module) : returns its x,y size
21 * side(terminal(t)) : returns (left, right, up, down)
26 (((x) == FALSE) ? "FALSE" : "TRUE")
28 /* only extract_tree in place.c uses these two: */
34 /* used in most files, but also defined in net.h */
36 #define MAX(a,b) (((a)>(b))?(a):(b))
37 #define MIN(a,b) (((a)<(b))?(a):(b))
40 /* I think the only hack that counts on these values is in
41 * utility.c rot_side(). Everyone else cases them out.
44 /* mod->flag values, used in placement */
50 /* the type of connection matrix built may be */
56 /* sides of module, clockwise order */
63 (((x) == LEFT) ? "LEFT":\
64 ((x) == RIGHT) ? "RIGHT":\
65 ((x) == UP) ? "UP" : "DOWN")
67 /* clockwise rotation amounts */
74 (((x) == ZERO) ? "ZERO":\
75 ((x) == NINETY) ? "NINETY":\
76 ((x) == ONE_EIGHTY) ? "ONE_EIGHTY" : "TWO_SEVENTY")
79 #define NONE 0 /* used with those below for system net types */
81 /* directions of terminals */
82 #define IN 1 /* Left side of icon */
83 #define OUT 2 /* Right side of icon */
84 #define INOUT 3 /* Bottom of icon */
85 #define OUTIN 7 /* Top of icon */
92 ((x) == OUT) ? "OUT":\
93 ((x) == INOUT) ? "INOUT" :\
94 ((x) == OUTIN) ? "OUTIN" :"NONE")
96 #define ICON_SIZE 8 /* default object icon sizes are 8 x 8 for sced */
97 #define TERM_NAME_SIZE 32 /* size of strings for terminal names */
98 #define GATE_NAME_SIZE 10 /* Aesthetic limit on icon name sizes */
99 #define NET_NAME_SIZE 14 /* limit on net name sizes (fits _DUMMY_SIGNAL_) */
101 #define XCANVAS_SCALE_FACTOR 6 /* Used to scale XCanvas bitmaps (see -b flag) */
103 #define MAX_MOD 256 /* maximum number of modules */
105 #define CHANNEL_HEIGHT 48
106 #define CHANNEL_LENGTH 48
107 #define MAX_DEPTH 12 /* maximum length of module box string */
108 #define WHITE_SPACE 36 /* multiplier * # terms on a side for routing space */
109 #define CC_SPACE 48 /* min routing space between cross-coupled modules*/
112 * Rents rule: SIZE = A |Connections| ** B with .5 < A < 5 and .4 < B < .8
113 * I have no idea for good values.
114 * Try A = 1 B = .5 and Size =5 Conn = 25 (note values below are -1)
117 /* these are now just the default maxes, see the command line */
118 #define MAX_PARTITION_SIZE 4 /* 4 should we follow rent's rule? */
119 #define MAX_PARTITION_CONN 24 /* 24 connections from inside to outside */
120 #define DEF_PARTITION_RULE 3 /* enable the -c and -s flags for partitioning */
121 #define DEF_PARTITION_RATIO 3.0 /* sets the ratio used by rule number 2 */
122 #define CC_SEARCH_LEVEL 2 /* only look for modules that are cross
123 coupled to two levels of removal */
124 #define DEF_TURN_MODE 0 /* .5 Turns */
128 /* offsets around things for routing */
130 #define OUTSIDE_BORDER 100
132 /* default sizes for the virtual space tiles used for each partition: */
133 #define TILE_SPACE_X_LEN 15000
134 #define TILE_SPACE_Y_LEN 15000
135 #define TILE_SPACE_X_POS -5000
136 #define TILE_SPACE_Y_POS -5000
139 /* types of obstacles */
146 (((x) == ACTIVE_A) ? "ACTIVE_A" :\
147 ((x) == ACTIVE_B) ? "ACTIVE_B" :\
148 ((x) == MODULE) ? "MODULE" : "NET")
155 (((x) == HORZ) ? "HORZ" : "VERT")
157 /* for init_actives */
158 /* signed sixteen bit max value */
160 /* perhaps 0x7FFFFFFF (32 bit max value) would be better ?*/
163 /* for end segment types */
169 (((x) == LEFT_C) ? "LEFT_C" :\
170 ((x) == RIGHT_C) ? "RIGHT_C" : "SEG")
172 /*- begin psfigs support ------------------------------------------------------*/
173 #define XNOR_GATE "XNOR" /* Used to identify the Type of the module */
174 #define BUFFER_GATE "BUFFER"
175 #define INPUT_TERM "IN"
176 #define OUTPUT_TERM "OUT"
177 #define INOUT_TERM "INOUT"
178 #define OUTIN_TERM "OUTIN"
179 #define GENERIC_BLOCK "BLOCK"
181 /* The following icons are directly supported:
182 (See "validate" in "psfigs.c") */
192 #define OUTPUT_SYM 10
199 #define CONTACT_WIDTH .350
201 #define ICON_HEIGHT 6
202 #define CIRCLE_SIZE .75
203 #define ANDARC_RAD 3.0625
204 #define ANDARC_THETA 69.09
205 #define ANDARC_CENTER_X_OFFSET 3.854 - 4.0
207 #define ORARC_RAD 3.75
208 #define ORARC_THETA 53.13
209 #define ORARC_CENTER_X_OFFSET 2.75 - 8.0
211 #define XOR_OFFSET .5
213 #define BUFFER_SIZE 6.0
214 #define GATE_LENGTH 8
215 #define GATE_HEIGHT 6
216 #define SYSTERM_SIZE 6
217 #define BLOCK_SPACES_PER_PIN 3
218 #define SPACES_PER_PIN 2
220 /*- end psfigs support ------------------------------------------------------*/
223 typedef struct info_struct
225 int in
, out
, used
, order
;
229 /*---------------------------------------------------------------
230 * Templates for major linked list data structures.
231 * We use a general paradigm of a linked list of "things"
232 * the list has a "this" field and a "next" field
233 * the "this" field is coerced into a pointer to a type "thing"
234 * the "next" field is coerced into a pointer to a list of "things"
235 * We then use generic list routines (in utility.c) to manipulate
237 *---------------------------------------------------------------
240 typedef struct term_struct term
; /* the terminals */
241 typedef struct mod_struct module
; /* the modules */
242 typedef struct net_struct net
; /* the nets */
243 typedef struct obst_struct obst
; /* the obstacles */
244 typedef struct act_struct act
; /* the active segments */
245 typedef struct end_struct end
; /* the endpoints of segments */
246 typedef struct rng_struct rng
; /* the ranges of segments */
247 typedef struct clu_struct cluster
; /* the clusters of modules */
249 /* typedef struct list_struct list; Moved to 'list.h' */
250 typedef struct tnode_struct tnode
; /* for binary trees */
251 typedef struct term_list tlist
;
252 typedef struct mod_list mlist
;
253 typedef struct net_list nlist
;
254 typedef struct obst_list olist
;
255 typedef struct act_list alist
;
256 typedef struct end_list elist
;
257 typedef struct rng_list rlist
;
258 typedef struct cl_list clist
;
259 typedef struct cluster_tree ctree
;
261 typedef struct link_list llist
; /* for 2d linked lists */
262 /* typedef struct indexed_list ilist; Moved to 'list.h' */
266 /* terminals are where nets attach to modules */
269 int x_pos
; /* we will eventually have to look this up */
272 int side
; /* side of the module on which it apears */
273 int type
; /* direction in, out, inout, outin for this module */
274 net
*nt
; /* the net that this terminal belongs to */
278 /* modules are the "gates" both simple and complex, rectangles are assumed */
280 int index
; /* unique number */
281 char *name
; /* unique instance name */
282 char *type
; /* gate types will be our key for icons */
283 int dly_type
; /* inertial or transport -- for simulation */
284 int delay
; /* the delay time -- for simulation */
285 int x_pos
; /* we will determine this in "place" */
286 int y_pos
; /* we will determine this in "place" */
287 int x_size
; /* we will have to look this up */
288 int y_size
; /* we will have to look this up */
289 int flag
; /* flag for recursive marking */
290 int placed
; /* marks that the critter has been placed within a partition */
291 int rot
; /* rotation */
292 tile
*htile
; /* Tile in the horizontal routing space to which this module is assigned */
293 tile
*vtile
; /* Tile in the vertical routing space to which this module is assigned */
294 term
*primary_in
; /* the primary input terminal */
295 term
*primary_out
; /* the primary output terminal */
296 tlist
*terms
; /* the terminals on this module */
297 var
*fx
, *fy
; /* Fuzzy X and Fuzzy Y positions for this module */
302 /* clusters are collections of gates */
304 int index
; /* unique number */
305 int size
; /* number of elements in branch */
306 int connects
; /* number of connections external to the cluster */
307 module
*contents
; /* the module within this cluster (leaf nodes) */
311 /* a net is a list of terminals, one electrical node */
315 int type
; /* identify system terminal nets */
316 int rflag
; /* Routing status flag */
317 list
*expns
; /* Used in both local & global routing; */
318 list
*done
; /* Records expansions that are completed */
319 list
*route
; /* used in local routing */
323 /* an obstacle is a 5-tuple representing a line segment */
325 int i
; /* index along the coordinate axis (vert or horz) */
326 int x
; /* lower index in the other direction */
327 int y
; /* upper index */
328 int type
; /* one of MODULE, NET, ACTIVE_A or ACTIVE_B */
329 char *name
; /* only used if it is a net */
333 /* an active segment is a 10-tuple */
335 int b
; /* wave number, number of bends in the path */
336 int c
; /* number of crossed nets */
337 act
* prev
; /* pointer to previous/origninator of segment */
338 int i
; /* description of this segment: index */
339 int x
; /* "" : lower index in other direction */
340 int y
; /* "" : upper index */
341 int d
; /* one of LEFT RIGHT UP DOWN */
342 int type
; /* one of MODULE, NET, ACTIVE_A or ACTIVE_B */
343 int expanded
; /* one of TRUE, FALSE */
347 /* an end segment is a 4-tuple */
349 int i
; /* description of this segment: index */
350 int x
; /* "" : lower index in the other direction */
351 int y
; /* "" : upper index */
352 int type
; /* one of LEFT_C RIGHT_C SEG */
356 /* a range of a segment is a 3-tuple */
358 int x
; /* "" : lower index in the other direction */
359 int y
; /* "" : upper index */
360 int c
; /* number of crossed wires */
363 /*-----------------------------------------------------*/
365 /* these are coerced to be binary trees of the sort below */
378 /*-----------------------------------------------------*/
393 /* Used to maintain clusters as they are built into and taken from a tree. */
436 /* this is different for 2 - d lists */
438 int index
; /* index */
439 list
*values
; /* list */
440 llist
*next
; /* next link */
443 /*---------------------------------------------------------------
445 *---------------------------------------------------------------