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

📄 mosrules.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
	}    /**	 * Method to find the maximum design-rule distance around a layer.	 * @param layer the Layer to examine.	 * @return the maximum design-rule distance around the layer. -1 if nothing found.	 */	public double getMaxSurround(Layer layer, double maxSize)	{		double worstLayerRule = -1;		int layerIndex = layer.getIndex();		int tot = tech.getNumLayers();	    double wide = wideLimit;		for(int i=0; i<tot; i++)		{			int pIndex = getRuleIndex(layerIndex, i);			double dist = unConList[pIndex];			if (dist > worstLayerRule) worstLayerRule = dist;			if (maxSize > wide)			{				dist = unConListWide[pIndex];				if (dist > worstLayerRule) worstLayerRule = dist;			}		}		return worstLayerRule;	}        /**     * Method to find all rules of specified type associated to Layer layer1     * @param layer1 layer     * @param type rule type     * @return all rules of specified type associated to Layer layer1     */    public List<DRCTemplate> getRules(Layer layer1, DRCTemplate.DRCRuleType type)    {        return null; // not available for CMOS    }    /**	 * Method to find the extension rule between two layer.	 * @param layer1 the first layer.     * @param layer2 the second layer.     * @param isGateExtension to decide between the rule EXTENSIONGATE or EXTENSION     * @return the extension rule between the layers.     * Returns null if there is no extension rule.	 */	public DRCTemplate getExtensionRule(Layer layer1, Layer layer2, boolean isGateExtension)	{		return null; //  not available for CMOS	}    /**	 * Method to find the edge spacing rule between two layer.	 * @param layer1 the first layer.     * @param layer2 the second layer.     * @return the edge rule distance between the layers.     * Returns null if there is no edge spacing rule.	 */	public DRCTemplate getEdgeRule(Layer layer1, Layer layer2)	{		int pIndex = getRuleIndex(layer1.getIndex(), layer2.getIndex());		double[] dist = {edgeList[pIndex]};		if (dist[0] < 0) return null;		return new DRCTemplate(edgeListRules[pIndex], DRCTemplate.DRCMode.ALL.mode(),                DRCTemplate.DRCRuleType.SPACINGE, 0, 0, null, null, dist, -1);	}     /**	 * Method to find the spacing rule between two layer.	 * @param layer1 the first layer.      * @param layer2 the second layer.      * @param connected true to find the distance when the layers are connected.      * @param multiCut 1 to find the distance when this is part of a multicut contact.      * @param wideS widest polygon      * @param length length of the intersection      * @return the spacing rule between the layers.      * Returns null if there is no spacing rule.	 */	public DRCTemplate getSpacingRule(Layer layer1, Geometric geo1,                                      Layer layer2, Geometric geo2, boolean connected,                                      int multiCut, double wideS, double length)	{		int pIndex = getRuleIndex(layer1.getIndex(), layer2.getIndex());        String n1 = DRCTemplate.getSpacingCombinedName(layer1, geo1);        String n2 = DRCTemplate.getSpacingCombinedName(layer2, geo2);		double[] bestDist = {-1};		String rule = null;        if (connected)        {            double dist = conList[pIndex];            boolean validName = true;            if (conListNodes[pIndex] != null &&                    (!n1.equals(conListNodes[pIndex]) && !n2.equals(conListNodes[pIndex])))                validName = false;            if (validName && dist >= 0) { bestDist[0] = dist;   rule = conListRules[pIndex]; }        } else        {            double dist = unConList[pIndex];  // autoboxing            boolean validName = true;            if (unConListNodes[pIndex] != null &&                    (!n1.equals(unConListNodes[pIndex]) && !n2.equals(unConListNodes[pIndex])))                validName = false;            if (validName && dist >= 0) { bestDist[0] = dist;   rule = unConListRules[pIndex]; }         }		if (wideS > wideLimit)  // autoboxing		{			if (connected)			{				double dist = conListWide[pIndex]; // autoboxing				if (dist >= 0) { bestDist[0] = dist;   rule = conListWideRules[pIndex]; }			} else			{				double dist = unConListWide[pIndex]; // autoboxing				if (dist >= 0) { bestDist[0] = dist;   rule = unConListWideRules[pIndex]; }			}		}		if (multiCut == 1)		{			if (connected)			{				double dist = conListMulti[pIndex]; // autoboxing				if (dist >= 0) { bestDist[0] = dist;   rule = conListMultiRules[pIndex]; }			} else			{				double dist = unConListMulti[pIndex]; // autoboxing				if (dist >= 0) { bestDist[0] = dist;   rule = unConListMultiRules[pIndex]; }			}		}		if (bestDist[0] < 0) return null;		return new DRCTemplate(rule, DRCTemplate.DRCMode.ALL.mode(),                DRCTemplate.DRCRuleType.SPACING, 0, 0, bestDist, multiCut);	}    /**     * Method to tell whether there are any design rules between two layers.     * @param layer1 the first Layer to check.     * @param layer2 the second Layer to check.     * @return true if there are design rules between the layers.     */    public boolean isAnySpacingRule(Layer layer1, Layer layer2)    {        int pIndex = getRuleIndex(layer1.getIndex(), layer2.getIndex());        if (conList[pIndex] >= 0) return true;        if (unConList[pIndex] >= 0) return true;        if (conListWide[pIndex] >= 0) return true;        if (unConListWide[pIndex] >= 0) return true;        if (conListMulti[pIndex] >= 0) return true;        if (unConListMulti[pIndex] >= 0) return true;        if (edgeList[pIndex] >= 0) return true;        return false;    }    /**     * Method to tell UI if multiple wide rules are allowed.     * @param index the index in the upper-diagonal table of layers.     * @return true if multiple wide rules are allowed.     */    public boolean doesAllowMultipleWideRules(int index)    {        return (unConListWide[index] == MOSNORULE);    }	/**	 * Method to retrieve total number of rules stored.	 */	public int getNumberOfRules()	{		return numberOfRules;	}    /**     * To retrieve those nodes that have rules.     * @return an array of nodes that have rules.     */    public String[] getNodesWithRules() {return nodeNames;}    public void addRule(int index, DRCTemplate rule)    {        new Error("Not implemented");    }    /**	 * Method to add a rule based on template     @param index      * @param rule     * @param wideRules     */	public void addRule(int index, DRCTemplate rule, DRCTemplate.DRCRuleType spacingCase, boolean wideRules)	{        if (rule.ruleType == DRCTemplate.DRCRuleType.NODSIZ)            setMinNodeSize(index, rule.ruleName, rule.getValue(0), rule.getValue(1));        else        {//            if (rule.value1 <= 0) rule.value1 = MOSNORULE;            switch (rule.ruleType)            {                case CONSPA: // Connected                {                    switch (spacingCase)                    {                        case SPACING:                        {                            if (!wideRules)                            {                                conList[index] = (rule.getValue(0)); // autoboxing                                conListRules[index] = rule.ruleName;                                if (rule.maxWidth > 0) wideLimit = (rule.maxWidth); // autoboxing                            }                            else                            {                                conListWide[index] = (rule.getValue(0)); // autoboxing                                conListWideRules[index] = rule.ruleName;                                if (rule.maxWidth > 0) wideLimit = (rule.maxWidth);                            }                        }                            break;                        case UCONSPA2D:                            conListMulti[index] = (rule.getValue(0)); // autoboxing                            conListMultiRules[index] = rule.ruleName;                            break;                        case SPACINGE: // edge rules                            edgeList[index] = (rule.getValue(0)); // autoboxing                            edgeListRules[index] = rule.ruleName;                            break;                         default:                            System.out.println("Error in MOSRules.setSpacingRules");                    }                }                break;                case UCONSPA: // Connected                {                    switch (spacingCase)                    {                        case SPACING:                        {                            if (!wideRules)                            {                                unConList[index] = (rule.getValue(0)); // autoboxing                                unConListRules[index] = rule.ruleName;                                if (rule.maxWidth > 0) wideLimit = (rule.maxWidth);// autoboxing                            }                            else                            {                                unConListWide[index] = (rule.getValue(0)); // autoboxing                                unConListWideRules[index] = rule.ruleName;                                if (rule.maxWidth > 0) wideLimit = (rule.maxWidth);// autoboxing                            }                            break;                        }                        case UCONSPA2D:                            unConListMulti[index] = (rule.getValue(0)); // autoboxing                            unConListMultiRules[index] = rule.ruleName;                            break;                        default:                            System.out.println("Error in MOSRules.setSpacingRules");                    }                }                break;                default:                    System.out.println("Error in MOSRules.setSpacingRules");            }        }    }    /**     * Method to delete a given spacing rule     * @param index     * @param rule     */    public void deleteRule(int index, DRCTemplate rule)    {        // Reset the actual value        conListWide[index] = new Double(MOSNORULE);        conListWideRules[index] = "";		unConListWide[index] = new Double(MOSNORULE);        unConListWideRules[index] = "";    }    /**     *     * @param index     * @param newRules     * @param spacingCase SPACING for normal case, SPACINGW for wide case, CUTSPA for multi cuts     * @param wideRules     */    public void setSpacingRules(int index, List<DRCTemplate> newRules, DRCTemplate.DRCRuleType spacingCase, boolean wideRules)    {        for (DRCTemplate rule : newRules)        {            addRule(index, rule, spacingCase, false);        }    }    /**     * Method to retrieve different spacing rules depending on type.     * @param index the index of the layer being queried.     * @param type SPACING (normal values), SPACINGW (wide values),     * SPACINGE (edge values) and CUTSPA (multi cuts).     * @param wideRules     * @return list of rules subdivided in UCONSPA and CONSPA     */    public List<DRCTemplate> getSpacingRules(int index, DRCTemplate.DRCRuleType type, boolean wideRules)    {        List<DRCTemplate> list = new ArrayList<DRCTemplate>(2);		// SMR changed the four lines listed below...widelimit should appear in the SPACINGW rule, not the SPACING rule        switch (type)        {            case SPACING: // normal rules            {                if (!wideRules)                {                    double[] dist = {conList[index]};  // autoboxing                    if (dist[0] >= 0)                        list.add(new DRCTemplate(conListRules[index], DRCTemplate.DRCMode.ALL.mode(),                                DRCTemplate.DRCRuleType.CONSPA,                                0, 0, null, null, dist, -1));                    dist[0] = unConList[index];  // autoboxing                    if (dist[0] >= 0)                        list.add(new DRCTemplate(unConListRules[index], DRCTemplate.DRCMode.ALL.mode(),                                DRCTemplate.DRCRuleType.UCONSPA,                                0, 0, null, null, dist, -1));                }                else                {                    double[] dist = {conListWide[index]};  // autoboxing                    if (dist[0] >= 0)                        list.add(new DRCTemplate(conListWideRules[index], DRCTemplate.DRCMode.ALL.mode(),

⌨️ 快捷键说明

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