quick.java
来自「The ElectricTM VLSI Design System is an 」· Java 代码 · 共 1,590 行 · 第 1/5 页
JAVA
1,590 行
// just do full DRC here /*totalErrors =*/ checkThisCell(cell, 0, bounds); // sort the errors by layer errorLogger.sortLogs(); } else { // check only these "count" instances (either an incremental DRC or a quiet one...from Array command) if (validity == null) { // not a quiet DRC, so it must be incremental logsFound = errorLogger.getNumLogs(); } // @TODO missing counting this number of errors. checkTheseGeometrics(cell, count, geomsToCheck, validity); } if (errorLogger != null) { errorLogger.termLogging(true); logsFound = errorLogger.getNumLogs() - logsFound; } // -2 if cells and subcells are ok // Commentted out on May 2, 2006. Not sure why this condition is valid // If goodDRCDate contains information of DRC clean cells, it destroys that information -> wrong// if (totalErrors != 0 && totalErrors != -2) goodDRCDate.clear(); // some cells were sucessfully checked: save that information in the database // some cells don't have valid DRC date anymore and therefore they should be clean // This is only going to happen if job was not aborted. if ((job == null || !job.checkAbort())) { DRC.addDRCUpdate(reportInfo.activeSpacingBits, goodSpacingDRCDate, cleanSpacingDRCDate, goodAreaDRCDate, cleanAreaDRCDate, null); } return errorLogger; } /*************************** QUICK DRC CELL EXAMINATION ***************************/ /** * Method to check the contents of cell "cell" with global network index "globalIndex". * Returns positive if errors are found, zero if no errors are found, negative on internal error. * @param cell * @param globalIndex * @param bounds * @return positive number if errors are found, zero if no errors are found and check the cell, -1 if job was * aborted and -2 if cell is OK with DRC date stored. */ private int checkThisCell(Cell cell, int globalIndex, Rectangle2D bounds) { // Job aborted or scheduled for abort if (job != null && job.checkAbort()) return -1; // Cell already checked if (cellsMap.get(cell) != null) return (0); // Previous # of errors/warnings int prevErrors = 0; int prevWarns = 0; if (reportInfo.errorLogger != null) { prevErrors = reportInfo.errorLogger.getNumErrors(); prevWarns = reportInfo.errorLogger.getNumWarnings(); } cellsMap.put(cell, cell); // Check if cell doesn't have special annotation Variable drcVar = cell.getVar(DRC.DRC_ANNOTATION_KEY); if (drcVar != null && drcVar.getObject().toString().startsWith("black")) { // Skipping this one assert(reportInfo.totalSpacingMsgFound == 0); // get rid of this variable. return reportInfo.totalSpacingMsgFound; } // first check all subcells boolean allSubCellsStillOK = true; Area area = reportInfo.exclusionMap.get(cell); for(Iterator<NodeInst> it = cell.getNodes(); it.hasNext(); ) { if (job != null && job.checkAbort()) return -1; NodeInst ni = it.next(); NodeProto np = ni.getProto(); if (!ni.isCellInstance()) continue; // ignore documentation icons if (ni.isIconOfParent()) continue; // Check DRC exclusion regions if (area != null && area.contains(ni.getBounds())) continue; // excluded // ignore if not in the area Rectangle2D subBounds = bounds; // sept30 if (subBounds != null) { if (!ni.getBounds().intersects(bounds)) continue; AffineTransform trans = ni.rotateIn(); AffineTransform xTrnI = ni.translateIn(); trans.preConcatenate(xTrnI); subBounds = new Rectangle2D.Double(); subBounds.setRect(bounds); DBMath.transformRect(subBounds, trans); } CheckProto cp = getCheckProto((Cell)np); if (cp.cellChecked && !cp.cellParameterized) continue; // recursively check the subcell CheckInst ci = checkInsts.get(ni); int localIndex = globalIndex * ci.multiplier + ci.localIndex + ci.offset; int retval = checkThisCell((Cell)np, localIndex, subBounds); if (retval < 0) return retval; // if cell is in goodDRCDate it means it changes its date for some reason. // This happen when a subcell was reloaded and DRC again. The cell containing // the subcell instance must be re-DRC to make sure changes in subCell don't affect // the parent one. if (retval > 0 || goodSpacingDRCDate.contains(np)) allSubCellsStillOK = false;// if (retval > 0)// allSubCellsStillOK = false; } // prepare to check cell CheckProto cp = getCheckProto(cell); cp.cellChecked = true; boolean checkArea = (cell == topCell && !DRC.isIgnoreAreaChecking() && reportInfo.errorTypeSearch != DRC.DRCCheckMode.ERROR_CHECK_CELL); // if the cell hasn't changed since the last good check, stop now Date lastSpacingGoodDate = DRC.getLastDRCDateBasedOnBits(cell, true, reportInfo.activeSpacingBits, !reportInfo.inMemory); Date lastAreaGoodDate = DRC.getLastDRCDateBasedOnBits(cell, false, -1, !reportInfo.inMemory); if (allSubCellsStillOK && DRC.isCellDRCDateGood(cell, lastSpacingGoodDate) && (!checkArea || DRC.isCellDRCDateGood(cell, lastAreaGoodDate))) { return 0; } // announce progress long startTime = System.currentTimeMillis(); System.out.println("Checking " + cell); // now look at every node and arc here reportInfo.totalSpacingMsgFound = 0; // Check the area first but only when is not incremental // Only for the most top cell if (checkArea) {// totalMsgFound = checkMinArea(cell); assert(reportInfo.totalSpacingMsgFound == 0); int totalAreaMsgFound = checkMinAreaSlow(cell); if (totalAreaMsgFound == 0) goodAreaDRCDate.add(cell); else cleanAreaDRCDate.add(cell); } for(Iterator<NodeInst> it = cell.getNodes(); it.hasNext(); ) { if (job != null && job.checkAbort()) return -1; NodeInst ni = it.next(); if (bounds != null) { if (!ni.getBounds().intersects(bounds)) continue; } if (area != null) { if (area.contains(ni.getBounds())) { continue; } } boolean ret = (ni.isCellInstance()) ? checkCellInst(ni, globalIndex) : checkNodeInst(ni, globalIndex); if (ret) { reportInfo.totalSpacingMsgFound++; if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) break; } } Technology cellTech = cell.getTechnology(); for(Iterator<ArcInst> it = cell.getArcs(); it.hasNext(); ) { if (job != null && job.checkAbort()) return -1; ArcInst ai = it.next(); Technology tech = ai.getProto().getTechnology(); if (tech != cellTech) { DRC.createDRCErrorLogger(reportInfo, DRC.DRCErrorType.TECHMIXWARN, " belongs to " + tech.getTechName(), cell, 0, 0, null, null, ai, null, null, null, null); continue; } if (bounds != null) { if (!ai.getBounds().intersects(bounds)) continue; } if (checkArcInst(cp, ai, globalIndex)) { reportInfo.totalSpacingMsgFound++; if (reportInfo.errorTypeSearch == DRC.DRCCheckMode.ERROR_CHECK_CELL) break; } } // If message founds, then remove any possible good date // !allSubCellsStillOK disconnected on April 18, 2006. totalMsgFound should // dictate if this cell is re-marked. if (reportInfo.totalSpacingMsgFound > 0) // || !allSubCellsStillOK) { cleanSpacingDRCDate.add(cell); } else { // Only mark the cell when it passes with a new version of DRC or didn't have // the DRC bit on // If lastGoodDate == null, wrong bits stored or no date available. if (lastSpacingGoodDate == null) goodSpacingDRCDate.add(cell); } // if there were no errors, remember that if (reportInfo.errorLogger != null) { int localErrors = reportInfo.errorLogger.getNumErrors() - prevErrors; int localWarnings = reportInfo.errorLogger.getNumWarnings() - prevWarns; long endTime = System.currentTimeMillis(); if (localErrors == 0 && localWarnings == 0) { System.out.println("\tNo errors/warnings found"); } else { if (localErrors > 0) System.out.println("\tFOUND " + localErrors + " ERRORS"); if (localWarnings > 0) System.out.println("\tFOUND " + localWarnings + " WARNINGS"); } if (Job.getDebug()) System.out.println("\t(took " + TextUtils.getElapsedTime(endTime - startTime) + ")"); } return reportInfo.totalSpacingMsgFound; } /** * Check Poly for CIF Resolution Errors * @param poly * @param cell * @param geom * @return true if an error was found. */ private boolean checkResolution(PolyBase poly, Cell cell, Geometric geom) { double minAllowedResolution = reportInfo.minAllowedResolution; if (minAllowedResolution == 0) return false; int count = 0; String resolutionError = ""; Point2D [] points = poly.getPoints(); for(Point2D point : points) { if (DBMath.hasRemainder(point.getX(), minAllowedResolution)) { count++; resolutionError = TextUtils.formatDouble(Math.abs(((point.getX()/minAllowedResolution) % 1) * minAllowedResolution)) + "(X=" + point.getX() + ")"; break; // with one error is enough } else if (DBMath.hasRemainder(point.getY(), minAllowedResolution)) { count++; resolutionError = TextUtils.formatDouble(Math.abs(((point.getY()/minAllowedResolution) % 1) * 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 " + 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 = reportInfo.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 = reportInfo.exclusionMap.get(parent);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?