📄 generic.java
字号:
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: Generic.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.technologies;import com.sun.electric.database.geometry.EGraphics;import com.sun.electric.database.geometry.Poly;import com.sun.electric.database.id.IdManager;import com.sun.electric.database.prototype.PortCharacteristic;import com.sun.electric.database.prototype.NodeProto;import com.sun.electric.database.topology.NodeInst;import com.sun.electric.technology.ArcProto;import com.sun.electric.technology.EdgeH;import com.sun.electric.technology.EdgeV;import com.sun.electric.technology.Foundry;import com.sun.electric.technology.Layer;import com.sun.electric.technology.PrimitiveNode;import com.sun.electric.technology.PrimitivePort;import com.sun.electric.technology.SizeOffset;import com.sun.electric.technology.Technology;import java.awt.Color;/** * This is the Generic technology. */public class Generic extends Technology{ /** the Generic Technology object. */ public static Generic tech() { return sysGeneric; } /** the Universal Layer. */ private final Layer universalLay; /** the Glyph Layer. */ public final Layer glyphLay; /** the DRC exclusion Layer. */ public final Layer drcLay; /** the AFG exclusion Layer. */ public final Layer afgLay; /** the Universal Pin node, which connects to every type of arc. */ public final PrimitiveNode universalPinNode; /** the Invisible Pin node, which connects to every type of arc and produces no layout. */ public final PrimitiveNode invisiblePinNode; /** the Unrouted Pin node, for making bends in unrouted arc paths. */ public final PrimitiveNode unroutedPinNode; /** the Cell-Center node, used for defining the origin of the cell's coordinate space. */ public final PrimitiveNode cellCenterNode; /** the Port-definition node, used in technology editing to define node ports. */ public final PrimitiveNode portNode; /** the DRC exclusion node, all design-rule errors covered by this node are ignored. */ public final PrimitiveNode drcNode; /** the AFG exclusion node, tells auto-fill generator to ignore the area. */ public final PrimitiveNode afgNode; /** the Essential-bounds node, used (in pairs) to define the important area of a cell. */ public final PrimitiveNode essentialBoundsNode; /** the Simulation-Probe node, used for highlighting the state of a network. */ public final PrimitiveNode simProbeNode; /** the Universal arc, connects to any node. */ public final ArcProto universal_arc; /** the Invisible arc, connects to any node and produces no layout. */ public final ArcProto invisible_arc; /** the Unrouted arc, connects to any node and specifies desired routing topology. */ public final ArcProto unrouted_arc; private final PrimitivePort univPinPort, invisPinPort, simProbePort; // -------------------- private and protected methods ------------------------ public Generic(IdManager idManager) { super(idManager, null, "generic", Foundry.Type.NONE, 0); setTechShortName("Generic"); setTechDesc("Useful primitives"); setNonStandard(); setFactoryScale(1000, false); // in nanometers: really 1 micron //**************************************** LAYERS **************************************** /** Universal layer */ universalLay = Layer.newInstance(this, "Universal", new EGraphics(false, false, null, 0, 0,0,0,1.0,true, new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); /** Invisible layer */ Layer invisible_lay = Layer.newInstance(this, "Invisible", new EGraphics(false, false, null, 0, 180,180,180,1.0,true, new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); /** Unrouted layer */ Layer unrouted_lay = Layer.newInstance(this, "Unrouted", new EGraphics(false, false, null, 0, 100,100,100,1.0,true, new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); /** Glyph layer */ glyphLay = Layer.newInstance(this, "Glyph", new EGraphics(false, false, null, 0, 0,0,0,1.0,true, new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); /** DRC layer */ drcLay = Layer.newInstance(this, "DRC", new EGraphics(false, false, null, 0, 255,190,6,1.0,true, new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); /** AFG layer */ afgLay = Layer.newInstance(this, "AFG", new EGraphics(false, false, null, 0, 255,6,190,1.0,true, new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); /** Simulation Probe layer */ Layer simprobe_lay = Layer.newInstance(this, "Sim-Probe", new EGraphics(false, false, null, 0, 0,255,0,1.0,true, new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); // The layer functions universalLay.setFunction(Layer.Function.UNKNOWN); // Universal invisible_lay.setFunction(Layer.Function.UNKNOWN, Layer.Function.NONELEC); // Invisible unrouted_lay.setFunction(Layer.Function.UNKNOWN); // Unrouted glyphLay.setFunction(Layer.Function.ART, Layer.Function.NONELEC); // Glyph drcLay.setFunction(Layer.Function.ART, Layer.Function.NONELEC); // DRC afgLay.setFunction(Layer.Function.ART, Layer.Function.NONELEC); // AFG simprobe_lay.setFunction(Layer.Function.ART, Layer.Function.NONELEC); // Sim probe //**************************************** ARCS **************************************** /** Universal arc */ universal_arc = newArcProto("Universal", 0, 0.0, ArcProto.Function.UNKNOWN, new Technology.ArcLayer(universalLay, 0, Poly.Type.FILLED) ); universal_arc.setFactoryFixedAngle(true); universal_arc.setFactoryAngleIncrement(45); /** Invisible arc */ invisible_arc = newArcProto("Invisible", 0, 0.0, ArcProto.Function.NONELEC, new Technology.ArcLayer(invisible_lay, 0, Poly.Type.FILLED) ); invisible_arc.setFactoryFixedAngle(true); invisible_arc.setFactoryAngleIncrement(45); /** Unrouted arc */ unrouted_arc = newArcProto("Unrouted", 0, 0.0, ArcProto.Function.UNROUTED, new Technology.ArcLayer(unrouted_lay, 0, Poly.Type.FILLED) ); unrouted_arc.setFactoryFixedAngle(false); unrouted_arc.setFactoryAngleIncrement(0); //**************************************** NODES **************************************** /** Universal pin */ universalPinNode = PrimitiveNode.newInstance("Universal-Pin", this, 1.0, 1.0, null, new Technology.NodeLayer [] { new Technology.NodeLayer(universalLay, 0, Poly.Type.DISC, Technology.NodeLayer.POINTS, new Technology.TechPoint [] { new Technology.TechPoint(EdgeH.makeCenter(), EdgeV.makeCenter()), new Technology.TechPoint(EdgeH.makeRightEdge(), EdgeV.makeCenter())}) }); univPinPort = PrimitivePort.newInstance(this, universalPinNode, new ArcProto[] {universal_arc}, "univ", 0,180, 0, PortCharacteristic.UNKNOWN, EdgeH.makeLeftEdge(), EdgeV.makeBottomEdge(), EdgeH.makeRightEdge(), EdgeV.makeTopEdge()); universalPinNode.addPrimitivePorts(new PrimitivePort [] {univPinPort}); universalPinNode.setFunction(PrimitiveNode.Function.PIN); universalPinNode.setWipeOn1or2();// universalPinNode.setHoldsOutline(); universalPinNode.setCanBeZeroSize(); /** Invisible pin */ invisiblePinNode = PrimitiveNode.newInstance0("Invisible-Pin", this, 1.0, 1.0, new Technology.NodeLayer [] { new Technology.NodeLayer(invisible_lay, 0, Poly.Type.CLOSED, Technology.NodeLayer.BOX, Technology.TechPoint.makeFullBox()) }); invisPinPort = PrimitivePort.newInstance(this, invisiblePinNode, new ArcProto[] {invisible_arc,universal_arc}, "center", 0,180, 0, PortCharacteristic.UNKNOWN, EdgeH.makeCenter(), EdgeV.makeCenter(), EdgeH.makeCenter(), EdgeV.makeCenter()); invisiblePinNode.addPrimitivePorts(new PrimitivePort [] {invisPinPort}); invisiblePinNode.setFunction(PrimitiveNode.Function.PIN); invisiblePinNode.setWipeOn1or2(); invisiblePinNode.setCanBeZeroSize(); /** Unrouted pin */ unroutedPinNode = PrimitiveNode.newInstance("Unrouted-Pin", this, 1.0, 1.0, null, new Technology.NodeLayer [] { new Technology.NodeLayer(unrouted_lay, 0, Poly.Type.DISC, Technology.NodeLayer.POINTS, new Technology.TechPoint [] { new Technology.TechPoint(EdgeH.makeCenter(), EdgeV.makeCenter()), new Technology.TechPoint(EdgeH.makeRightEdge(), EdgeV.makeCenter())}) }); unroutedPinNode.addPrimitivePorts(new PrimitivePort [] { PrimitivePort.newInstance(this, unroutedPinNode, new ArcProto[] {unrouted_arc,invisible_arc,universal_arc}, "unrouted", 0,180, 0, PortCharacteristic.UNKNOWN, EdgeH.makeCenter(), EdgeV.makeCenter(), EdgeH.makeCenter(), EdgeV.makeCenter()) }); unroutedPinNode.setFunction(PrimitiveNode.Function.PIN); unroutedPinNode.setWipeOn1or2(); unroutedPinNode.setCanBeZeroSize(); /** Cell Center */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -