⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edif.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
				} else if (keyStack[keyStackDepth-1] == KINSTANCE)				{					instanceName = instanceReference = objectName;				} else if (keyStack[keyStackDepth-1] == KNET)				{					netReference = netName = fixLeadingAmpersand(objectName);				} else if (keyStack[keyStackDepth-1] == KPROPERTY)				{					propertyReference = objectName;				}			}		}		protected void pop()		{			if (arrayXVal == 0) arrayXVal = 1;			if (arrayYVal == 0) arrayYVal = 1;		}	}	private class KeyBoundingBox extends EDIFKEY	{		private KeyBoundingBox() { super("boundingBox"); }		protected void push()		{			curFigureGroup = Artwork.tech().openedDottedPolygonNode;		}		protected void pop()		{			curFigureGroup = null;		}	}	private class KeyCell extends EDIFKEY	{		private KeyCell() { super("cell"); }		protected void push()			throws IOException		{			activeView = VNULL;			objectName = "";   originalName = "";			pageNumber = 0;			sheetXPos = sheetYPos = -1;			if (checkName())			{				cellName = cellReference = fixLeadingAmpersand(objectName);			}		}	}	private class KeyCellRef extends EDIFKEY	{		private KeyCellRef() { super("cellRef"); }		protected void push()			throws IOException		{			cellRef = fixLeadingAmpersand(getToken((char)0));			libraryRef = null;		}		protected void pop()		{			// get the name of the cell			String aName = cellRef;			cellRefProtoTechBits = 0;			cellRefProtoRotation = 0;			cellRefOffsetX = cellRefOffsetY = 0;			String view = "lay";			if (activeView != VMASKLAYOUT)			{				if (keyStack[keyStackDepth - 1] == KDESIGN) view = "sch"; else					view = "ic";			}			if (curVendor == EVVIEWLOGIC && aName.equalsIgnoreCase("SPLITTER"))			{				cellRefProto = null;				return;			}			// look for an equivalent primitive			EDIFEquiv.NodeEquivalence ne = equivs.getNodeEquivalence(libraryRef, cellRef, viewRef);			if (ne != null && ne.np != null)			{				mappedNodes.put(instanceName, ne);				cellRefProto = ne.np;				cellRefProtoTechBits = 0;				cellRefProtoRotation = ne.rotation;				// determine the offset				cellRefOffsetX = ne.xOffset;				cellRefOffsetY = ne.yOffset;				if (cellRefProto instanceof PrimitiveNode) {					Technology tech = cellRefProto.getTechnology();					if (tech instanceof Schematics) {						cellRefProtoTechBits = Schematics.getPrimitiveFunctionBits(ne.function);					}				}				return;			}			// look for this cell name in the cell list			NameEntry nt = cellTable.get(aName);			if (nt == null)			{				String alternateName = renamedObjects.get(aName);				if (alternateName != null)					nt = cellTable.get(alternateName);			}			if (nt != null)			{				aName = nt.replace;			} else			{				System.out.println("could not find cellRef <" + aName + ">");			}			// create cell if not already there			Cell proto = createCell(libraryRef, aName, view);			if (proto == null)				System.out.println("Error, cannot create cell "+aName+" in library "+libraryRef);			// set the parent			cellRefProto = proto;		}	}	private class KeyCircle extends EDIFKEY	{		private KeyCircle() { super("circle"); }		protected void push()		{			freePointList();			curOrientation = OR0;		}		protected void pop()		{			if (curPoints.size() == 2)			{				Point2D p0 = curPoints.get(0);				Point2D p1 = curPoints.get(1);				double lX = Math.min(p0.getX(), p1.getX());				double hX = Math.max(p0.getX(), p1.getX());				double lY = Math.min(p0.getY(), p1.getY());				double hY = Math.max(p0.getY(), p1.getY());				if (lX == hX)				{					lX -= (hY - lY) / 2;					hX += (hY - lY) / 2;				} else				{					lY -= (hX - lX) / 2;					hY += (hX - lX) / 2;				}				double sX = hX - lX;				double sY = hY - lY;				// create the node instance				double cX = (hX + lX) / 2;				double cY = (hY + lY) / 2;				if (curCellPage > 0) cY += (curCellPage-1) * Cell.FrameDescription.MULTIPAGESEPARATION;				NodeInst ni = NodeInst.makeInstance(Artwork.tech().circleNode, new Point2D.Double(cX, cY),					sX, sY, curCell, curOrientation, null, 0);				if (ni == null)				{					System.out.println("Error, line " + lineReader.getLineNumber() + ": could not create circle");					errorCount++;				}			}			freePointList();		}	}	private class KeyCornerType extends EDIFKEY	{		private KeyCornerType() { super("cornerType"); }		protected void push()			throws IOException		{			// get the endtype			getToken((char)0);		}	}	private class KeyDelta extends EDIFKEY	{		private KeyDelta() { super("delta"); }		protected void push()		{			deltaPointXX = deltaPointXY = 0;			deltaPointYX = deltaPointYY = 0;			deltaPointsSet = false;		}	}	private class KeyDesign extends EDIFKEY	{		private KeyDesign() { super("design"); }		protected void push()			throws IOException		{			// ignore the name of the cell			getToken((char)0);		}		protected void pop()		{			if (cellRefProto != null)			{				Job.getUserInterface().setCurrentCell(curLibrary, (Cell)cellRefProto);			}		}	}	private class KeyDirection extends EDIFKEY	{		private KeyDirection() { super("direction"); }		protected void push()			throws IOException		{			// get the direction			String aName = getToken((char)0);			if (aName.equalsIgnoreCase("INPUT")) curDirection = PortCharacteristic.IN; else				if (aName.equalsIgnoreCase("INOUT")) curDirection = PortCharacteristic.BIDIR; else					if (aName.equalsIgnoreCase("OUTPUT")) curDirection = PortCharacteristic.OUT;		}	}	private class KeyDisplay extends EDIFKEY	{		private KeyDisplay() { super("display"); }		protected void push()			throws IOException		{			makeFigure();		}	}	private class KeyDot extends EDIFKEY	{		private KeyDot() { super("dot"); }		protected void push()		{			freePointList();			curOrientation = OR0;		}		protected void pop()		{			if (curGeometryType == GPIN)			{				// inside a PortImplementation				EDIFPort ePort = null;				for (EDIFPort e = portsListHead; e != null; e = e.next)				{					if (e.reference.equalsIgnoreCase(objectName)) { ePort = e;   break; }				}				if (ePort != null)				{					String pName = ePort.name;					Export ppt = (Export)curCell.findPortProto(pName);					if (ppt == null)					{						// create a internal wire port using the pin-proto, and create the port and export						Point2D p0 = curPoints.get(0);						double xPos = p0.getX();						double yPos = p0.getY();						if (curCellPage > 0) yPos += (curCellPage-1) * Cell.FrameDescription.MULTIPAGESEPARATION;						NodeInst ni = placePin(cellRefProto, xPos, yPos, cellRefProto.getDefWidth(), cellRefProto.getDefHeight(), curOrientation, curCell);						if (ni == null)						{							System.out.println("Error, line " + lineReader.getLineNumber() + ": could not create pin");							errorCount++;						}						PortInst pi = ni.findPortInstFromProto(defaultIconPort);						ppt = makeExport(curCell, pi, pName, ePort.direction);						if (ppt == null)						{							System.out.println("Error, line " + lineReader.getLineNumber() + ": could not create port <" + pName + ">");							errorCount++;						}					}				}			} else			{				// create the node instance				Point2D p0 = curPoints.get(0);				double xPos = p0.getX();				double yPos = p0.getY();				if (curCellPage > 0) yPos += (curCellPage-1) * Cell.FrameDescription.MULTIPAGESEPARATION;				NodeInst ni = NodeInst.makeInstance(curFigureGroup != null ? curFigureGroup : Artwork.tech().boxNode,					new Point2D.Double(xPos, yPos), 0, 0, curCell);				if (ni == null)				{					System.out.println("Error, line " + lineReader.getLineNumber() + ": could not create rectangle");					errorCount++;				}			}			freePointList();		}	}	private class KeyEndType extends EDIFKEY	{		private KeyEndType() { super("endType"); }		protected void push()			throws IOException		{			// get the endtype			String type = getToken((char)0);			if (type.equalsIgnoreCase("EXTEND")) extendEnd = true;		}	}	private class KeyExternal extends EDIFKEY	{		private KeyExternal() { super("external"); }		protected void push()			throws IOException		{			// ignore the name of the library			getToken((char)0);		}	}	private class KeyFabricate extends EDIFKEY	{		private KeyFabricate() { super("fabricate"); }		protected void push()			throws IOException		{			NameEntry nt = new NameEntry();			nameEntryList.add(nt);			// first get the original and replacement layers			nt.original = getToken((char) 0);			nt.replace = getToken((char) 0);			nt.textHeight = 0;			nt.justification = TextDescriptor.Position.DOWNRIGHT;			nt.visible = true;		}	}	private class KeyFalse extends EDIFKEY	{		private KeyFalse() { super("false"); }		protected void push()		{			// check previous keyword			if (keyStackDepth > 1 && keyStack[keyStackDepth-1] == KVISIBLE)			{				textVisible = false;				if (curNameEntry != null)					curNameEntry.visible = false;			}		}	}	private class KeyFigure extends EDIFKEY	{		private KeyFigure() { super("figure"); }		protected void push()			throws IOException		{			makeFigure();		}		protected void pop()		{			curNameEntry = null;			textVisible = true;			textJustification = TextDescriptor.Position.DOWNRIGHT;			textHeight = 0;		}	}	private class KeyFigureGroupOverride extends EDIFKEY	{		private KeyFigureGroupOverride() { super("figureGroupOverride"); }		protected void push()			throws IOException		{			// get the layer name			String layer = getToken((char)0);			// now look for this layer in the list of layers			for(NameEntry nt : nameEntryList)			{				if (nt == null) continue;				if (nt.original.equalsIgnoreCase(layer))				{					// found the layer					curFigureGroup = nt.node;					textHeight = nt.textHeight;					textJustification = nt.justification;					textVisible = nt.visible;					return;				}			}			// insert and resort the list			NameEntry nt = new NameEntry();			nameEntryList.add(nt);			nt.original = layer;			nt.replace = nt.original;			curFigureGroup = nt.node = Artwork.tech().boxNode;			textHeight = nt.textHeight = 0;			textJustification = nt.justification = TextDescriptor.Position.DOWNRIGHT;			textVisible = nt.visible = true;		}	}	private class KeyInstance extends EDIFKEY	{		private KeyInstance() { super("instance"); }		protected void push()			thro

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -