com.sun.electric.technology.technologies.utils
Class MOSRules

java.lang.Object
  extended by com.sun.electric.technology.technologies.utils.MOSRules
All Implemented Interfaces:
DRCRules

public class MOSRules
extends java.lang.Object
implements DRCRules

Class to define a complete set of design rules. Includes constructors for initializing the data from a technology.


Field Summary
 java.lang.Double[] conList
          minimum distances when connected
 java.lang.Double[] conListMulti
          minimum distances when connected (multi-cut)
 java.lang.String[] conListMultiRules
          minimum distance rules when connected (multi-cut)
 java.lang.String[] conListNodes
          minimum distance ruless when connected
 java.lang.String[] conListRules
          minimum distance ruless when connected
 java.lang.Double[] conListWide
          minimum distances when connected (wide)
 java.lang.String[] conListWideRules
          minimum distance rules when connected (wide)
 java.lang.Double[] cutNodeSize
          cut size in the technology
 java.lang.String[] cutNodeSizeRules
          cut size rules
 java.lang.Double[] cutNodeSpa1D
          cut 1D spacing in the technology
 java.lang.String[] cutNodeSpa1DRules
          cut 1D s[acing rules
 java.lang.Double[] cutNodeSpa2D
          cut 2D spacing in the technology
 java.lang.String[] cutNodeSpa2DRules
          cut 2D s[acing rules
 java.lang.Double[] cutNodeSurround
          cut surround in the technology
 java.lang.String[] cutNodeSurroundRules
          cut surround rules
 java.lang.Double[] edgeList
          minimum edge distances
 java.lang.String[] edgeListRules
          minimum edge distance rules
 java.lang.String[] layerNames
          names of layers
 java.lang.Double[] minArea
          minimum area rules
 java.lang.String[] minAreaRules
          minimum area rule names
 java.lang.Double[] minNodeSize
          minimim node size in the technology
 java.lang.String[] minNodeSizeRules
          minimim node size rules
 java.lang.Double[] minWidth
          minimum width of layers
 java.lang.String[] minWidthRules
          minimum width rules
 java.lang.String[] nodeNames
          names of nodes
 int numLayers
          number of layers in the technology
 int numNodes
          number of nodes in the technology
 java.lang.Double[] slotSize
          maximum slot size rules
 java.lang.String[] slotSizeRules
          maximum slot size rule names
 double transPolyOverhang
          poly overhang/surround along gate
 java.lang.Double[] unConList
          minimum distances when unconnected
 java.lang.Double[] unConListMulti
          minimum distances when unconnected (multi-cut)
 java.lang.String[] unConListMultiRules
          minimum distance rules when unconnected (multi-cut)
 java.lang.String[] unConListNodes
          minimum distance rules when unconnected
 java.lang.String[] unConListRules
          minimum distance rules when unconnected
 java.lang.Double[] unConListWide
          minimum distances when unconnected (wide)
 java.lang.String[] unConListWideRules
          minimum distance rules when unconnected (wide)
 int uTSize
          size of upper-triangle of layers
 java.lang.Double wideLimit
          width limit that triggers wide rules
 
Constructor Summary
MOSRules()
           
MOSRules(Technology t)
           
 
Method Summary
 void addRule(int index, DRCTemplate rule)
           
 void addRule(int index, DRCTemplate rule, DRCTemplate.DRCRuleType spacingCase, boolean wideRules)
          Method to add a rule based on template
 void applyDRCOverrides(java.lang.String override, Technology tech)
          Method to apply overrides to a set of rules.
 void deleteRule(int index, DRCTemplate rule)
          Method to delete a given spacing rule
 boolean doesAllowMultipleWideRules(int index)
          Method to tell UI if multiple wide rules are allowed.
 DRCTemplate getEdgeRule(Layer layer1, Layer layer2)
          Method to find the edge spacing rule between two layer.
 DRCTemplate getExtensionRule(Layer layer1, Layer layer2, boolean isGateExtension)
          Method to find the extension rule between two layer.
 double getMaxSurround(Layer layer, double maxSize)
          Method to find the maximum design-rule distance around a layer.
 DRCTemplate getMinNodeSize(int index, int when)
           
 DRCTemplate getMinValue(Layer layer, DRCTemplate.DRCRuleType type)
          Method to get the minimum rule for a Layer where is the rule type.
 java.lang.String[] getNodesWithRules()
          To retrieve those nodes that have rules.
 int getNumberOfRules()
          Method to retrieve total number of rules stored.
 double getPolyOverhang()
          Method to return overhang of poly in transistors along the gate
 DRCTemplate getRule(int index, DRCTemplate.DRCRuleType type)
          Method to retrieve simple layer or node rules
 DRCTemplate getRule(int index, DRCTemplate.DRCRuleType type, java.lang.String nodeName)
          Method to retrieve specific rules stored per node that involve two layers
 int getRuleIndex(int index1, int index2)
          Method to determine the index in the upper-left triangle array for two layers/nodes.
static int getRuleIndex(int index1, int index2, int numLayers)
          Method to determine the index in the upper-left triangle array for two layers/nodes.
 java.util.List<DRCTemplate> getRules(Layer layer1, DRCTemplate.DRCRuleType type)
          Method to find all rules of specified type associated to Layer layer1
 DRCTemplate getSpacingRule(Layer layer1, Geometric geo1, Layer layer2, Geometric geo2, boolean connected, int multiCut, double wideS, double length)
          Method to find the spacing rule between two layer.
 java.util.List<DRCTemplate> getSpacingRules(int index, DRCTemplate.DRCRuleType type, boolean wideRules)
          Method to retrieve different spacing rules depending on type.
 Technology getTechnology()
          Method to determine the technology associated with this rules set.
 double getWorstSpacingDistance(int lastMetal)
          Method to find the worst spacing distance in the design rules.
 boolean isAnySpacingRule(Layer layer1, Layer layer2)
          Method to tell whether there are any design rules between two layers.
 boolean isForbiddenNode(int nodeIndex, DRCTemplate.DRCRuleType type)
          Method to determine if given node is not allowed by foundry.
 void setMinValue(Layer layer, java.lang.String name, double value, DRCTemplate.DRCRuleType type)
          Method to set the minimum rule for a Layer where is the rule type.
 void setSpacingRules(int index, java.util.List<DRCTemplate> newRules, DRCTemplate.DRCRuleType spacingCase, boolean wideRules)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numLayers

public int numLayers
number of layers in the technology


uTSize

public int uTSize
size of upper-triangle of layers


wideLimit

public java.lang.Double wideLimit
width limit that triggers wide rules


layerNames

public java.lang.String[] layerNames
names of layers


minWidth

public java.lang.Double[] minWidth
minimum width of layers


minWidthRules

public java.lang.String[] minWidthRules
minimum width rules


conList

public java.lang.Double[] conList
minimum distances when connected


conListRules

public java.lang.String[] conListRules
minimum distance ruless when connected


conListNodes

public java.lang.String[] conListNodes
minimum distance ruless when connected


unConList

public java.lang.Double[] unConList
minimum distances when unconnected


unConListRules

public java.lang.String[] unConListRules
minimum distance rules when unconnected


unConListNodes

public java.lang.String[] unConListNodes
minimum distance rules when unconnected


conListWide

public java.lang.Double[] conListWide
minimum distances when connected (wide)


conListWideRules

public java.lang.String[] conListWideRules
minimum distance rules when connected (wide)


unConListWide

public java.lang.Double[] unConListWide
minimum distances when unconnected (wide)


unConListWideRules

public java.lang.String[] unConListWideRules
minimum distance rules when unconnected (wide)


conListMulti

public java.lang.Double[] conListMulti
minimum distances when connected (multi-cut)


conListMultiRules

public java.lang.String[] conListMultiRules
minimum distance rules when connected (multi-cut)


unConListMulti

public java.lang.Double[] unConListMulti
minimum distances when unconnected (multi-cut)


unConListMultiRules

public java.lang.String[] unConListMultiRules
minimum distance rules when unconnected (multi-cut)


edgeList

public java.lang.Double[] edgeList
minimum edge distances


edgeListRules

public java.lang.String[] edgeListRules
minimum edge distance rules


minArea

public java.lang.Double[] minArea
minimum area rules


minAreaRules

public java.lang.String[] minAreaRules
minimum area rule names


slotSize

public java.lang.Double[] slotSize
maximum slot size rules


slotSizeRules

public java.lang.String[] slotSizeRules
maximum slot size rule names


numNodes

public int numNodes
number of nodes in the technology


nodeNames

public java.lang.String[] nodeNames
names of nodes


minNodeSize

public java.lang.Double[] minNodeSize
minimim node size in the technology


minNodeSizeRules

public java.lang.String[] minNodeSizeRules
minimim node size rules


cutNodeSize

public java.lang.Double[] cutNodeSize
cut size in the technology


cutNodeSizeRules

public java.lang.String[] cutNodeSizeRules
cut size rules


cutNodeSpa1D

public java.lang.Double[] cutNodeSpa1D
cut 1D spacing in the technology


cutNodeSpa1DRules

public java.lang.String[] cutNodeSpa1DRules
cut 1D s[acing rules


cutNodeSpa2D

public java.lang.Double[] cutNodeSpa2D
cut 2D spacing in the technology


cutNodeSpa2DRules

public java.lang.String[] cutNodeSpa2DRules
cut 2D s[acing rules


cutNodeSurround

public java.lang.Double[] cutNodeSurround
cut surround in the technology


cutNodeSurroundRules

public java.lang.String[] cutNodeSurroundRules
cut surround rules


transPolyOverhang

public double transPolyOverhang
poly overhang/surround along gate

Constructor Detail

MOSRules

public MOSRules()

MOSRules

public MOSRules(Technology t)
Method Detail

getMinNodeSize

public DRCTemplate getMinNodeSize(int index,
                                  int when)
Parameters:
index - represents node, widths are stored in index*2 and height in index*2+j
when - represents the foundry being used
Returns:
a rule describing the minimum node size.

getTechnology

public Technology getTechnology()
Method to determine the technology associated with this rules set.

Specified by:
getTechnology in interface DRCRules
Returns:
the technology associated with this rules set.

getRuleIndex

public int getRuleIndex(int index1,
                        int index2)
Method to determine the index in the upper-left triangle array for two layers/nodes. This function assumes no rules for primitives nor single layers are stored.

Specified by:
getRuleIndex in interface DRCRules
Parameters:
index1 - the first layer/node index.
index2 - the second layer/node index.
Returns:
the index in the array that corresponds to these two layers/nodes.

getRuleIndex

public static int getRuleIndex(int index1,
                               int index2,
                               int numLayers)
Method to determine the index in the upper-left triangle array for two layers/nodes. This function assumes no rules for primitives nor single layers are stored.

Parameters:
index1 - the first layer/node index.
index2 - the second layer/node index.
numLayers - the number of layers
Returns:
the index in the array that corresponds to these two layers/nodes.

getPolyOverhang

public double getPolyOverhang()
Method to return overhang of poly in transistors along the gate

Returns:
the overhang of poly in transistors along the gate.

isForbiddenNode

public boolean isForbiddenNode(int nodeIndex,
                               DRCTemplate.DRCRuleType type)
Method to determine if given node is not allowed by foundry.

Specified by:
isForbiddenNode in interface DRCRules
Parameters:
nodeIndex - index of node in DRC rules map to examine.
type - rule type.
Returns:
true if given node is not allowed by foundry.

getWorstSpacingDistance

public double getWorstSpacingDistance(int lastMetal)
Method to find the worst spacing distance in the design rules. Finds the largest spacing rule in the Technology.

Specified by:
getWorstSpacingDistance in interface DRCRules
Parameters:
lastMetal -
Returns:
the largest spacing distance in the Technology. Zero if nothing found

getMaxSurround

public double getMaxSurround(Layer layer,
                             double maxSize)
Method to find the maximum design-rule distance around a layer.

Specified by:
getMaxSurround in interface DRCRules
Parameters:
layer - the Layer to examine.
Returns:
the maximum design-rule distance around the layer. -1 if nothing found.

getRules

public java.util.List<DRCTemplate> getRules(Layer layer1,
                                            DRCTemplate.DRCRuleType type)
Method to find all rules of specified type associated to Layer layer1

Specified by:
getRules in interface DRCRules
Parameters:
layer1 - layer
type - rule type
Returns:
all rules of specified type associated to Layer layer1

getExtensionRule

public DRCTemplate getExtensionRule(Layer layer1,
                                    Layer layer2,
                                    boolean isGateExtension)
Method to find the extension rule between two layer.

Specified by:
getExtensionRule in interface DRCRules
Parameters:
layer1 - the first layer.
layer2 - the second layer.
isGateExtension - to decide between the rule EXTENSIONGATE or EXTENSION
Returns:
the extension rule between the layers. Returns null if there is no extension rule.

getEdgeRule

public DRCTemplate getEdgeRule(Layer layer1,
                               Layer layer2)
Method to find the edge spacing rule between two layer.

Specified by:
getEdgeRule in interface DRCRules
Parameters:
layer1 - the first layer.
layer2 - the second layer.
Returns:
the edge rule distance between the layers. Returns null if there is no edge spacing rule.

getSpacingRule

public DRCTemplate getSpacingRule(Layer layer1,
                                  Geometric geo1,
                                  Layer layer2,
                                  Geometric geo2,
                                  boolean connected,
                                  int multiCut,
                                  double wideS,
                                  double length)
Method to find the spacing rule between two layer.

Specified by:
getSpacingRule in interface DRCRules
Parameters:
layer1 - the first layer.
layer2 - the second layer.
connected - true to find the distance when the layers are connected.
multiCut - 1 to find the distance when this is part of a multicut contact.
wideS - widest polygon
length - length of the intersection
Returns:
the spacing rule between the layers. Returns null if there is no spacing rule.

isAnySpacingRule

public boolean isAnySpacingRule(Layer layer1,
                                Layer layer2)
Method to tell whether there are any design rules between two layers.

Specified by:
isAnySpacingRule in interface DRCRules
Parameters:
layer1 - the first Layer to check.
layer2 - the second Layer to check.
Returns:
true if there are design rules between the layers.

doesAllowMultipleWideRules

public boolean doesAllowMultipleWideRules(int index)
Method to tell UI if multiple wide rules are allowed.

Specified by:
doesAllowMultipleWideRules in interface DRCRules
Parameters:
index - the index in the upper-diagonal table of layers.
Returns:
true if multiple wide rules are allowed.

getNumberOfRules

public int getNumberOfRules()
Method to retrieve total number of rules stored.

Specified by:
getNumberOfRules in interface DRCRules

getNodesWithRules

public java.lang.String[] getNodesWithRules()
To retrieve those nodes that have rules.

Specified by:
getNodesWithRules in interface DRCRules
Returns:
an array of nodes that have rules.

addRule

public void addRule(int index,
                    DRCTemplate rule)
Specified by:
addRule in interface DRCRules

addRule

public void addRule(int index,
                    DRCTemplate rule,
                    DRCTemplate.DRCRuleType spacingCase,
                    boolean wideRules)
Method to add a rule based on template

Specified by:
addRule in interface DRCRules
Parameters:
index -
rule -
wideRules -

deleteRule

public void deleteRule(int index,
                       DRCTemplate rule)
Method to delete a given spacing rule

Specified by:
deleteRule in interface DRCRules
Parameters:
index -
rule -

setSpacingRules

public void setSpacingRules(int index,
                            java.util.List<DRCTemplate> newRules,
                            DRCTemplate.DRCRuleType spacingCase,
                            boolean wideRules)
Specified by:
setSpacingRules in interface DRCRules
Parameters:
index -
newRules -
spacingCase - SPACING for normal case, SPACINGW for wide case, CUTSPA for multi cuts
wideRules -

getSpacingRules

public java.util.List<DRCTemplate> getSpacingRules(int index,
                                                   DRCTemplate.DRCRuleType type,
                                                   boolean wideRules)
Method to retrieve different spacing rules depending on type.

Specified by:
getSpacingRules in interface DRCRules
Parameters:
index - the index of the layer being queried.
type - SPACING (normal values), SPACINGW (wide values), SPACINGE (edge values) and CUTSPA (multi cuts).
wideRules -
Returns:
list of rules subdivided in UCONSPA and CONSPA

getMinValue

public DRCTemplate getMinValue(Layer layer,
                               DRCTemplate.DRCRuleType type)
Method to get the minimum rule for a Layer where is the rule type. E.g. MinWidth or Area

Specified by:
getMinValue in interface DRCRules
Parameters:
layer - the Layer to examine.
type - rule type
Returns:
the minimum rule for the layer. Returns null if there is no minimum width rule.

getRule

public DRCTemplate getRule(int index,
                           DRCTemplate.DRCRuleType type)
Method to retrieve simple layer or node rules

Specified by:
getRule in interface DRCRules
Parameters:
index - the index of the layer or node
type - the rule type.
Returns:
the requested rule.

getRule

public DRCTemplate getRule(int index,
                           DRCTemplate.DRCRuleType type,
                           java.lang.String nodeName)
Method to retrieve specific rules stored per node that involve two layers

Specified by:
getRule in interface DRCRules
Parameters:
index - the combined index of the two layers involved
type -
nodeName - name of the primitive
Returns:
null

setMinValue

public void setMinValue(Layer layer,
                        java.lang.String name,
                        double value,
                        DRCTemplate.DRCRuleType type)
Method to set the minimum rule for a Layer where is the rule type. E.g. MinWidth or Area

Specified by:
setMinValue in interface DRCRules
Parameters:
layer - the Layer to examine.
name - the rule name
value - the new rule value
type - rule type

applyDRCOverrides

public void applyDRCOverrides(java.lang.String override,
                              Technology tech)
Method to apply overrides to a set of rules.

Specified by:
applyDRCOverrides in interface DRCRules
Parameters:
override - the override string.
tech - the Technology in which these rules live.