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.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(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)
          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)
           
static int getActiveBits(Technology tech)
           
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 DRC.DRCCheckLogging getErrorLoggingType()
          Method to retrieve logging type in DRC The default is "DRC_LOG_PER_CELL".
static DRC.DRCCheckMode getErrorType()
          Method to retrieve checking level in DRC.
static DRCTemplate getExtensionRule(Layer layer1, Layer layer2, boolean isGateExtension)
          Method to find the extension rule between two layer.
static DRC.DRCCheckLogging getFactoryErrorLoggingType()
          Method to retrieve logging type in DRC, by default.
static DRC.DRCCheckMode getFactoryErrorType()
          Method to retrieve checking level in DRC, by default.
static DRC.DRCCheckMinArea getFactoryMinAreaAlgoOption()
          Method to tell which min area algorithm to use, by default.
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 DRC.DRCCheckMinArea getMinAreaAlgoOption()
          Method to tell which min area algorithm to use.
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 boolean isDatesStoredInMemory()
          Method to tell whether DRC dates should be stored in memory or not.
static boolean isFactoryDatesStoredInMemory()
          Method to tell whether DRC dates should be stored in memory or not, by default.
static boolean isFactoryIgnoreAreaChecking()
          Method to tell whether DRC should ignore minimum/enclosed area checking, by default.
static boolean isFactoryIgnoreCenterCuts()
          Method to tell whether DRC should ignore center cuts in large contacts, by default.
static boolean isFactoryIgnoreExtensionRuleChecking()
          Method to tell whether DRC should check extension rules, by default.
static boolean isFactoryIncrementalDRCOn()
          Method to tell whether DRC should be done incrementally, by default.
static boolean isFactoryInteractiveDRCDragOn()
          Method to tell whether DRC violations should be shown while nodes and arcs are dragged, by default.
static boolean isFactoryInteractiveLoggingOn()
          Method to tell whether DRC loggers should be displayed in Explorer immediately, by default.
static boolean isFactoryMultiThreaded()
          Method to tell whether DRC should run in a single thread or multi-threaded, by default.
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 boolean isIgnoreAreaChecking()
          Method to tell whether DRC should ignore minimum/enclosed area checking.
static boolean isIgnoreCenterCuts()
          Method to tell whether DRC should ignore center cuts in large contacts.
static boolean isIgnoreExtensionRuleChecking()
          Method to tell whether DRC should check extension rules.
static boolean isIncrementalDRCOn()
          Method to tell whether DRC should be done incrementally.
static boolean isInteractiveDRCDragOn()
          Method to tell whether DRC violations should be shown while nodes and arcs are dragged.
static boolean isInteractiveLoggingOn()
          Method to tell whether DRC loggers should be displayed in Explorer immediately The default is "false".
static boolean isMultiThreaded()
          Method to tell whether DRC should run in a single thread or multi-threaded.
static void resetDRCDates(boolean startJob)
          Method to delete all cached date information on all cells.
static void setDatesStoredInMemory(boolean on)
          Method to set whether DRC dates should be stored in memory or not.
static void setErrorLoggingType(DRC.DRCCheckLogging type)
          Method to set DRC logging type.
static void setErrorType(DRC.DRCCheckMode type)
          Method to set DRC error type.
static void setIgnoreAreaChecking(boolean on)
          Method to set whether DRC should ignore minimum/enclosed area checking.
static void setIgnoreCenterCuts(boolean on)
          Method to set whether DRC should ignore center cuts in large contacts.
static void setIgnoreExtensionRuleChecking(boolean on)
          Method to set whether DRC should check extension rules.
static void setIncrementalDRCOn(boolean on)
          Method to set whether DRC should be done incrementally.
static void setInteractiveDRCDragOn(boolean on)
          Method to set whether DRC violations should be shown while nodes and arcs are dragged.
static void setInteractiveLogging(boolean on)
          Method to set whether DRC loggers should be displayed in Explorer immediately or not
static void setMinAreaAlgoOption(DRC.DRCCheckMinArea mode)
          Method to set which min area algorithm to use.
static void setMultiThreaded(boolean mode)
          Method to set whether DRC should run in a single thread or multi-threaded.
static void setRules(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, getDiskSettings, getIndex, getListeners, getName, getNumTools, getProjectSettings, getSetting, getTools, initAllTools, initProjectSettings, isAnalysis, isBackground, isFixErrors, isIncremental, isOn, isSynthesis, makeBooleanSetting, makeDoubleSetting, makeIntSetting, makeLongSetting, makeStringSetting, 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(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(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)
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)

getActiveBits

public static int getActiveBits(Technology tech)

isIncrementalDRCOn

public static boolean isIncrementalDRCOn()
Method to tell whether DRC should be done incrementally. The default is "false".

Returns:
true if DRC should be done incrementally.

setIncrementalDRCOn

public static void setIncrementalDRCOn(boolean on)
Method to set whether DRC should be done incrementally.

Parameters:
on - true if DRC should be done incrementally.

isFactoryIncrementalDRCOn

public static boolean isFactoryIncrementalDRCOn()
Method to tell whether DRC should be done incrementally, by default.

Returns:
true if DRC should be done incrementally, by default.

isInteractiveDRCDragOn

public static boolean isInteractiveDRCDragOn()
Method to tell whether DRC violations should be shown while nodes and arcs are dragged. The default is "true".

Returns:
true if DRC violations should be shown while nodes and arcs are dragged.

setInteractiveDRCDragOn

public static void setInteractiveDRCDragOn(boolean on)
Method to set whether DRC violations should be shown while nodes and arcs are dragged.

Parameters:
on - true if DRC violations should be shown while nodes and arcs are dragged.

isFactoryInteractiveDRCDragOn

public static boolean isFactoryInteractiveDRCDragOn()
Method to tell whether DRC violations should be shown while nodes and arcs are dragged, by default.

Returns:
true if DRC violations should be shown while nodes and arcs are dragged, by default.

getErrorLoggingType

public static DRC.DRCCheckLogging getErrorLoggingType()
Method to retrieve logging type in DRC The default is "DRC_LOG_PER_CELL".

Returns:
integer representing error type

setErrorLoggingType

public static void setErrorLoggingType(DRC.DRCCheckLogging type)
Method to set DRC logging type.

Parameters:
type - representing error logging mode.

getFactoryErrorLoggingType

public static DRC.DRCCheckLogging getFactoryErrorLoggingType()
Method to retrieve logging type in DRC, by default.

Returns:
integer representing error type, by default.

getErrorType

public static DRC.DRCCheckMode getErrorType()
Method to retrieve checking level in DRC. The default is "ERROR_CHECK_DEFAULT".

Returns:
integer representing error type.

setErrorType

public static void setErrorType(DRC.DRCCheckMode type)
Method to set DRC error type.

Parameters:
type - representing error level.

getFactoryErrorType

public static DRC.DRCCheckMode getFactoryErrorType()
Method to retrieve checking level in DRC, by default.

Returns:
integer representing error type, by default.

isIgnoreCenterCuts

public static boolean isIgnoreCenterCuts()
Method to tell whether DRC should ignore center cuts in large contacts. Only the perimeter of cuts will be checked. The default is "false".

Returns:
true if DRC should ignore center cuts in large contacts.

setIgnoreCenterCuts

public static void setIgnoreCenterCuts(boolean on)
Method to set whether DRC should ignore center cuts in large contacts. Only the perimeter of cuts will be checked.

Parameters:
on - true if DRC should ignore center cuts in large contacts.

isFactoryIgnoreCenterCuts

public static boolean isFactoryIgnoreCenterCuts()
Method to tell whether DRC should ignore center cuts in large contacts, by default. Only the perimeter of cuts will be checked.

Returns:
true if DRC should ignore center cuts in large contacts, by default.

isIgnoreAreaChecking

public static boolean isIgnoreAreaChecking()
Method to tell whether DRC should ignore minimum/enclosed area checking. The default is "false".

Returns:
true if DRC should ignore minimum/enclosed area checking.

setIgnoreAreaChecking

public static void setIgnoreAreaChecking(boolean on)
Method to set whether DRC should ignore minimum/enclosed area checking.

Parameters:
on - true if DRC should ignore minimum/enclosed area checking.

isFactoryIgnoreAreaChecking

public static boolean isFactoryIgnoreAreaChecking()
Method to tell whether DRC should ignore minimum/enclosed area checking, by default.

Returns:
true if DRC should ignore minimum/enclosed area checking, by default.

isIgnoreExtensionRuleChecking

public static boolean isIgnoreExtensionRuleChecking()
Method to tell whether DRC should check extension rules. The default is "false".

Returns:
true if DRC should check extension rules.

setIgnoreExtensionRuleChecking

public static void setIgnoreExtensionRuleChecking(boolean on)
Method to set whether DRC should check extension rules.

Parameters:
on - true if DRC should check extension rules.

isFactoryIgnoreExtensionRuleChecking

public static boolean isFactoryIgnoreExtensionRuleChecking()
Method to tell whether DRC should check extension rules, by default.

Returns:
true if DRC should check extension rules, by default.

isDatesStoredInMemory

public static boolean isDatesStoredInMemory()
Method to tell whether DRC dates should be stored in memory or not. The default is "false".

Returns:
true if DRC dates should be stored in memory or not.

setDatesStoredInMemory

public static void setDatesStoredInMemory(boolean on)
Method to set whether DRC dates should be stored in memory or not.

Parameters:
on - true if DRC dates should be stored in memory or not.

isFactoryDatesStoredInMemory

public static boolean isFactoryDatesStoredInMemory()
Method to tell whether DRC dates should be stored in memory or not, by default.

Returns:
true if DRC dates should be stored in memory or not, by default.

isInteractiveLoggingOn

public static boolean isInteractiveLoggingOn()
Method to tell whether DRC loggers should be displayed in Explorer immediately The default is "false".

Returns:
true if DRC loggers should be displayed in Explorer immediately or not.

setInteractiveLogging

public static void setInteractiveLogging(boolean on)
Method to set whether DRC loggers should be displayed in Explorer immediately or not

Parameters:
on - true if DRC loggers should be displayed in Explorer immediately.

isFactoryInteractiveLoggingOn

public static boolean isFactoryInteractiveLoggingOn()
Method to tell whether DRC loggers should be displayed in Explorer immediately, by default.

Returns:
true if DRC loggers should be displayed in Explorer immediately or not, by default.

getMinAreaAlgoOption

public static DRC.DRCCheckMinArea getMinAreaAlgoOption()
Method to tell which min area algorithm to use. The default is AREA_BASIC which is the brute force version

Returns:
true if DRC loggers should be displayed in Explorer immediately or not.

setMinAreaAlgoOption

public static void setMinAreaAlgoOption(DRC.DRCCheckMinArea mode)
Method to set which min area algorithm to use.

Parameters:
mode - DRCCheckMinArea type to set

getFactoryMinAreaAlgoOption

public static DRC.DRCCheckMinArea getFactoryMinAreaAlgoOption()
Method to tell which min area algorithm to use, by default.

Returns:
true if DRC loggers should be displayed in Explorer immediately or not, by default.

isMultiThreaded

public static boolean isMultiThreaded()
Method to tell whether DRC should run in a single thread or multi-threaded. The default is single-threaded.

Returns:
true if DRC run in a multi-threaded fashion.

setMultiThreaded

public static void setMultiThreaded(boolean mode)
Method to set whether DRC should run in a single thread or multi-threaded.

Parameters:
mode - True if it will run a multi-threaded version.

isFactoryMultiThreaded

public static boolean isFactoryMultiThreaded()
Method to tell whether DRC should run in a single thread or multi-threaded, by default.

Returns:
true if DRC run in a multi-threaded fashion, by default.

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