📄 primitivenode.java
字号:
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: PrimitiveNode.java * * Copyright (c) 2003 Sun Microsystems and Static Free Software * * Electric(tm) is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Electric(tm) is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Electric(tm); see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, Mass 02111-1307, USA. */package com.sun.electric.technology;import com.sun.electric.database.EObjectInputStream;import com.sun.electric.database.EObjectOutputStream;import com.sun.electric.database.geometry.DBMath;import com.sun.electric.database.geometry.Dimension2D;import com.sun.electric.database.geometry.EPoint;import com.sun.electric.database.geometry.ERectangle;import com.sun.electric.database.geometry.Poly;import com.sun.electric.database.id.PortProtoId;import com.sun.electric.database.id.PrimitiveNodeId;import com.sun.electric.database.id.PrimitivePortId;import com.sun.electric.database.prototype.NodeProto;import com.sun.electric.database.prototype.PortCharacteristic;import com.sun.electric.database.prototype.PortProto;import com.sun.electric.database.text.ArrayIterator;import com.sun.electric.database.text.Name;import com.sun.electric.database.text.Pref;import com.sun.electric.database.text.TextUtils;import com.sun.electric.technology.technologies.Generic;import com.sun.electric.technology.technologies.Schematics;import com.sun.electric.technology.xml.XmlParam;import java.io.IOException;import java.io.InvalidObjectException;import java.io.PrintWriter;import java.io.Serializable;import java.util.ArrayList;import java.util.Arrays;import java.util.HashMap;import java.util.Iterator;import java.util.List;import java.util.Map;import java.util.NoSuchElementException;/** * A PrimitiveNode represents information about a NodeProto that lives in a * Technology. It has a name, and several functions that describe how * to draw it */public class PrimitiveNode implements NodeProto, Comparable<PrimitiveNode>, Serializable{ /** * Function is a typesafe enum class that describes the function of a NodeProto. * Functions are technology-independent and include different types of transistors, * contacts, and other circuit elements. */ public static enum Function { /** Describes a node with unknown behavior. */ UNKNOWN("unknown", "node", false, false), /** Describes a single-layer pin. * Pins connects wires of a single layer, have no geometry, and connect in the center of the node. */ PIN("pin", "pin", false, false), /** Describes a two-layer contact. * Contacts connects wires of two different layers in the center of the node. */ CONTACT("contact", "contact", false, false), /** Describes a pure-layer node. * Pure-layer nodes have a solid piece of geometry on a single layer. */ NODE("pure-layer-node", "plnode", false, false), /** Describes a node that connects all ports. */ CONNECT("connection", "conn", false, false), /** Describes an nMOS transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOS("nMOS-transistor", "nmos", true, false), /** Describes a pMOS transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOS("pMOS-transistor", "pmos", true, false), /** Describes an nMOS depletion transistor (should be named TRANMOSD but isn't for historical purposes). * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRADMOS("depletion-nMOS-transistor", "nmos-d", true, false), /** Describes a pMOS depletion transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSD("depletion-pMOS-transistor", "pmos-d", true, false), /** Describes an nMOS native transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSNT("native-nMOS-transistor", "nmos-nt", true, false), /** Describes a pMOS native transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSNT("native-pMOS-transistor", "pmos-nt", true, false), /** Describes an nMOS floating gate transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSFG("floating-gate-nMOS-transistor", "nmos-fg", true, false), /** Describes a pMOS floating gate transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSFG("floating-gate-pMOS-transistor", "pmos-fg", true, false), /** Describes an nMOS low-threshold transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSVTL("low-threshold-nMOS-transistor", "nmos-vtl", true, false), /** Describes a pMOS low-threshold transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSVTL("low-threshold-pMOS-transistor", "pmos-vtl", true, false), /** Describes an nMOS high-threshold transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSVTH("high-threshold-nMOS-transistor", "nmos-vth", true, false), /** Describes a pMOS high-threshold transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSVTH("high-threshold-pMOS-transistor", "pmos-vth", true, false), /** Describes an nMOS high-voltage (1) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSHV1("high-voltage-1-nMOS-transistor", "nmos-hv1", true, false), /** Describes a pMOS high-voltage (1) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSHV1("high-voltage-1-pMOS-transistor", "pmos-hv1", true, false), /** Describes an nMOS higher-voltage (2) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSHV2("high-voltage-2-nMOS-transistor", "nmos-hv2", true, false), /** Describes a pMOS higher-voltage (2) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSHV2("high-voltage-2-pMOS-transistor", "pmos-hv2", true, false), /** Describes an nMOS highest-voltage (3) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSHV3("high-voltage-3-nMOS-transistor", "nmos-hv3", true, false), /** Describes a pMOS highest-voltage (3) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSHV3("high-voltage-3-pMOS-transistor", "pmos-hv3", true, false), /** Describes an nMOS native high-voltage (1) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSNTHV1("native-high-voltage-1-nMOS-transistor", "nmos-nt-hv1", true, false), /** Describes a pMOS native high-voltage (1) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSNTHV1("native-high-voltage-1-pMOS-transistor", "pmos-nt-hv1", true, false), /** Describes an nMOS native higher-voltage (2) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSNTHV2("native-high-voltage-2-nMOS-transistor", "nmos-nt-hv2", true, false), /** Describes a pMOS native higher-voltage (2) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSNTHV2("native-high-voltage-2-pMOS-transistor", "pmos-nt-hv2", true, false), /** Describes an nMOS native highest-voltage (3) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRANMOSNTHV3("native-high-voltage-3-nMOS-transistor", "nmos-nt-hv3", true, false), /** Describes a pMOS native highest-voltage (3) transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRAPMOSNTHV3("native-high-voltage-3-pMOS-transistor", "pmos-nt-hv3", true, false), /** Describes a NPN junction transistor. * It has base on the first port, emitter on the second port, and collector on the third port. */ TRANPN("NPN-transistor", "npn", true, false), /** Describes a PNP junction transistor. * It has base on the first port, emitter on the second port, and collector on the third port. */ TRAPNP("PNP-transistor", "pnp", true, false), /** Describes a N-channel junction transistor. * It has gate on the first port, source on the second port, and drain on the third port. */ TRANJFET("n-type-JFET-transistor", "njfet", true, false), /** Describes a P-channel junction transistor. * It has gate on the first port, source on the second port, and drain on the third port. */ TRAPJFET("p-type-JFET-transistor", "pjfet", true, false), /** Describes a MESFET depletion transistor. * It has gate on the first port, source on the second port, and drain on the third port. */ TRADMES("depletion-mesfet", "dmes", true, false), /** Describes a MESFET enhancement transistor. * It has gate on the first port, source on the second port, and drain on the third port. */ TRAEMES("enhancement-mesfet", "emes", true, false), /** Describes a general-purpose transistor. * It is defined self-referentially by the prototype name of the primitive. */ TRANSREF("prototype-defined-transistor", "tref", true, false), /** Describes an undetermined transistor. * It has gate on the first port, source on the second port, and drain on the third port. * The specific transistor type can be determined by examining the value from the NodeInst's "getTechSpecific" method. */ TRANS("transistor", "trans", true, false), /** Describes a 4-port nMOS transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4NMOS("nMOS-4-port-transistor", "nmos-4", true, false), /** Describes a 4-port pMOS transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4PMOS("pMOS-4-port-transistor", "pmos-4", true, false), /** Describes a 4-port nMOS depletion transistor (should be named TRA4NMOSD but isn't for historical purposes). * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4DMOS("depletion-nMOS-4-port-transistor", "nmos-d-4", true, false), /** Describes a 4-port pMOS depletion transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4PMOSD("depletion-pMOS-4-port-transistor", "pmos-d-4", true, false), /** Describes a 4-port nMOS native transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4NMOSNT("native-nMOS-4-port-transistor", "nmos-nt-4", true, false), /** Describes a 4-port pMOS native transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4PMOSNT("native-pMOS-4-port-transistor", "pmos-nt-4", true, false), /** Describes a 4-port nMOS floating gate transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRA4NMOSFG("floating-gate-nMOS-4-port-transistor", "nmos-fg", true, false), /** Describes a 4-port pMOS floating gate transistor. * It has gate on the first and third ports, the source on the second port, and the drain on the fourth port. */ TRA4PMOSFG("floating-gate-pMOS-4-port-transistor", "pmos-fg", true, false), /** Describes a 4-port nMOS low-threshold transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4NMOSVTL("low-threshold-nMOS-4-port-transistor", "nmos-vtl-4", true, false), /** Describes a 4-port pMOS low-threshold transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4PMOSVTL("low-threshold-pMOS-4-port-transistor", "pmos-vtl-4", true, false), /** Describes a 4-port nMOS high-threshold transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4NMOSVTH("high-threshold-nMOS-4-port-transistor", "nmos-vth-4", true, false), /** Describes a 4-port pMOS high-threshold transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4PMOSVTH("high-threshold-pMOS-4-port-transistor", "pmos-vth-4", true, false), /** Describes a 4-port nMOS high-voltage (1) transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4NMOSHV1("high-voltage-1-nMOS-4-port-transistor", "nmos-hv1-4", true, false), /** Describes a 4-port pMOS high-threshold (1) transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4PMOSHV1("high-voltage-1-pMOS-4-port-transistor", "pmos-hv1-4", true, false), /** Describes a 4-port nMOS higher-voltage (2) transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4NMOSHV2("high-voltage-2-nMOS-4-port-transistor", "nmos-hv2-4", true, false), /** Describes a 4-port pMOS higher-threshold (2) transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4PMOSHV2("high-voltage-2-pMOS-4-port-transistor", "pmos-hv2-4", true, false), /** Describes a 4-port nMOS highest-voltage (3) transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */ TRA4NMOSHV3("high-voltage-3-nMOS-4-port-transistor", "nmos-hv3-4", true, false), /** Describes a 4-port pMOS highest-threshold (3) transistor. * It has gate on the first port, source on the second port, drain on the third port, and substrate on the fourth port. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -