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

📄 techtolib.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
			NodeInst ni = NodeInst.makeInstance(Artwork.tech().boxNode, new Point2D.Double(-20 - xOff, -5), wid*5, wid, aNp);			if (ni == null) return null;			ni.newVar(Artwork.ART_COLOR, new Integer(EGraphics.WHITE));			ni.newVar(Info.OPTION_KEY, new Integer(Info.HIGHLIGHTOBJ));			// compact it accordingly			ArcInfo.compactCell(aNp);		}		// save the arc sequence		lib.newVar(Info.ARCSEQUENCE_KEY, arcSequence);		// create the node cells		System.out.println("Creating the nodes...");		int nodeTotal = 0;		for(Iterator<PrimitiveNode> it = tech.getNodes(); it.hasNext(); )			if (!it.next().isNotUsed()) nodeTotal++;        NodeInfo[] nList = new NodeInfo[nodeTotal];		String [] nodeSequence = new String[nodeTotal];        Cell dummyCell = Cell.newInstance(lib, "dummyCell{lay}");		int nodeIndex = 0;		for(Iterator<PrimitiveNode> it = tech.getNodes(); it.hasNext(); )		{			PrimitiveNode pnp = it.next();			if (pnp.isNotUsed()) continue;            NodeInfo nIn = makeNodeInfo(pnp, lList, aList);            nList[nodeIndex] = nIn;            nodeSequence[nodeIndex] = pnp.getName();			nodeIndex++;			// create the node layers			boolean first = true;			double xS = pnp.getDefWidth() * 2;			double yS = pnp.getDefHeight() * 2;			if (xS < 3) xS = 3;			if (yS < 3) yS = 3;			double nodeXPos = -xS*2;			Point2D [] pos = new Point2D[4];			pos[0] = new Point2D.Double(nodeXPos - xS, -5 + yS);			pos[1] = new Point2D.Double(nodeXPos + xS, -5 + yS);			pos[2] = new Point2D.Double(nodeXPos - xS, -5 - yS);			pos[3] = new Point2D.Double(nodeXPos + xS, -5 - yS);			SizeOffset so = pnp.getProtoSizeOffset();			xS = pnp.getDefWidth() - so.getLowXOffset() - so.getHighXOffset();			yS = pnp.getDefHeight() - so.getLowYOffset() - so.getHighYOffset();			double [] xsc = new double[4];			double [] ysc = new double[4];			xsc[0] = xS*1;   ysc[0] = yS*1;			xsc[1] = xS*2;   ysc[1] = yS*1;			xsc[2] = xS*1;   ysc[2] = yS*2;			xsc[3] = xS*2;   ysc[3] = yS*2;			// for multicut contacts, make large size be just right for 2 cuts			if (pnp.isMulticut())			{                EPoint min2size = pnp.getMulticut2Size();                double min2X = min2size.getLambdaX();                double min2Y = min2size.getLambdaY();                xsc[1] = min2X;                xsc[3] = min2X;                ysc[2] = min2Y;                ysc[3] = min2Y;			}			Cell nNp = null;			Rectangle2D mainBounds = null;			for(int e=0; e<4; e++)			{				// do not create node if main example had no polygons				if (e != 0 && first) continue;				// square nodes have only two examples                if (pnp.isSquare() && (e == 1 || e == 2)) continue;                double newXSize = xsc[e] + so.getLowXOffset() + so.getHighXOffset();                double newYSize = ysc[e] + so.getLowYOffset() + so.getHighYOffset();                NodeInst oNi = NodeInst.makeInstance(pnp, EPoint.snap(pos[e]), newXSize, newYSize, dummyCell);				Poly [] polys = tech.getShapeOfNode(oNi);				int j = polys.length;				for(int i=0; i<j; i++)				{					Poly poly = polys[i];					Layer nodeLayer = poly.getLayer().getNonPseudoLayer();					if (nodeLayer == null) continue;					EGraphics desc = nodeLayer.getGraphics();					// accumulate total size of main example					if (e == 0)					{						Rectangle2D polyBounds = poly.getBounds2D();						if (i == 0)						{							mainBounds = polyBounds;						} else						{							Rectangle2D.union(mainBounds, polyBounds, mainBounds);						}					}					// create the node cell on the first valid layer					if (first)					{						first = false;						String fName = "node-" + pnp.getName() + "{lay}";						// make sure the node doesn't exist						if (lib.findNodeProto(fName) != null)						{							System.out.println("Warning: already a cell '" + fName + "'.  Creating a new version");						}						// use "newInstance" instead of "makeInstance" so that cell center is not placed						nNp = Cell.newInstance(lib, fName);						if (nNp == null) return null;						nNp.setTechnology(Artwork.tech());						nNp.setInTechnologyLibrary();						nIn.generate(nNp);					}					// create the node to describe this layer					NodeInst ni = placeGeometry(poly, nNp);					if (ni == null) {                        System.out.println("Error placing geometry " + poly.getStyle() + " on " + nNp);                        continue;                    }					// get graphics for this layer					Manipulate.setPatch(ni, desc);					Cell layerCell = layerCells.get(nodeLayer);					if (layerCell != null) ni.newVar(Info.LAYER_KEY, layerCell.getId());					ni.newVar(Info.OPTION_KEY, new Integer(Info.LAYERPATCH));// 					// set minimum polygon factor on smallest example// 					if (e != 0) continue;// 					if (i < nodeLayers.length)// 					{// 						if (nodeLayers[i].getRepresentation() == Technology.NodeLayer.MINBOX)// 						{// 							ni.newDisplayVar(Info.MINSIZEBOX_KEY, "MIN");// 						}// 					}				}				if (first) continue;				// create the highlight node				xS = pnp.getDefWidth() - so.getLowXOffset() - so.getHighXOffset();				yS = pnp.getDefHeight() - so.getLowYOffset() - so.getHighYOffset();				Point2D loc = new Point2D.Double(pos[e].getX() + (so.getLowXOffset() - so.getHighXOffset())/2,					pos[e].getY() + (so.getLowYOffset() - so.getHighYOffset())/2);				NodeInst ni = NodeInst.makeInstance(Artwork.tech().boxNode, loc, xsc[e], ysc[e], nNp);				if (ni == null) return null;				ni.newVar(Artwork.ART_COLOR, new Integer(EGraphics.makeIndex(Color.WHITE)));				ni.newVar(Info.OPTION_KEY, new Integer(Info.HIGHLIGHTOBJ));				// create a grab node (only in main example)//				if (e == 0)//				{//					var = getvalkey((INTBIG)pnp, VNODEPROTO, VINTEGER|VISARRAY, el_prototype_center_key);//					if (var != NOVARIABLE)//					{//						lx = hx = xpos[0] + ((INTBIG *)var.addr)[0];//						ly = hy = ypos[0] + ((INTBIG *)var.addr)[1];//						lx = muldiv(lx, lambda, oldlam);//						hx = muldiv(hx, lambda, oldlam);//						ly = muldiv(ly, lambda, oldlam);//						hy = muldiv(hy, lambda, oldlam);//						nodeprotosizeoffset(gen_cellcenterprim, &lxo, &lyo, &hxo, &hyo, np);//						ni = newnodeinst(gen_cellcenterprim, lx-lxo, hx+hxo, ly-lyo, hy+hyo, 0, 0, np);//						if (ni == null) return(NOLIBRARY);//					}//				}				// also draw ports				Map<PrimitivePort,NodeInst> portNodes = new HashMap<PrimitivePort,NodeInst>();				for(Iterator<PortProto> pIt = pnp.getPorts(); pIt.hasNext(); )				{					PrimitivePort pp = (PrimitivePort)pIt.next();					Poly poly = tech.getShapeOfPort(oNi, pp);					SizeOffset pSo = Generic.tech().portNode.getProtoSizeOffset();					double width = poly.getBounds2D().getWidth() + pSo.getLowXOffset() + pSo.getHighXOffset();					double height = poly.getBounds2D().getHeight() + pSo.getLowYOffset() + pSo.getHighYOffset();					NodeInst pNi = NodeInst.makeInstance(Generic.tech().portNode, new Point2D.Double(poly.getCenterX(), poly.getCenterY()),						width, height, nNp);					if (pNi == null) return null;					portNodes.put(pp, pNi);					pNi.newVar(Info.OPTION_KEY, new Integer(Info.LAYERPATCH));					pNi.newDisplayVar(Info.PORTNAME_KEY, pp.getName());					// on the first sample, also show angle and connection					if (e != 0) continue;					if (pp.getAngle() != 0 || pp.getAngleRange() != 180)					{						pNi.newVar(Info.PORTANGLE_KEY, new Integer(pp.getAngle()));						pNi.newVar(Info.PORTRANGE_KEY, new Integer(pp.getAngleRange()));					}					// add in the "local" port connections (from this tech)					ArcProto [] connects = pp.getConnections();					List<Cell> validConns = new ArrayList<Cell>();					for(int i=0; i<connects.length; i++)					{						if (connects[i].getTechnology() != tech) continue;						Cell cell = arcCells.get(connects[i]);						if (cell != null) validConns.add(cell);//                        for (int k = 0; k < aList.length; k++) {//                            if (aList[k].name.equals(connects[i].getName())) {//                                break;//                            }//                        }					}					int meaning = 0;					if (validConns.size() > 0)					{						CellId [] aplist = new CellId[validConns.size()];						for(int i=0; i<validConns.size(); i++)						{                            Cell cell = validConns.get(i);							aplist[i] = cell.getId();							String arcName = cell.getName().substring(4);							for (int k = 0; k < aList.length; k++)							{								if (aList[k].name.equals(arcName))								{									if (aList[k].func.isDiffusion()) meaning = 2; else										if (aList[k].func.isPoly()) meaning = 1;									break;								}							}                        }						pNi.newVar(Info.CONNECTION_KEY, aplist);					}					// add in gate/gated factor for transistors					if (pnp.getFunction().isTransistor())					{						pNi.newVar(Info.PORTMEANING_KEY, new Integer(meaning));					}					// connect the connected ports					for(Iterator<PortProto> oPIt = pnp.getPorts(); oPIt.hasNext(); )					{						PrimitivePort opp = (PrimitivePort)oPIt.next();						if (opp == pp) break;						if (opp.getTopology() != pp.getTopology()) continue;						NodeInst nni = portNodes.get(opp);						if (nni == null) continue;						PortInst head = nni.getOnlyPortInst();						PortInst tail = pNi.getOnlyPortInst();						ArcInst.newInstanceBase(Generic.tech().universal_arc, 0, head, tail);						break;					}				}                oNi.kill();			}			// compact it accordingly			NodeInfo.compactCell(nNp);		}        dummyCell.kill();		// save the node sequence		lib.newVar(Info.NODESEQUENCE_KEY, nodeSequence);//		// create the design rule information//		rules = dr_allocaterules(layerTotal, nodeTotal, tech.techname);//		if (rules == NODRCRULES) return(NOLIBRARY);//		for(i=0; i<layerTotal; i++)//			(void)allocstring(&rules.layernames[i], layername(tech, i), el_tempcluster);//		i = 0;//		for(np = tech.firstnodeproto; np != NONODEPROTO; np = np.nextnodeproto)//			if (np.temp1 != 0)//				(void)allocstring(&rules.nodenames[i++],  &((NODEPROTO *)np.temp1).protoname[5],//					el_tempcluster);//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT|VISARRAY, dr_min_widthkey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.numlayers; i++) rules.minwidth[i] = ((INTBIG *)var.addr)[i];//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VSTRING|VISARRAY, dr_min_width_rulekey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.numlayers; i++)//				(void)reallocstring(&rules.minwidthR[i], ((CHAR **)var.addr)[i], el_tempcluster);//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT|VISARRAY, dr_connected_distanceskey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++) rules.conlist[i] = ((INTBIG *)var.addr)[i];//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VSTRING|VISARRAY, dr_connected_distances_rulekey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++)//				(void)reallocstring(&rules.conlistR[i], ((CHAR **)var.addr)[i], el_tempcluster);//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT|VISARRAY, dr_unconnected_distanceskey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++) rules.unconlist[i] = ((INTBIG *)var.addr)[i];//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VSTRING|VISARRAY, dr_unconnected_distances_rulekey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++)//				(void)reallocstring(&rules.unconlistR[i], ((CHAR **)var.addr)[i], el_tempcluster);//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT|VISARRAY, dr_connected_distancesWkey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++) rules.conlistW[i] = ((INTBIG *)var.addr)[i];//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VSTRING|VISARRAY, dr_connected_distancesW_rulekey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++)//				(void)reallocstring(&rules.conlistWR[i], ((CHAR **)var.addr)[i], el_tempcluster);//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT|VISARRAY, dr_unconnected_distancesWkey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++) rules.unconlistW[i] = ((INTBIG *)var.addr)[i];//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VSTRING|VISARRAY, dr_unconnected_distancesW_rulekey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++)//				(void)reallocstring(&rules.unconlistWR[i], ((CHAR **)var.addr)[i], el_tempcluster);//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT|VISARRAY, dr_connected_distancesMkey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++) rules.conlistM[i] = ((INTBIG *)var.addr)[i];//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VSTRING|VISARRAY, dr_connected_distancesM_rulekey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++)//				(void)reallocstring(&rules.conlistMR[i], ((CHAR **)var.addr)[i], el_tempcluster);//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT|VISARRAY, dr_unconnected_distancesMkey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++) rules.unconlistM[i] = ((INTBIG *)var.addr)[i];//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VSTRING|VISARRAY, dr_unconnected_distancesM_rulekey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++)//				(void)reallocstring(&rules.unconlistMR[i], ((CHAR **)var.addr)[i], el_tempcluster);//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT|VISARRAY, dr_edge_distanceskey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++) rules.edgelist[i] = ((INTBIG *)var.addr)[i];//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VSTRING|VISARRAY, dr_edge_distances_rulekey);//		if (var != NOVARIABLE)//			for(i=0; i<rules.utsize; i++)//				(void)reallocstring(&rules.edgelistR[i], ((CHAR **)var.addr)[i], el_tempcluster);//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT, dr_wide_limitkey);//		if (var != NOVARIABLE) rules.widelimit = var.addr;//		var = getvalkey((INTBIG)tech, VTECHNOLOGY, VFRACT|VISARRAY, dr_min_node_sizekey);//		if (var != NOVARIABLE)//		{//			i = j = 0;//			for(np = tech.firstnodeproto; np != NONODEPROTO; np = np.nextnodeproto)//			{//				if (np.temp1 != 0)//				{//					rules.minnodesize[i*2] = ((INTBIG *)var.addr)[j*2];//					rules.minnodesize[i*2+1] = ((INTBIG *)var.addr)[j*2+1];////					// if rule is valid, make sure it is no larger than actual size//					if (rules.minnodesize[i*2] > 0 && rules.minnodesize[i*2+1] > 0)//					{//						if (rules.minnodesize[i*2] > minnodesize[i*2])//							rules.minnodesize[i*2] = minnodesize[i*2];//						if (rules.minnodesize[i*2+1] > minnodesize[i*2+1])//							rules.minnodesize[i*2+1] = minnodesize[i*2+1];//					}//					i++;//				}

⌨️ 快捷键说明

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