1 /* -*- tab-width: 4 -*-
2  *
3  * Electric(tm) VLSI Design System
4  *
5  * File: efunction.h
6  * Node, arc, and layer function table
7  * Written by: Steven M. Rubin, Static Free Software
8  *
9  * Copyright (c) 2000 Static Free Software.
10  *
11  * Electric(tm) is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * Electric(tm) is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with Electric(tm); see the file COPYING.  If not, write to
23  * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
24  * Boston, Mass 02111-1307, USA.
25  *
26  * Static Free Software
27  * 4119 Alpine Road
28  * Portola Valley, California 94028
29  * info@staticfreesoft.com
30  */
31 
32 /*
33  * when changing this table, also change:
34  * dbtech.c:db_nodefunname[]
35  * dbtech.c:nodefunction(), transistorsize(), isfet()
36  * erc:erc_analyzecell()
37  * ioedifo.c
38  * netflat.c:net_getfunction()
39  * simsilos.c:sim_silostype()
40  * simspice.c:sim_spice_nodetype()
41  * simtexsim.c:sim_writetexcell(), sim_texproto()
42  * usrctech.c:us_tran_logmakenodes(), us_tranismos()
43  * usrmenu.c:us_groupfunction()
44  * vhdl.c:vhdl_primname()
45  */
46 
47 /* the value of (NODEPROTO->userbits&NFUNCTION)>>NFUNCTIONSH (node functions) */
48 #define NPUNKNOWN           0	/* node is unknown type */
49 #define NPPIN               1	/* node is a single-layer pin */
50 #define NPCONTACT           2	/* node is a two-layer contact (one point) */
51 #define NPNODE              3	/* node is a single-layer node */
52 #define NPCONNECT           4	/* node connects all ports */
53 #define NPTRANMOS           5	/* node is MOS enhancement transistor */
54 #define NPTRADMOS           6	/* node is MOS depletion transistor */
55 #define NPTRAPMOS           7	/* node is MOS complementary transistor */
56 #define NPTRANPN            8	/* node is NPN junction transistor */
57 #define NPTRAPNP            9	/* node is PNP junction transistor */
58 #define NPTRANJFET         10	/* node is N-channel junction transistor */
59 #define NPTRAPJFET         11	/* node is P-channel junction transistor */
60 #define NPTRADMES          12	/* node is MESFET depletion transistor */
61 #define NPTRAEMES          13	/* node is MESFET enhancement transistor */
62 #define NPTRANSREF         14	/* node is prototype-defined transistor */
63 #define NPTRANS            15	/* node is undetermined transistor */
64 #define NPTRA4NMOS         16	/* node is 4-port MOS enhancement transistor */
65 #define NPTRA4DMOS         17	/* node is 4-port MOS depletion transistor */
66 #define NPTRA4PMOS         18	/* node is 4-port MOS complementary transistor */
67 #define NPTRA4NPN          19	/* node is 4-port NPN junction transistor */
68 #define NPTRA4PNP          20	/* node is 4-port PNP junction transistor */
69 #define NPTRA4NJFET        21	/* node is 4-port N-channel junction transistor */
70 #define NPTRA4PJFET        22	/* node is 4-port P-channel junction transistor */
71 #define NPTRA4DMES         23	/* node is 4-port MESFET depletion transistor */
72 #define NPTRA4EMES         24	/* node is 4-port MESFET enhancement transistor */
73 #define NPTRANS4           25	/* node is E2L transistor */
74 #define NPRESIST           26	/* node is resistor */
75 #define NPCAPAC            27	/* node is capacitor */
76 #define NPECAPAC           28	/* node is electrolytic capacitor */
77 #define NPDIODE            29	/* node is diode */
78 #define NPDIODEZ           30	/* node is zener diode */
79 #define NPINDUCT           31	/* node is inductor */
80 #define NPMETER            32	/* node is meter */
81 #define NPBASE             33	/* node is transistor base */
82 #define NPEMIT             34	/* node is transistor emitter */
83 #define NPCOLLECT          35	/* node is transistor collector */
84 #define NPBUFFER           36	/* node is buffer */
85 #define NPGATEAND          37	/* node is AND gate */
86 #define NPGATEOR           38	/* node is OR gate */
87 #define NPGATEXOR          39	/* node is XOR gate */
88 #define NPFLIPFLOP         40	/* node is flip-flop */
89 #define NPMUX              41	/* node is multiplexor */
90 #define NPCONPOWER         42	/* node is connected to power */
91 #define NPCONGROUND        43	/* node is connected to ground */
92 #define NPSOURCE           44	/* node is source */
93 #define NPSUBSTRATE        45	/* node is connected to substrate */
94 #define NPWELL             46	/* node is connected to well */
95 #define NPART              47	/* node is pure artwork */
96 #define NPARRAY            48	/* node is an array */
97 #define NPALIGN            49	/* node is an alignment object */
98 #define NPCCVS             50	/* node is a current-controlled voltage source */
99 #define NPCCCS             51	/* node is a current-controlled current source */
100 #define NPVCVS             52	/* node is a voltage-controlled voltage source */
101 #define NPVCCS             53	/* node is a voltage-controlled current source */
102 #define NPTLINE            54	/* node is a transmission line */
103 
104 #define MAXNODEFUNCTION    55	/* the number of functions above */
105 
106 /*
107  * when changing this table, also change:
108  * dbtech.c:     arcfunctionname()
109  * iolout.c:     io_lports[] and io_lcontacts[]
110  * ercantenna.c: erc_antcheckcell()
111  * sc1electric:  Sc_setup_for_maker()
112  * simsim.c:     sim_prop()
113  * simspice.c:   sim_spice_arcisdiff()
114  * usredtecc.c:  us_tecarc_functions[]
115  */
116 
117 /* the value of (ARCPROTO->userbits&AFUNCTION)>>AFUNCTIONSH (arc functions) */
118 #define APUNKNOWN           0	/* arc is unknown type */
119 #define APMETAL1            1	/* arc is metal, layer 1 */
120 #define APMETAL2            2	/* arc is metal, layer 2 */
121 #define APMETAL3            3	/* arc is metal, layer 3 */
122 #define APMETAL4            4	/* arc is metal, layer 4 */
123 #define APMETAL5            5	/* arc is metal, layer 5 */
124 #define APMETAL6            6	/* arc is metal, layer 6 */
125 #define APMETAL7            7	/* arc is metal, layer 7 */
126 #define APMETAL8            8	/* arc is metal, layer 8 */
127 #define APMETAL9            9	/* arc is metal, layer 9 */
128 #define APMETAL10          10	/* arc is metal, layer 10 */
129 #define APMETAL11          11	/* arc is metal, layer 11 */
130 #define APMETAL12          12	/* arc is metal, layer 12 */
131 #define APPOLY1            13	/* arc is polysilicon, layer 1 */
132 #define APPOLY2            14	/* arc is polysilicon, layer 2 */
133 #define APPOLY3            15	/* arc is polysilicon, layer 3 */
134 #define APDIFF             16	/* arc is diffusion */
135 #define APDIFFP            17	/* arc is P-type diffusion */
136 #define APDIFFN            18	/* arc is N-type diffusion */
137 #define APDIFFS            19	/* arc is substrate diffusion */
138 #define APDIFFW            20	/* arc is well diffusion */
139 #define APBUS              21	/* arc is multi-wire bus */
140 #define APUNROUTED         22	/* arc is unrouted specification */
141 #define APNONELEC          23	/* arc is nonelectrical */
142 
143 /*
144  * when changing this table, also change:
145  * dbtech.c:         layerismetal(), layerispoly(), layeriscontact(), layerfunctionheight()
146  * ercantenna.c:     erc_antcheckcell()
147  * iodefi.c:         io_defgetlayernodes()
148  * iolefi.c:         io_lefparselayer()
149  * iolefo.c:         io_lefoutlayername()
150  * iopsoutcolor.cpp: io_pscolor_getLayerMap()
151  * simspice.c:       sim_spice_layerisdiff()
152  * usredtecc.c:      us_teclayer_functions[]
153  * usrcom1.c:        technologyclfopt[]
154  */
155 
156 /* the value of TECHNOLOGY->TECH_layer_function (layer functions) */
157 #define LFNUMLAYERS       044	/* number of layers below */
158 #define LFUNKNOWN           0	/* unknown layer */
159 #define LFMETAL1           01	/* metal layer 1 */
160 #define LFMETAL2           02	/* metal layer 2 */
161 #define LFMETAL3           03	/* metal layer 3 */
162 #define LFMETAL4           04	/* metal layer 4 */
163 #define LFMETAL5           05	/* metal layer 5 */
164 #define LFMETAL6           06	/* metal layer 6 */
165 #define LFMETAL7           07	/* metal layer 7 */
166 #define LFMETAL8          010	/* metal layer 8 */
167 #define LFMETAL9          011	/* metal layer 9 */
168 #define LFMETAL10         012	/* metal layer 10 */
169 #define LFMETAL11         013	/* metal layer 11 */
170 #define LFMETAL12         014	/* metal layer 12 */
171 #define LFPOLY1           015	/* polysilicon layer 1 */
172 #define LFPOLY2           016	/* polysilicon layer 2 */
173 #define LFPOLY3           017	/* polysilicon layer 3 */
174 #define LFGATE            020	/* polysilicon gate layer */
175 #define LFDIFF            021	/* diffusion layer */
176 #define LFIMPLANT         022	/* implant layer */
177 #define LFCONTACT1        023	/* contact layer 1 */
178 #define LFCONTACT2        024	/* contact layer 2 */
179 #define LFCONTACT3        025	/* contact layer 3 */
180 #define LFCONTACT4        026	/* contact layer 4 */
181 #define LFCONTACT5        027	/* contact layer 5 */
182 #define LFCONTACT6        030	/* contact layer 6 */
183 #define LFCONTACT7        031	/* contact layer 7 */
184 #define LFCONTACT8        032	/* contact layer 8 */
185 #define LFCONTACT9        033	/* contact layer 9 */
186 #define LFCONTACT10       034	/* contact layer 10 */
187 #define LFCONTACT11       035	/* contact layer 11 */
188 #define LFCONTACT12       036	/* contact layer 12 */
189 #define LFPLUG            037	/* sinker (diffusion-to-buried plug) */
190 #define LFOVERGLASS       040	/* overglass layer */
191 #define LFRESISTOR        041	/* resistor layer */
192 #define LFCAP             042	/* capacitor layer */
193 #define LFTRANSISTOR      043	/* transistor layer */
194 #define LFEMITTER         044	/* emitter layer */
195 #define LFBASE            045	/* base layer */
196 #define LFCOLLECTOR       046	/* collector layer */
197 #define LFSUBSTRATE       047	/* substrate layer */
198 #define LFWELL            050	/* well layer */
199 #define LFGUARD           051	/* guard layer */
200 #define LFISOLATION       052	/* isolation layer */
201 #define LFBUS             053	/* bus layer */
202 #define LFART             054	/* artwork layer */
203 #define LFCONTROL         055	/* control layer */
204 
205 #define LFTYPE            077	/* all above layers */
206 #define LFPTYPE          0100	/* layer is P-type */
207 #define LFNTYPE          0200	/* layer is N-type */
208 #define LFDEPLETION      0400	/* layer is depletion */
209 #define LFENHANCEMENT   01000	/* layer is enhancement */
210 #define LFLIGHT         02000	/* layer is light doped */
211 #define LFHEAVY         04000	/* layer is heavy doped */
212 #define LFPSEUDO       010000	/* layer is pseudo */
213 #define LFNONELEC      020000	/* layer is nonelectrical */
214 #define LFCONMETAL     040000	/* layer contacts metal */
215 #define LFCONPOLY     0100000	/* layer contacts polysilicon */
216 #define LFCONDIFF     0200000	/* layer contacts diffusion */
217 #define LFTRANS1      0400000	/* layer is transparent number 1 */
218 #define LFTRANS2     01000000	/* layer is transparent number 2 */
219 #define LFTRANS3     02000000	/* layer is transparent number 3 */
220 #define LFTRANS4     04000000	/* layer is transparent number 4 */
221 #define LFTRANS5    010000000	/* layer is transparent number 5 */
222 #define LFINTRANS   020000000	/* layer inside transistor */
223