com.sun.electric.technology
Class XMLRules

java.lang.Object
  extended by com.sun.electric.technology.XMLRules
All Implemented Interfaces:
DRCRules, java.io.Serializable

public class XMLRules
extends java.lang.Object
implements DRCRules, java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
static class XMLRules.XMLRule
          Local class to store information
 
Field Summary
 java.util.HashMap<XMLRules.XMLRule,XMLRules.XMLRule>[] matrix
          Hash map to store rules per matrix index
 
Constructor Summary
XMLRules(Technology t)
           
 
Method Summary
 void addRule(int index, DRCTemplate rule)
          Method to add a rule based on template
 void addRule(int index, DRCTemplate rule, DRCTemplate.DRCRuleType spacingCase, boolean wideRules)
          OLD FUNCTION
 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 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 whose have rules
 int getNumberOfRules()
          Method to get total number of rules stored
 XMLRules.XMLRule getRule(int index, DRCTemplate.DRCRuleType type)
          Method to retrieve simple layer or node rules
 XMLRules.XMLRule getRule(int index, DRCTemplate.DRCRuleType type, java.lang.String nodeName)
          Method to retrieve specific SURROUND 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.
 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 spacingCase, boolean wideRules)
          Method to retrieve different spacing rules depending on spacingCase.
 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 loadDRCRules(Technology tech, Foundry foundry, DRCTemplate theRule, boolean pWellProcess)
           
 void resizeContactsWithActive(PrimitiveNode[] contacts, java.lang.String[] contactNames, boolean aligned, boolean buttedTop, boolean buttedRightLeft, boolean metal1XfromCenter)
          Common resize function for well and active contacts
 void resizeMetalContacts(PrimitiveNode[] contacts, int numMetals)
          Public method to resize metal contacts
 void resizePolyContact(PrimitiveNode contact)
          Common resize function for well and active contacts
 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)
           
 void setWideLimits(double[] values)
          To set wide limit for old techs // * @param values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matrix

public java.util.HashMap<XMLRules.XMLRule,XMLRules.XMLRule>[] matrix
Hash map to store rules per matrix index

Constructor Detail

XMLRules

public XMLRules(Technology t)
Method Detail

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. In this type of rules, the index starts after primitive nodes and single layers rules.

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.

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.

doesAllowMultipleWideRules

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

Specified by:
doesAllowMultipleWideRules in interface DRCRules
Parameters:
index -
Returns:
true if multiple wide riles are allowed.

getNumberOfRules

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

Specified by:
getNumberOfRules in interface DRCRules

getNodesWithRules

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

Specified by:
getNodesWithRules in interface DRCRules
Returns:
Array of Strings

getSpacingRules

public java.util.List<DRCTemplate> getSpacingRules(int index,
                                                   DRCTemplate.DRCRuleType spacingCase,
                                                   boolean wideRules)
Method to retrieve different spacing rules depending on spacingCase. Type can be SPACING (normal values), SPACINGW (wide values), SPACINGE (edge values) and CUTSPA (multi cuts)

Specified by:
getSpacingRules in interface DRCRules
Parameters:
index -
spacingCase -
wideRules -
Returns:
list of rules subdivided in UCONSPA and CONSPA

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 -

getRule

public XMLRules.XMLRule 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 XMLRules.XMLRule getRule(int index,
                                DRCTemplate.DRCRuleType type,
                                java.lang.String nodeName)
Method to retrieve specific SURROUND 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 - list containing the name of the primitive
Returns:
DRCTemplate containing the rule

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 width rule for the layer. Returns null if there is no minimum width rule.

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

setWideLimits

public void setWideLimits(double[] values)
To set wide limit for old techs // * @param values


deleteRule

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

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

addRule

public void addRule(int index,
                    DRCTemplate rule,
                    DRCTemplate.DRCRuleType spacingCase,
                    boolean wideRules)
OLD FUNCTION

Specified by:
addRule in interface DRCRules

addRule

public void addRule(int index,
                    DRCTemplate rule)
Method to add a rule based on template

Specified by:
addRule in interface DRCRules
Parameters:
index -
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 - true 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.

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.

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.

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 this is a forbidden node

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 - last metal to check if only metal values are requested
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.

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.

loadDRCRules

public void loadDRCRules(Technology tech,
                         Foundry foundry,
                         DRCTemplate theRule,
                         boolean pWellProcess)

resizeMetalContacts

public void resizeMetalContacts(PrimitiveNode[] contacts,
                                int numMetals)
Public method to resize metal contacts

Parameters:
contacts -
numMetals -

resizeContactsWithActive

public void resizeContactsWithActive(PrimitiveNode[] contacts,
                                     java.lang.String[] contactNames,
                                     boolean aligned,
                                     boolean buttedTop,
                                     boolean buttedRightLeft,
                                     boolean metal1XfromCenter)
Common resize function for well and active contacts

Parameters:
contacts - array of contacts to resize
contactNames - Different contact names for butted contacts so already defined rules can be used.
aligned -
buttedTop -
buttedRightLeft -

resizePolyContact

public void resizePolyContact(PrimitiveNode contact)
Common resize function for well and active contacts

Parameters:
contact - poly contact to resize