com.sun.electric.tool.drc
Class DRC

java.lang.Object
  extended by com.sun.electric.tool.Tool
      extended by com.sun.electric.tool.Listener
          extended by com.sun.electric.tool.drc.DRC
All Implemented Interfaces:
Changes, java.lang.Comparable

public class DRC
extends Listener

This is the Design Rule Checker tool.


Nested Class Summary
static class DRC.CheckDRCJob
          Base class for checking design rules.
static class DRC.DRCCheckLogging
           
static class DRC.DRCCheckMinArea
           
static class DRC.DRCCheckMode
          Control different level of error checking
static class DRC.DRCErrorType
          QUICK DRC ERROR REPORTING
static class DRC.DRCPreferences
          OPTIONS
static class DRC.ReportInfo
           
 
Field Summary
protected static DRC tool
          the DRC tool.
 
Fields inherited from class com.sun.electric.tool.Tool
prefs
 
Method Summary
static void checkDRCHierarchically(DRC.DRCPreferences dp, Cell cell, java.util.List<Geometric> objs, java.awt.geom.Rectangle2D bounds, GeometryHandler.GHMode mode, boolean onlyArea)
          This method generates a DRC job from the GUI or for a bash script.
static void cleanCellsDueToFoundryChanges(Technology tech, Foundry f, DRC.DRCPreferences dp)
          Method to clean those cells that were marked with a valid date due to changes in the DRC rules.
static void createDRCErrorLogger(DRC.ReportInfo reportInfo, DRC.DRCErrorType errorType, java.lang.String msg, Cell cell, double limit, double actual, java.lang.String rule, PolyBase poly1, Geometric geom1, Layer layer1, PolyBase poly2, Geometric geom2, Layer layer2)
           
 void endBatch(Snapshot oldSnapshot, Snapshot newSnapshot, boolean undoRedo)
          Handles database changes of a Job.
static java.lang.String explainBits(int bits, DRC.DRCPreferences dp)
           
static int getActiveBits(Technology tech, DRC.DRCPreferences dp)
           
static ErrorLogger getDRCErrorLogger(boolean layout, boolean incremental, java.lang.String extraMsg)
          DRC INTERFACE
static ErrorLogger getDRCIncrementalLogger()
           
static DRC getDRCTool()
          Method to retrieve the singleton associated with the DRC tool.
static DRCTemplate getEdgeRule(Layer layer1, Layer layer2)
          Method to find the edge spacing rule between two layer.
static DRCTemplate getExtensionRule(Layer layer1, Layer layer2, boolean isGateExtension)
          Method to find the extension rule between two layer.
static java.util.Date getLastDRCDateBasedOnBits(Cell cell, boolean spacingCheck, int activeBits, boolean fromDisk)
          Method to tell the date of the last successful DRC of a given Cell.
static double getMaxSurround(Layer layer, double maxSize)
          Method to find the maximum design-rule distance around a layer.
static PrimitiveNode.NodeSizeRule getMinSize(NodeProto np)
          Method to get the minimum size rule for a NodeProto.
static DRCTemplate getMinValue(Layer layer, DRCTemplate.DRCRuleType type)
          Method to get the minimum rule for a Layer where is the rule type.
static java.util.List<DRCTemplate> getRules(Layer layer1, DRCTemplate.DRCRuleType type)
          Method to find all possible rules of DRCRuleType type associated a layer.
static DRCRules getRules(Technology tech)
          Method to build a Rules object that contains the current design rules for a Technology.
static 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.
static double getWorstSpacingDistance(Technology tech, int lastMetal)
          Method to find the worst spacing distance in the design rules.
 void init()
          Method to initialize the DRC tool.
static boolean isAnySpacingRule(Layer layer1, Layer layer2)
          Method to tell whether there are any design rules between two layers.
static boolean isCellDRCDateGood(Cell cell, java.util.Date date)
          Method to check if current date is later than cell revision
static DRCTemplate isForbiddenNode(DRCRules rules, int index1, int index2, DRCTemplate.DRCRuleType type)
           
static DRCTemplate isForbiddenNode(int index1, int index2, DRCTemplate.DRCRuleType type, Technology tech)
          Determine if node represented by index in DRC mapping table is forbidden under this foundry.
static void resetDRCDates(boolean startJob)
          Method to delete all cached date information on all cells.
static void setRules(DRC.DRCPreferences dp, Technology tech, DRCRules newRules)
          Method to load a full set of design rules for a Technology.
static boolean testAll()
          JUnit interface
 
Methods inherited from class com.sun.electric.tool.Listener
eraseLibrary, examineCell, killObject, modifyArcInst, modifyCell, modifyCellGroup, modifyExport, modifyLibrary, modifyNodeInst, newObject, readLibrary, renameObject, request, slice, startBatch, writeLibrary
 
Methods inherited from class com.sun.electric.tool.Tool
clearAnalysis, clearBackground, clearFixErrors, clearIncremental, clearOn, clearSynthesis, compareTo, findTool, getIndex, getListeners, getName, getNumTools, getProjectSettings, getTools, initAllTools, isAnalysis, isBackground, isFixErrors, isIncremental, isOn, isSynthesis, setAnalysis, setBackground, setFixErrors, setIncremental, setOn, setSynthesis, setVarInJob, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tool

protected static DRC tool
the DRC tool.

Method Detail

createDRCErrorLogger

public static void createDRCErrorLogger(DRC.ReportInfo reportInfo,
                                        DRC.DRCErrorType errorType,
                                        java.lang.String msg,
                                        Cell cell,
                                        double limit,
                                        double actual,
                                        java.lang.String rule,
                                        PolyBase poly1,
                                        Geometric geom1,
                                        Layer layer1,
                                        PolyBase poly2,
                                        Geometric geom2,
                                        Layer layer2)

init

public void init()
Method to initialize the DRC tool.

Specified by:
init in interface Changes
Overrides:
init in class Tool

getDRCTool

public static DRC getDRCTool()
Method to retrieve the singleton associated with the DRC tool.

Returns:
the DRC tool.

endBatch

public void endBatch(Snapshot oldSnapshot,
                     Snapshot newSnapshot,
                     boolean undoRedo)
Handles database changes of a Job.

Specified by:
endBatch in interface Changes
Specified by:
endBatch in class Listener
Parameters:
oldSnapshot - database snapshot before Job.
newSnapshot - database snapshot after Job and constraint propagation.
undoRedo - true if Job was Undo/Redo job.

getDRCErrorLogger

public static ErrorLogger getDRCErrorLogger(boolean layout,
                                            boolean incremental,
                                            java.lang.String extraMsg)
DRC INTERFACE


getDRCIncrementalLogger

public static ErrorLogger getDRCIncrementalLogger()

checkDRCHierarchically

public static void checkDRCHierarchically(DRC.DRCPreferences dp,
                                          Cell cell,
                                          java.util.List<Geometric> objs,
                                          java.awt.geom.Rectangle2D bounds,
                                          GeometryHandler.GHMode mode,
                                          boolean onlyArea)
This method generates a DRC job from the GUI or for a bash script.


getRules

public static DRCRules getRules(Technology tech)
Method to build a Rules object that contains the current design rules for a Technology. The DRC dialogs use this to hold the values while editing them. It also provides a cache for the design rule checker.

Parameters:
tech - the Technology to examine.
Returns:
a new Rules object with the design rules for the given Technology.

setRules

public static void setRules(DRC.DRCPreferences dp,
                            Technology tech,
                            DRCRules newRules)
Method to load a full set of design rules for a Technology.

Parameters:
tech - the Technology to load.
newRules - a complete design rules object.

getWorstSpacingDistance

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

Parameters:
tech - the Technology to examine.
lastMetal -
Returns:
the largest spacing distance in the Technology. Zero if nothing found

getMaxSurround

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

Parameters:
layer - the Layer to examine.
Returns:
the maximum design-rule distance around the layer. -1 if nothing found.

getEdgeRule

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

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 static 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.

Parameters:
layer1 - the first layer.
geo1 -
layer2 - the second layer.
geo2 -
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 static java.util.List<DRCTemplate> getRules(Layer layer1,
                                                   DRCTemplate.DRCRuleType type)
Method to find all possible rules of DRCRuleType type associated a layer.

Parameters:
layer1 - the layer whose rules are desired.
Returns:
a list of DRCTemplate objects associated with the layer.

getExtensionRule

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

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 static boolean isAnySpacingRule(Layer layer1,
                                       Layer layer2)
Method to tell whether there are any design rules between two layers.

Parameters:
layer1 - the first Layer to check.
layer2 - the second Layer to check.
Returns:
true if there are design rules between the layers.

getMinValue

public static 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

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.

isForbiddenNode

public static DRCTemplate isForbiddenNode(int index1,
                                          int index2,
                                          DRCTemplate.DRCRuleType type,
                                          Technology tech)
Determine if node represented by index in DRC mapping table is forbidden under this foundry.


isForbiddenNode

public static DRCTemplate isForbiddenNode(DRCRules rules,
                                          int index1,
                                          int index2,
                                          DRCTemplate.DRCRuleType type)

getMinSize

public static PrimitiveNode.NodeSizeRule getMinSize(NodeProto np)
Method to get the minimum size rule for a NodeProto.

Parameters:
np - the NodeProto to examine.
Returns:
the minimum size rule for the NodeProto. Returns null if there is no minimum size rule.

cleanCellsDueToFoundryChanges

public static void cleanCellsDueToFoundryChanges(Technology tech,
                                                 Foundry f,
                                                 DRC.DRCPreferences dp)
Method to clean those cells that were marked with a valid date due to changes in the DRC rules.

Parameters:
f -

isCellDRCDateGood

public static boolean isCellDRCDateGood(Cell cell,
                                        java.util.Date date)
Method to check if current date is later than cell revision

Parameters:
cell -
date -
Returns:
true if DRC date in cell is valid

getLastDRCDateBasedOnBits

public static java.util.Date getLastDRCDateBasedOnBits(Cell cell,
                                                       boolean spacingCheck,
                                                       int activeBits,
                                                       boolean fromDisk)
Method to tell the date of the last successful DRC of a given Cell.

Parameters:
cell - the cell to query.
fromDisk -
Returns:
the date of the last successful DRC of that Cell.

explainBits

public static java.lang.String explainBits(int bits,
                                           DRC.DRCPreferences dp)

getActiveBits

public static int getActiveBits(Technology tech,
                                DRC.DRCPreferences dp)

resetDRCDates

public static void resetDRCDates(boolean startJob)
Method to delete all cached date information on all cells.

Parameters:
startJob -

testAll

public static boolean testAll()
JUnit interface