📄 mosrules.java
字号:
DRCTemplate.DRCRuleType.CONSPA, wideLimit, 0, null, null, dist, -1)); // autoboxing dist[0] = unConListWide[index]; if (dist[0] >= 0) list.add(new DRCTemplate(unConListWideRules[index], DRCTemplate.DRCMode.ALL.mode(), DRCTemplate.DRCRuleType.UCONSPA, wideLimit, 0, null, null, dist, -1)); // autoboxing } } break; case UCONSPA2D: // multi contact rules { double[] dist = {conListMulti[index]}; // autoboxing if (dist[0] >= 0) list.add(new DRCTemplate(conListMultiRules[index], DRCTemplate.DRCMode.ALL.mode(), DRCTemplate.DRCRuleType.CONSPA, 0, 0, null, null, dist, 1)); dist[0] = unConListMulti[index]; // autoboxing if (dist[0] >= 0) list.add(new DRCTemplate(unConListMultiRules[index], DRCTemplate.DRCMode.ALL.mode(), DRCTemplate.DRCRuleType.UCONSPA, 0, 0, null, null, dist, 1)); } break; case SPACINGE: // edge rules { double[] dist = {edgeList[index]}; // autoboxing if (dist[0] >= 0) list.add(new DRCTemplate(edgeListRules[index], DRCTemplate.DRCMode.ALL.mode(), DRCTemplate.DRCRuleType.SPACINGE, 0, 0, null, null, dist, -1)); } break; default: System.out.println("Error in MOSRules.getSpacingRules"); } return (list); } /** * Method to calculate final number of rules */ private void calculateNumberOfRules() { int count = 0; // autoboxing was applied below for(int i = 0; i < uTSize; i++) { //Uncon if (unConList[i] > MOSNORULE) count++; if (unConListWide[i] > MOSNORULE) count++; if (unConListMulti[i] > MOSNORULE) count++; // Con if (conList[i] > MOSNORULE) count++; if (conListWide[i] > MOSNORULE) count++; if (conListMulti[i] > MOSNORULE) count++; // Edge rules if (edgeList[i] > MOSNORULE) count++; } for(int i=0; i<numLayers; i++) { if (minWidth[i] > MOSNORULE) count++; } for(int i=0; i<minNodeSize.length; i++) { if (minNodeSize[i] > MOSNORULE) count++; } numberOfRules = count; } /** * Method to get the minimum <type> rule for a Layer * where <type> is the rule type. E.g. MinWidth or Area * @param layer the Layer to examine. * @param type rule type * @return the minimum rule for the layer. * Returns null if there is no minimum width rule. */ public DRCTemplate getMinValue(Layer layer, DRCTemplate.DRCRuleType type) { int index = layer.getIndex(); switch(type) { case MINWID: { double[] dist = {minWidth[index]}; // autoboxing if (dist[0] < 0) return null; return (new DRCTemplate(minWidthRules[index], DRCTemplate.DRCMode.ALL.mode(), DRCTemplate.DRCRuleType.MINWID, 0, 0, null, null, dist, -1)); } case MINAREA: { double[] dist = {minArea[index]}; // autoboxing if (dist[0] < 0) return null; return (new DRCTemplate(minAreaRules[index], DRCTemplate.DRCMode.ALL.mode(), DRCTemplate.DRCRuleType.MINAREA, 0, 0, null, null, dist, -1)); } case SLOTSIZE: { double[] dist = {slotSize[index]}; // autoboxing if (dist[0] < 0) return null; return (new DRCTemplate(slotSizeRules[index], DRCTemplate.DRCMode.ALL.mode(), DRCTemplate.DRCRuleType.SLOTSIZE, 0, 0, null, null, dist, -1)); } } return null; } /** * Method to retrieve simple layer or node rules * @param index the index of the layer or node * @param type the rule type. * @return the requested rule. */ public DRCTemplate getRule(int index, DRCTemplate.DRCRuleType type) { switch(type) { case MINWID: double[] minSize = {minWidth[index], minWidth[index]}; // autoboxing if (minSize[0] < 0) return null; return (new DRCTemplate(minWidthRules[index], DRCTemplate.DRCMode.ALL.mode(), type, 0, 0, null, null, minSize, -1)); case UCONSPA2D: double[] cutSpa = {cutNodeSpa1D[index]}; // autoboxing if (cutSpa[0] < 0) return null; return (new DRCTemplate(cutNodeSpa1DRules[index], DRCTemplate.DRCMode.ALL.mode(), type, 0, 0, null, null, cutSpa, -1)); } return null; } /** * Method to retrieve specific rules stored per node that involve two layers * @param index the combined index of the two layers involved * @param type * @param nodeName name of the primitive * @return null */ public DRCTemplate getRule(int index, DRCTemplate.DRCRuleType type, String nodeName) { new Error("not implemented"); return null; } /** * Method to set the minimum <type> rule for a Layer * where <type> is the rule type. E.g. MinWidth or Area * @param layer the Layer to examine. * @param name the rule name * @param value the new rule value * @param type rule type */ public void setMinValue(Layer layer, String name, double value, DRCTemplate.DRCRuleType type) { int index = layer.getIndex(); if (value <= 0) value = MOSNORULE; switch (type) { case MINWID: minWidth[index] = (value); // autoboxing minWidthRules[index] = name; break; case MINAREA: minArea[index] = (value); // autoboxing minAreaRules[index] = name; break; default: System.out.println("Not implemented for " + type + " in MOSRules.setMinValue"); } } /** * Method to apply overrides to a set of rules. * @param override the override string. * @param tech the Technology in which these rules live. */ public void applyDRCOverrides(String override, Technology tech) { int pos = 0; int len = override.length(); while (pos < len) { int startKey = pos; int endKey = override.indexOf(':', startKey); if (endKey < 0) break; String key = override.substring(startKey, endKey); if (key.equals("c") || key.equals("cr") || key.equals("u") || key.equals("ur") || key.equals("cw") || key.equals("cwr") || key.equals("uw") || key.equals("uwr") || key.equals("cm") || key.equals("cmr") || key.equals("um") || key.equals("umr") || key.equals("e") || key.equals("er")) { startKey = endKey + 1; Layer layer1 = Technology.getLayerFromOverride(override, startKey, '/', tech); if (layer1 == null) break; startKey = override.indexOf('/', startKey); if (startKey < 0) break; Layer layer2 = Technology.getLayerFromOverride(override, startKey+1, '=', tech); if (layer2 == null) break; startKey = override.indexOf('=', startKey); if (startKey < 0) break; endKey = override.indexOf(';', startKey); if (endKey < 0) break; String newValue = override.substring(startKey+1, endKey); int index = getRuleIndex(layer1.getIndex(), layer2.getIndex()); if (key.equals("c")) { conList[index] = TextUtils.atof(newValue); } else if (key.equals("cr")) { conListRules[index] = newValue; } else if (key.equals("u")) { unConList[index] = TextUtils.atof(newValue); } else if (key.equals("ur")) { unConListRules[index] = newValue; } else if (key.equals("cw")) { conListWide[index] = TextUtils.atof(newValue); } else if (key.equals("cwr")) { conListWideRules[index] = newValue; } else if (key.equals("uw")) { unConListWide[index] = TextUtils.atof(newValue); } else if (key.equals("uwr")) { unConListWideRules[index] = newValue; } else if (key.equals("cm")) { conListMulti[index] = TextUtils.atof(newValue); } else if (key.equals("cmr")) { conListMultiRules[index] = newValue; } else if (key.equals("um")) { unConListMulti[index] = TextUtils.atof(newValue); } else if (key.equals("umr")) { unConListMultiRules[index] = newValue; } else if (key.equals("e")) { edgeList[index] = TextUtils.atof(newValue); } else if (key.equals("er")) { edgeListRules[index] = newValue; } pos = endKey + 1; continue; } if (key.equals("m") || key.equals("mr")) { startKey = endKey + 1; Layer layer = Technology.getLayerFromOverride(override, startKey, '=', tech); if (layer == null) break; startKey = override.indexOf('=', startKey); if (startKey < 0) break; endKey = override.indexOf(';', startKey); if (endKey < 0) break; String newValue = override.substring(startKey+1, endKey); int index = layer.getIndex(); if (key.equals("m")) { minWidth[index] = TextUtils.atof(newValue); } else if (key.equals("mr")) { minWidthRules[index] = newValue; } pos = endKey + 1; continue; } if (key.equals("n") || key.equals("nr")) { startKey = endKey + 1; int endPos = override.indexOf('=', startKey); if (endPos < 0) break; String nodeName = override.substring(startKey, endPos); PrimitiveNode np = tech.findNodeProto(nodeName); if (np == null) break; int index = 0; for(Iterator<PrimitiveNode> it = tech.getNodes(); it.hasNext(); ) { PrimitiveNode oNp = it.next(); if (oNp == np) break; index++; } if (key.equals("n")) { startKey = override.indexOf('=', startKey); if (startKey < 0) break; endKey = override.indexOf('/', startKey); if (endKey < 0) break; String newValue1 = override.substring(startKey+1, endKey); int otherEndKey = override.indexOf(';', startKey); if (otherEndKey < 0) break; String newValue2 = override.substring(endKey+1, otherEndKey); minNodeSize[index*2] = TextUtils.atof(newValue1); minNodeSize[index*2+1] = TextUtils.atof(newValue2); } else if (key.equals("nr")) { startKey = override.indexOf('=', startKey); if (startKey < 0) break; endKey = override.indexOf(';', startKey); if (endKey < 0) break; minNodeSizeRules[index] = override.substring(startKey+1, endKey); } pos = endKey + 1; continue; } if (key.equals("w")) { startKey = endKey + 1; endKey = override.indexOf(';', startKey); if (endKey < 0) break; String newValue = override.substring(startKey, endKey); wideLimit = TextUtils.atof(newValue); pos = endKey + 1; continue; } // Skip this format endKey = override.indexOf(';', startKey); pos = endKey + 1; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -