📄 technology.java
字号:
descriptor = TextDescriptor.EMPTY; this.lWidth = this.rWidth = this.extentT = this.extendB = 0; } /** * Constructs a <CODE>NodeLayer</CODE> with the specified description. * This form of the method, with 4 additional parameters at the end, * is only used for serpentine transistors. * @param layer the <CODE>Layer</CODE> this is on. * @param portNum a 0-based index of the port (from the actual NodeInst) on this layer. * A negative value indicates that this layer is not connected to an electrical layer. * @param style the Poly.Type this NodeLayer will generate (polygon, circle, text, etc.). * @param representation tells how to interpret "points". It can be POINTS, BOX, or MULTICUTBIX. * @param points the list of coordinates (stored as TechPoints) associated with this NodeLayer. * @param lWidth the left extension of this layer, measured from the <I>centerline</I>. * The centerline is the path that the serpentine transistor follows (it defines the path of the * polysilicon). So, for example, if lWidth is 4 and rWidth is 4, it creates a NodeLayer that is 8 wide * (with 4 to the left and 4 to the right of the centerline). * Left and Right widths define the size of the Active layers. * @param rWidth the right extension the right of this layer, measured from the <I>centerline</I>. * @param extentT the top extension of this layer, measured from the end of the <I>centerline</I>. * The top and bottom extensions apply to the ends of the centerline, and not to each segment * along it. They define the extension of the polysilicon. For example, if extendT is 2, * it indicates that the NodeLayer extends by 2 from the top end of the centerline. * @param extendB the bottom extension of this layer, measured from the end of the <I>centerline</I>. */ public NodeLayer(Layer layer, int portNum, Poly.Type style, int representation, TechPoint [] points, double lWidth, double rWidth, double extentT, double extendB) { this.layer = layer; this.portNum = portNum; this.style = style; this.representation = representation; this.points = points; descriptor = TextDescriptor.EMPTY; this.lWidth = lWidth; this.rWidth = rWidth; this.extentT = extentT; this.extendB = extendB; } /** * Constructs a <CODE>NodeLayer</CODE> from given node * @param node */ public NodeLayer(NodeLayer node) { this.layer = node.getLayerOrPseudoLayer(); this.portNum = node.getPortNum(); this.style = node.getStyle(); this.representation = node.getRepresentation(); this.descriptor = TextDescriptor.EMPTY; TechPoint [] oldPoints = node.getPoints(); this.points = new TechPoint[oldPoints.length]; for(int i=0; i<oldPoints.length; i++) points[i] = oldPoints[i].duplicate(); this.lWidth = this.rWidth = this.extentT = this.extendB = 0; } public static NodeLayer makeMulticut(Layer layer, int portNum, Poly.Type style, TechPoint[] techPoints, String sizeRule, String cutSep1DRule, String cutSep2DRule) { NodeLayer nl = new NodeLayer(layer, portNum, style, Technology.NodeLayer.MULTICUTBOX, techPoints); nl.sizeRule = sizeRule; nl.cutSep1DRule = cutSep1DRule; nl.cutSep2DRule = cutSep2DRule; return nl; } public static NodeLayer makeMulticut(Layer layer, int portNum, Poly.Type style, TechPoint[] techPoints, double sizeX, double sizeY, double sep1d, double sep2d) { NodeLayer nl = new NodeLayer(layer, portNum, style, Technology.NodeLayer.MULTICUTBOX, techPoints); nl.cutGridSizeX = DBMath.lambdaToGrid(sizeX); nl.cutGridSizeY = DBMath.lambdaToGrid(sizeY); nl.cutGridSep1D = DBMath.lambdaToGrid(sep1d); nl.cutGridSep2D = DBMath.lambdaToGrid(sep2d); return nl; } /** * Returns the <CODE>Layer</CODE> object associated with this NodeLayer. * @return the <CODE>Layer</CODE> object associated with this NodeLayer. */ public Layer getLayer() { return layer.getNonPseudoLayer(); } /** * Tells whether this NodeLayer is associated with pseudo-layer. * @return true if this NodeLayer is associated with pseudo-layer. */ public boolean isPseudoLayer() { return layer.isPseudoLayer(); } /** * Returns the <CODE>Layer</CODE> or pseudo-layer object associated with this NodeLayer. * @return the <CODE>Layer</CODE> or pseudo-layer object associated with this NodeLayer. */ public Layer getLayerOrPseudoLayer() { return layer; } /** * Returns the 0-based index of the port associated with this NodeLayer. * @return the 0-based index of the port associated with this NodeLayer. */ public int getPortNum() { return portNum; } /** * Returns the Poly.Type this NodeLayer will generate. * @return the Poly.Type this NodeLayer will generate. * Examples are polygon, lines, splines, circle, text, etc. */ public Poly.Type getStyle() { return style; } /** * Returns the method of interpreting "points". * @return the method of interpreting "points". * It can be POINTS, BOX, MINBOX, or MULTICUTBOX. */ public int getRepresentation() { return representation; } public static String getRepresentationName(int rep) { if (rep == POINTS) return "points"; if (rep == BOX) return "box";// if (rep == MINBOX) return "min-box"; if (rep == MULTICUTBOX) return "multi-cut-box"; return "?"; } /** * Returns the list of coordinates (stored as TechPoints) associated with this NodeLayer. * @return the list of coordinates (stored as TechPoints) associated with this NodeLayer. */ public TechPoint [] getPoints() { return points; } /** * Method to set new points to this NodeLayer * @param pts */ public void setPoints(TechPoint [] pts) {points = pts; } /** * Returns the left edge coordinate (a scalable EdgeH object) associated with this NodeLayer. * @return the left edge coordinate associated with this NodeLayer. * It only makes sense if the representation is BOX or MINBOX. * The returned coordinate is a scalable EdgeH object. */ public EdgeH getLeftEdge() { return points[0].getX(); } /** * Returns the bottom edge coordinate (a scalable EdgeV object) associated with this NodeLayer. * @return the bottom edge coordinate associated with this NodeLayer. * It only makes sense if the representation is BOX or MINBOX. * The returned coordinate is a scalable EdgeV object. */ public EdgeV getBottomEdge() { return points[0].getY(); } /** * Returns the right edge coordinate (a scalable EdgeH object) associated with this NodeLayer. * @return the right edge coordinate associated with this NodeLayer. * It only makes sense if the representation is BOX or MINBOX. * The returned coordinate is a scalable EdgeH object. */ public EdgeH getRightEdge() { return points[1].getX(); } /** * Returns the top edge coordinate (a scalable EdgeV object) associated with this NodeLayer. * @return the top edge coordinate associated with this NodeLayer. * It only makes sense if the representation is BOX or MINBOX. * The returned coordinate is a scalable EdgeV object. */ public EdgeV getTopEdge() { return points[1].getY(); } /** * Returns the text message associated with this list NodeLayer. * @return the text message associated with this list NodeLayer. * This only makes sense if the style is one of the TEXT types. */ public String getMessage() { return message; } /** * Sets the text to be drawn by this NodeLayer. * @param message the text to be drawn by this NodeLayer. * This only makes sense if the style is one of the TEXT types. */ public void setMessage(String message) { this.message = message; } /** * Returns the text descriptor associated with this list NodeLayer. * @return the text descriptor associated with this list NodeLayer. * This only makes sense if the style is one of the TEXT types. */ public TextDescriptor getDescriptor() { return descriptor; } /** * Sets the text descriptor to be drawn by this NodeLayer. * @param descriptor the text descriptor to be drawn by this NodeLayer. * This only makes sense if the style is one of the TEXT types. */ public void setDescriptor(TextDescriptor descriptor) { this.descriptor = descriptor; } /** * Returns the left extension of this layer. * Only makes sense when this is a layer in a serpentine transistor. * @return the left extension of this layer. */ public double getSerpentineLWidth() { return lWidth; } /** * Sets the left extension of this layer. * Only makes sense when this is a layer in a serpentine transistor. * @param lWidth the left extension of this layer. */ public void setSerpentineLWidth(double lWidth) { this.lWidth = lWidth; } /** * Returns the right extension of this layer. * Only makes sense when this is a layer in a serpentine transistor. * @return the right extension of this layer. */ public double getSerpentineRWidth() { return rWidth; } /** * Sets the right extension of this layer. * Only makes sense when this is a layer in a serpentine transistor. * @param rWidth the right extension of this layer. */ public void setSerpentineRWidth(double rWidth) { this.rWidth = rWidth; } /** * Returns the top extension of this layer. * Only makes sense when this is a layer in a serpentine transistor. * @return the top extension of this layer. */ public double getSerpentineExtentT() { return extentT; } /** * Sets the top extension of this layer. * Only makes sense when this is a layer in a serpentine transistor. * @param extentT the top extension of this layer. */ public void setSerpentineExtentT(double extentT) { this.extentT = extentT; } /** * Returns the bottom extension of this layer. * Only makes sense when this is a layer in a serpentine transistor. * @return the bottom extension of this layer. */ public double getSerpentineExtentB() { return extendB; } /** * Sets the bottom extension of this layer. * Only makes sense when this is a layer in a serpentine transistor. * @param extendB the bottom extension of this layer. */ public void setSerpentineExtentB(double extendB) { this.extendB = extendB; } public double getMulticutSizeX() { return DBMath.gridToLambda(cutGridSizeX); } public double getMulticutSizeY() { return DBMath.gridToLambda(cutGridSizeY); } public double getMulticutSep1D() { return DBMath.gridToLambda(cutGridSep1D); } public double getMulticutSep2D() { return DBMath.gridToLambda(cutGridSep2D); } void dump(PrintWriter out, boolean isSerp) { out.println("\tlayer=" + getLayerOrPseudoLayer().getName() + " port=" + getPortNum() + " style=" + getStyle().name() + " repr=" + getRepresentation()); if (getMessage() != null) { TextDescriptor td = getDescriptor(); out.println("\t\tmessage=\"" + getMessage() + "\" td=" + Long.toHexString(td.lowLevelGet()) + " colorIndex=" + td.getColorIndex() + " disp=" + td.isDisplay()); } if (getMulticutSizeX() != 0 || getMulticutSizeY() != 0 || getMulticutSep1D() != 0 || getMulticutSep2D() != 0) out.println("\t\tmultiSizeX=" + getMulticutSizeX() + " multiSizeY=" + getMulticutSizeY() + " multiSep=" + getMulticutSep1D() + " multiSpe2D=" + getMulticutSep2D()); if (isSerp) out.println("\t\tLWidth=" + getSerpentineLWidth() + " rWidth=" + getSerpentineRWidth() + " bExtend=" + getSerpentineExtentB() + " tExtend=" + getSerpentineExtentT()); for (Technology.TechPoint p: getPoints()) out.println("\t\tpoint xm=" + p.getX().getMultiplier() + " xa=" + p.getX().getAdder() + " ym=" + p.getY().getMultiplier() + " ya=" + p.getY().getAdder()); } Xml.NodeLayer makeXml(boolean isSerp, EPoint correction, boolean inLayers, boolean inElectricalLayers) { Xml.NodeLayer nld = new Xml.NodeLayer();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -