1 /*
2  * netlist.h --
3  *
4  * This file defines the structures that represent netlists.
5  *
6  *     *********************************************************************
7  *     * Copyright (C) 1985, 1990 Regents of the University of California. *
8  *     * Permission to use, copy, modify, and distribute this              *
9  *     * software and its documentation for any purpose and without        *
10  *     * fee is hereby granted, provided that the above copyright          *
11  *     * notice appear in all copies.  The University of California        *
12  *     * makes no representations about the suitability of this            *
13  *     * software for any purpose.  It is provided "as is" without         *
14  *     * express or implied warranty.  Export of this software outside     *
15  *     * of the United States of America may require an export license.    *
16  *     *********************************************************************
17  *
18  *
19  * RCSID $Header: /usr/cvsroot/magic-8.0/utils/netlist.h,v 1.1.1.1 2008/02/03 20:43:50 tim Exp $
20  */
21 
22 #ifndef _RMNETLIST_H
23 #define _RMNETLIST_H
24 
25 #include "utils/geometry.h"
26 #include "utils/magic.h"
27 #include "database/database.h"
28 
29 /* --------------------------- Netlists ------------------------------- */
30 
31 /*
32  * Nets and terminals.
33  * The current netlist is read into these structures so
34  * it can be worked with more conveniently and so its
35  * components can be given unique names.
36  */
37 typedef struct nlTermLoc
38 {
39 	/* Set prior to stem assignment */
40     struct nlTermLoc	*nloc_next;	/* Next location in list */
41     struct nlTerm	*nloc_term;	/* Back pointer to term */
42     Rect		 nloc_rect;	/* Location of terminal itself */
43     Label		*nloc_label;	/* Points to original label */
44 
45 	/* Set during stem assignment */
46     Point		 nloc_stem;	/* Point on channel boundary */
47     int			 nloc_dir;	/* Direction from label to nloc_stem */
48     struct chan		*nloc_chan;	/* Contains nloc_stem */
49     struct pin		*nloc_pin;	/* Pin on nloc_chan boundary */
50 
51     struct region	*nloc_region;	/* Region containing stem */
52     struct czone	*nloc_czone;	/* Range containing point */
53     int			 nloc_stemcost;	/* Cost of stem	*/
54     int			 nloc_flags;	/* Flags */
55 } NLTermLoc;
56 
57 #define	NLOC_TERM	001		/* Location used in steiner in net	*/
58 
59     /*
60      * Each NLTerm corresponds to a name, but that name may
61      * have several locations if the label appears in several
62      * places inside a cell.  It points back to the net to
63      * to which it belongs.  The name nterm_name points to
64      * the key in the glnl_names hash table, so it shouldn't
65      * be freed explicitly.
66      */
67 typedef struct nlTerm
68 {
69     struct nlTerm	*nterm_next;	/* Next terminal in net */
70     char		*nterm_name;	/* Name of this terminal */
71     struct nlTermLoc	*nterm_locs;	/* List of equivalent locations */
72     struct nlNet	*nterm_net;	/* Back pointer to net */
73     int			 nterm_flags;	/* See below */
74 } NLTerm;
75 
76     /* Flags for above */
77 #define	RTERM_ISDRIVER	0x0001		/* Term is a transmission line driver */
78 
79     /*
80      * Each NLNet consists of several terminals; in order to be
81      * of interest to the router, it must contain at least two.
82      */
83 typedef struct nlNet
84 {
85     struct nlNet	*nnet_next;	/* Next net in netlist */
86     struct nlTerm	*nnet_terms;	/* List of terminals */
87     Rect		 nnet_area;	/* Bounding box for net's terms */
88     ClientData		 nnet_cdata;	/* For hire */
89 
90     /********************************************************************
91     New Info for Area  Router
92     *********************************************************************/
93     int			nnet_cost;	/* Cost of steiner tree		*/
94     int			nnet_complexity;/* Complexity of steiner tree	*/
95     struct	segment	*nnet_segm;	/* List of steiner segments	*/
96     struct	via	*nnet_vias;	/* List of vias			*/
97     struct	nlNet	*nnet_stack;	/* Queue of nets		*/
98     struct	czlist	*nnet_czlist;	/* Czone list			*/
99     int			nnet_attempts;	/* Iteration count		*/
100     int			nnet_state;	/* Routing stats		*/
101     int			nnet_flags;	/* Flags			*/
102     struct	svi	*nnet_svi;	/* Maze route/sever info	*/
103 } NLNet;
104 
105 #define	NT_ROUTED	001		/* Net successfully routed	*/
106 #define	NT_FAILED	002		/* Net unsuccessfully routed	*/
107 #define	NT_SEVERED	004		/* Net has been severed		*/
108 
109     /*
110      * A NLNetList contains a list of nets, along with the
111      * table that maps from signal names to terminals.
112      */
113 typedef struct
114 {
115     struct nlNet	*nnl_nets;	/* List of nets */
116     int			 nnl_numNets;	/* # of nets in list (redundant, since
117 					 * the list is NULL-terminated, but it
118 					 * is convenient).
119 					 */
120     HashTable		 nnl_names;	/* Maps names to NLTerms */
121 } NLNetList;
122 
123 /* Exports */
124 extern char *NLNetName();
125 
126 #endif /* _RMNETLIST_H */
127