📄 mtdrclayouttool.java
字号:
* @return true if an error was found. */ private boolean checkResolution(PolyBase poly, Cell cell, Geometric geom) { if (reportInfo.minAllowedResolution == 0) return false; int count = 0; String resolutionError = ""; Point2D[] points = poly.getPoints(); for (Point2D point : points) { if (DBMath.hasRemainder(point.getX(), reportInfo.minAllowedResolution)) { count++; resolutionError = TextUtils.formatDouble(Math.abs(((point.getX() / reportInfo.minAllowedResolution) % 1) * reportInfo.minAllowedResolution)) + "(X=" + point.getX() + ")"; break; // with one error is enough } else if (DBMath.hasRemainder(point.getY(), reportInfo.minAllowedResolution)) { count++; resolutionError = TextUtils.formatDouble(Math.abs(((point.getY() / reportInfo.minAllowedResolution) % 1) * reportInfo.minAllowedResolution)) + "(Y=" + point.getY() + ")"; break; } } if (count == 0) return false; // no error // there was an error, for now print error Layer layer = poly.getLayer(); DRC.createDRCErrorLogger(reportInfo, DRC.DRCErrorType.RESOLUTION, " resolution of " + resolutionError + " less than " + reportInfo.minAllowedResolution + " on layer " + layer.getName(), cell, 0, 0, "Resolution", null, geom, null, null, null, null); return true; } /** * Private method to check if geometry is covered 100% by exclusion region * * @param geo * @return true if geometry is covered by exclusion */ private boolean coverByExclusion(Geometric geo) { Cell cell = geo.getParent(); Area area = exclusionMap.get(cell); if (area != null && area.contains(geo.getBounds())) {// System.out.println("DRC Exclusion found"); return true; } return false; } /** * Private method to check if geometry given by Poly object is inside an exclusion region * * @param poly * @param parent * @return true if Poly is inside an exclusion region */ private boolean coverByExclusion(Poly poly, Cell parent) { Area area = exclusionMap.get(parent); if (area == null) return false; Point2D[] pts = poly.getPoints(); for (Point2D point : pts) { if (!area.contains(point)) { return false; } }// System.out.println("DRC Exclusion found in coverByExclusion"); return true; } /** * Method to check the design rules about nodeinst "ni". * * @param ni * @param globalIndex * @return true if an error was found. */ private boolean checkNodeInst(NodeInst ni, int globalIndex) { Cell cell = ni.getParent(); Netlist netlist = getCheckProto(cell).netlist; NodeProto np = ni.getProto(); Technology tech = np.getTechnology(); AffineTransform trans = ni.rotateOut(); boolean errorsFound = false; // Skipping special nodes if (NodeInst.isSpecialNode(ni)) return false; // Oct 5; if (!np.getTechnology().isLayout()) return (false); // only layout nodes if (np.getFunction() == PrimitiveNode.Function.PIN) return false; // Sept 30 if (coverByExclusion(ni)) return false; // no errors // Already done if (nodesMap.get(ni) != null) return (false); nodesMap.put(ni, ni); if (thisLayerFunction != null) { // get all of the polygons on this node Poly[] nodeInstPolyList = tech.getShapeOfNode(ni, true, reportInfo.ignoreCenterCuts, thisLayerFunction); convertPseudoLayers(ni, nodeInstPolyList); int tot = nodeInstPolyList.length; boolean isTransistor = np.getFunction().isTransistor(); Technology.MultiCutData multiCutData = tech.getMultiCutData(ni); // examine the polygons on this node for (int j = 0; j < tot; j++) { Poly poly = nodeInstPolyList[j]; Layer layer = poly.getLayer(); if (layer == null) continue; if (coverByExclusion(poly, cell)) continue; // Checking combination boolean ret = DRC.checkOD2Combination(tech, ni, layer, od2Layers, reportInfo); if (ret) { // panic errors -> return regarless errorTypeSearch return true; } poly.transform(trans); // Checking resolution only after transformation ret = checkResolution(poly, cell, ni); if (ret) { if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true; errorsFound = true; } // determine network for this polygon int netNumber = getDRCNetNumber(netlist, poly.getPort(), ni, globalIndex); ret = badBox(poly, layer, netNumber, tech, ni, trans, cell, globalIndex, multiCutData); if (ret) { if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true; errorsFound = true; } ret = checkMinWidth(ni, layer, poly, tot == 1); if (ret) { if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true; errorsFound = true; } // Check select over transistor poly // Assumes polys on transistors fulfill condition by construction// ret = !isTransistor && checkSelectOverPolysilicon(ni, layer, poly, cell); ret = !isTransistor && checkExtensionRules(ni, layer, poly, cell); if (ret) { if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true; errorsFound = true; }// ret = checkExtensionRule(ni, layer, poly, cell);// if (ret)// {// if (errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true;// errorsFound = true;// } if (validLayers.isABadLayer(tech, layer.getIndex())) { DRC.createDRCErrorLogger(reportInfo, DRC.DRCErrorType.BADLAYERERROR, null, cell, 0, 0, null, poly, ni, layer, null, null, null); if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true; errorsFound = true; } } } else { // Node errors! if (DRC.checkNodeAgainstCombinationRules(ni, reportInfo)) { if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true; errorsFound = true; }// if (np instanceof PrimitiveNode && DRC.isForbiddenNode(currentRules, ((PrimitiveNode) np).getPrimNodeIndexInTech(), -1,// DRCTemplate.DRCRuleType.FORBIDDEN))// {// DRC.createDRCErrorLogger(reportInfo, DRC.DRCErrorType.FORBIDDEN, " is not allowed by selected foundry", cell, -1, -1, null, null, ni, null, null, null, null);// if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true;// errorsFound = true;// } // check node for minimum size if (DRC.checkNodeSize(ni, cell, reportInfo)) errorsFound = true; } return errorsFound; } /** * Method to check the design rules about arcinst "ai". * Returns true if errors were found. */ private boolean checkArcInst(CheckProto cp, ArcInst ai, int globalIndex) { // Nothing to check if (thisLayerFunction == null) return false; // ignore arcs with no topology Network net = cp.netlist.getNetwork(ai, 0); if (net == null) return false; Integer[] netNumbers = networkLists.get(net); if (nodesMap.get(ai) != null) { return (false); } nodesMap.put(ai, ai); // Check if arc is contained in exclusion region// if (coverByExclusion(ai))// return false; // no error boolean errorsFound = false; // Checking if the arc is horizontal or vertical Point2D from = ai.getHeadLocation(); Point2D to = ai.getTailLocation(); if (!DBMath.areEquals(from.getX(), to.getX()) && !DBMath.areEquals(from.getY(), to.getY())) { DRC.createDRCErrorLogger(reportInfo, DRC.DRCErrorType.CROOKEDERROR, null, ai.getParent(), -1, -1, null, null, ai, null, null, null, null); if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true; errorsFound = true; } // get all of the polygons on this arc Technology tech = ai.getProto().getTechnology(); Poly[] arcInstPolyList = tech.getShapeOfArc(ai, thisLayerFunction); // Check resolution before cropping the for (Poly poly : arcInstPolyList) { Layer layer = poly.getLayer(); if (layer == null) continue; if (layer.isNonElectrical()) continue; // Checking resolution boolean ret = checkResolution(poly, ai.getParent(), ai); if (ret) { if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true; errorsFound = true; } } cropActiveArc(ai, arcInstPolyList); int tot = arcInstPolyList.length; // examine the polygons on this arc for (int j = 0; j < tot; j++) { Poly poly = arcInstPolyList[j]; Layer layer = poly.getLayer(); if (layer == null) continue; if (layer.isNonElectrical()) continue; int layerNum = layer.getIndex(); int netNumber = netNumbers[globalIndex]; // autoboxing boolean ret = badBox(poly, layer, netNumber, tech, ai, DBMath.MATID, ai.getParent(), globalIndex, null); if (ret) { if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) return true; errorsFound = true; } ret = checkMinWidth(ai, layer, poly, tot == 1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -