Class Reference drc

A module with many design rule checks. More...

Member

void addViolation(string name,double value, point p1, point p2, int type=0,int status=0)
void addViolationGraphical(pointArray p)
void angle45OnLayer(int layer,bool mergeBefore=false)
void angle90OnLayer(int layer,bool mergeBefore=false)
void circleRadiusOnLayer(int min, int max, int layer)
void clearDRC()
void clearViolationView()
void densityOnLayer(int layer,int box, double min, double max)
void dimensionOnLayer(int lengthMin,int lengthMax,int widthMin,int widthMax, int layer, bool mergeBefore=false)
int error
int errorCount
int errorLayer
void exactDimensionOnLayer(int length,int width, int layer, bool mergeBefore=false)
void exactInside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)
string getReport()
string getViolationName(int index)
double getViolationValue(int index)
int getViolationStatus(int index)
int getViolationType(int index)
point getViolationPoint1(int index)
point getViolationPoint2(int index)
void inside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)
bool isCheckedList()
bool isCheckedGraphical()
void layerCombination(int layer1,int layer2, int layer3=-1,int layer4=-1, int layer5=-1)
void loadViolationList(string filename)
void maximizeViolationView()
void maximumAngleOnLayer(double anglevalue, int layer, bool mergeBefore=false)
void maximumAreaOnLayer(int layer, double areavalue ,bool mergeBefore=false)
void maximumDimensionOnLayer(int length,int width, int layer, bool mergeBefore=false)
void maximumDistance(int distance,int layer1, int layer2)
void maximumInaccessibilityOnLayer(int layer, int inaccessibility,bool mergeBefore=false)
void maximumInside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)
void maximumPerimeterOnLayer(int layer, int perimeter,bool mergeBefore=false)
void minimumAngleOnLayer(double anglevalue, int layer, bool mergeBefore=false)
void minimumAreaOnLayer(int layer, double areavalue ,bool mergeBefore=false)
void minimumDimensionOnLayer(int length,int width, int layer, bool mergeBefore=false)
void minimumDistance(int distance,int layer1, int layer2)
void minimumDistanceOrOverlap(int distance,int layer1, int layer2,bool mode=true)
void minimumEdgeLengthOnLayer(int edgeSize, int layer)
void minimumElementDistance(int distance,int layer,bool mergeBefore=false)
void minimumElementDistanceOnActiveLayer(int distance)
void minimumEnclosure(int distance,int layer1,int layer2)
void minimumInaccessibilityOnLayer(int layer, int inaccessibility ,bool mergeBefore=false)
void minimumInside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)
void minimumInsideOrOutside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)
void minimumNotchOnLayer(int notchsize, int layer, bool mergeBefore=false, bool testSlots=false)
void minimumOverlap(int overlap,int layer1, int layer2)
void minimumOverlapDistance(int distance,int layer1,int layer2)
void minimumPerimeterOnLayer(int layer, int perimetervalue ,bool mergeBefore=false)
void minimumSize(int size,int layer, bool mergeBefore=false, bool sharpAngles=true)
void noBoxOnActiveLayer()
void noBoxOnLayer(int layer)
void noCircleOnActiveLayer()
void noCircleOnLayer(int layer)
void noElementOnActiveLayer()
void noElementOnLayer(int layer)
void noHolesOnLayer(int layer,bool mergeBefore=false)
void noPathOnActiveLayer()
void noPathOnLayer(int layer)
void noPolygonOnActiveLayer()
void noPolygonOnLayer(int layer)
void noSelfintersectionOnActiveLayer()
void noSelfintersectionOnLayer(int layer)
void noSpikesOnLayer(int layer,bool sharpAngles=false)
void noTextOnActiveLayer()
void noTextOnLayer(int layer)
void noZeroWidthOnLayer(int layer)
void noZeroWidthOnActiveLayer()
void onGrid(int grid,int layer)
void onlyCircleOnActiveLayer()
void onlyCircleOnLayer(int layer)
void onlyRectangleOnActiveLayer()
void onlyRectangleOnLayer(int layer)
void overlapingElements(int layer)
void overlapingElementsOnActiveLayer()
void removeNoDrcViolations(int layer)
string result
string ruleName
void saveViolationList(string filename)
void setCheckCell()
void setCheckRegion(point min, point max)
void setCheckView()
void setErrorLayerToActiveLayer()
void setGraphical(bool)
void setList(bool)
void setRegionMode()
void showReport()
void widthDependentDistance(int distance,int width,int layer,bool mergeBefore=false)

Detailed Description

graph LR la(layout)--drcTool-->ba(drc) click la "/layoutscript/api/layout" click bo "/layoutscript/api/booleanhandler" click br "/layoutscript/api/barcodemodule" click ba "/layoutscript/api/drc" click drc "/layoutscript/api/drc" click dr "/layoutscript/api/drawingfield" classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; class ba thisClas class cl,la,dr,el,ne,bo,br,drc clas

This class allows the access to the design rule checker. For each rule available in the graphical user interface, there is a corresponding method in this class. Please see Design Rule Checker documentation for a more detailed description of the checks. Also the reporting of violations and the drc region can be setup by using this class.

For a complete DRC a plenty of rules are required. For a complete DRC in one step please create a macro with all your rules. There you can also give each rule an individual name. This macro gives an example. It is also included in the example macros.

#!/usr/bin/layout
#name=Macro: drc example.layout
#help=example for a drc macro

int main(){

layout->drcTool->result="DRC (LayoutEditor example) \r\n";

// setup error layer
layout->drawing->activeLayer=0;
layout->drcTool->setErrorLayerToActiveLayer();

// check for layer metal 1
layout->drcTool->ruleName= "Minimum Size Metal1";
layout->drcTool->minimumSize(800,6,true);
layout->drcTool->ruleName= "Minimum Distance Metal1";
layout->drcTool->minimumElementDistance(800,6,true);

// check for layer metal 2
layout->drcTool->ruleName= "Minimum Size Metal2";
layout->drcTool->minimumSize(900,8,true);
layout->drcTool->ruleName= "Minimum Distance Metal2";
layout->drcTool->minimumElementDistance(900,8,true);

// check for via1 (metal1 to metal2)
layout->drcTool->ruleName= "Via in metal1";
layout->drcTool->inside(50,7,6);
layout->drcTool->ruleName= "Via in metal2";
layout->drcTool->inside(60,7,8);

layout->drcTool->showReport();

}

See also: DesignRuleChecker

Member Function Documentation


void drc::addViolation(string name,double value, point p1, point p2, int type=0,int status=0)

Add a drc violation to the list of detected violations. This feature can be used to create own drc checks or importing results of external drc checks. Please see getViolationType for a list of supported types.

See also: getViolationType()


void drc::addViolationGraphical(pointArray p)

Adds a violation graphical in the same way it is done with internal checks. (introduced with release 20191212)

        // displays the DRC window
        layout->showToolBar("Design Rule Checker"); 
        pointArray pa; 
        pa.attach(40,50);
        pa.attach(40,70);
        pa.attach(90,50);

        // if graphical display is enabled, it display a polygon on the error layer
        if (layout->drcTool->isCheckedGraphical())
                   layout->drcTool->addViolationGraphical(pa); 

        // adds the violation to the violation list, if enabled in the user interface
        if (layout->drcTool->isCheckedList()) 
                   layout->drcTool->addViolation("rule 3.4",0,pa.minimum(),pa.maximum(),2);

void drc::angle45OnLayer(int layer,bool mergeBefore=false)

Tests for elements with non 45°angle to the axis.

See also: AngleCheck, DesignRuleChecker


void drc::angle90OnLayer(int layer,bool mergeBefore=false)

Tests for elements with non 90°angle to the axis.

See also: AngleCheck, DesignRuleChecker


void drc::circleRadiusOnLayer(int min, int max, int layer)

checkes all circles on the given layer on its radius. If min or max is zero, the minimum or maximum radius is not checked.

Parameter:
min minimum allowed radius
max maximal allowed radius
layer layer to be checked

See also: DesignRuleChecker


void drc::clearDRC()

all graphical DRC results in the current cell will be removed from the current design.


void drc::clearViolationView()

Clears the list of detected violations.


void drc::densityOnLayer(int layer,int box, double min, double max)

Check the densitiy of a single layer. min and max is the required density in procent. box is the rectangle size in which the density muss fit.

See also: DensityCheck, DesignRuleChecker


void drc::dimensionOnLayer(int lengthMin,int lengthMax,int widthMin,int widthMax, int layer, bool mergeBefore=false)

Tests, for element with axis dimension outside the specified range.


int drc::error

Number of errors on last check.


int drc::errorCount

Sum of detected errors.


int drc::errorLayer

On this layer all errors are marked.


void drc::exactDimensionOnLayer(int length,int width, int layer, bool mergeBefore=false)

Tests, for element with a different size than a specified value.

See also: DimensionCheck, DesignRuleChecker


void drc::exactInside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)

Tests, if all elements on insidelayer are inside in one of layer1 to layer3 and have a exact distance.

See also: Inside, DesignRuleChecker


string drc::getReport()

Returns: result, it is crop of all no errors if it is longer than 40 lines.


string drc::getViolationName(int index)

Returns: the rule name of the violation on position index.

Example violation readout:

debug->clear();
int typ=1;
int index=0;
string location="Positions of Error 0201\n";
while (typ>=0){
   string name=layout->drcTool->getViolationName(index).left(4);
   typ=layout->drcTool->getViolationType(index);
   if (name=="0201"){
      string s1,s2;
      point p=layout->drcTool->getViolationPoint1(index);
      s1.setNum(p.x()); s2.setNum(p.y());
      location+=s1+"/"+s2+"\n";
   }
   index++;
}
debug(location);
debug->show();

double drc::getViolationValue(int index)

Returns: the value of the violation on position index, 0 if the index does not exists.


int drc::getViolationStatus(int index)

Returns: the status of the violation on position index, -1 if the index does not exists.


int drc::getViolationType(int index)

Returns: the type of the violation on position index, -1 if the index does not exists.

Type: DRC:
1 MinimumSize
2 OverlappingElements
3 MinimumElementsDistance
4 MinimumNotches
5 NoHoles
6 DimensionCheck
7 AreaCheck
8 AngleCheck
9 PerimeterCheck
10 MinimumDistance
11 MinimumDistanceOrOverlap
12 Inside
13 Enclosure
14 MinimumOverlap
15 OverlapDistance
16 LayerCombination
17 OnGrid
18 OnlyCircle
19 NoElement
20 NoPath
21 NoBox
22 NoPolygon
23 NoText
24 NoCircle
25 Self-Intersection
26 DensityCheck
27 NoPathesWithSpikes
28 CircleDimension
29 OnlyRectangle
30 NoZeroWidth
31 Inaccessibility
32 MinimumEdgeLength

point drc::getViolationPoint1(int index)

Returns: the position1 of the violation on position index.


point drc::getViolationPoint2(int index)

Returns: the position2 of the violation on position index.


void drc::inside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)

Tests, if all elements on insidelayer are inside in one of layer1 to layer3 and have a minimum distance.

See also: Inside, DesignRuleChecker


bool drc::isCheckedList()

Returns: true, if the list illustration is enabled in the user interface (introduced with release 20191212)


bool drc::isCheckedGraphical()

Returns: true, if the graphical illustration is enabled in the user interface (introduced with release 20191212)


void drc::layerCombination(int layer1,int layer2, int layer3=-1,int layer4=-1, int layer5=-1)

Tests, if there exists regions on all layers.

See also: LayerCombination, DesignRuleChecker


void drc::loadViolationList(string filename)

Load a list of violations into the user interface.


void drc::maximizeViolationView()

displays the violation list in full height of the toolbar, checks and setup buttons will get invisible. (introduced with release 20200503)


void drc::maximumAngleOnLayer(double anglevalue, int layer, bool mergeBefore=false)

Tests for elements with angle bigger anglevalue on layer.

See also: AngleCheck, DesignRuleChecker


void drc::maximumAreaOnLayer(int layer, double areavalue ,bool mergeBefore=false)

Tests for elements with an area bigger than areavalue on layer.

See also: AreaCheck, DesignRuleChecker


void drc::maximumDimensionOnLayer(int length,int width, int layer, bool mergeBefore=false)

Tests, for element with axis dimension bigger a specified value.

See also: DimensionCheck, DesignRuleChecker


void drc::maximumDistance(int distance,int layer1, int layer2)

It is checked, if any shape on layer1 has a shape on layer2 next it with a distance less than distance.

See also: MinimumDistance, DesignRuleChecker


void drc::maximumInaccessibilityOnLayer(int layer, int inaccessibility,bool mergeBefore=false)

wil check the most remote inner point of any shape. If it is located more far away from any edge as the entered value a violation is triggered.

See also: InaccessibilityCheck, DesignRuleChecker


void drc::maximumInside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)

Tests, if all elements on insidelayer are inside in one of layer1 to layer3 and have a maximum distance.

See also: Inside, DesignRuleChecker


void drc::maximumPerimeterOnLayer(int layer, int perimeter,bool mergeBefore=false)

Tests for perimeter bigger than perimetervalue on layer.

See also: PerimeterCheck, DesignRuleChecker


void drc::minimumAngleOnLayer(double anglevalue, int layer, bool mergeBefore=false)

Tests for elements with angle smaller anglevalue on layer. anglevalue must be a negative value. So it is a test for obtuse angles. With an check value of 0 a check for convext polygons is performed. (introduced with release 20191206)

See also: AngleCheck, DesignRuleChecker


void drc::minimumAreaOnLayer(int layer, double areavalue ,bool mergeBefore=false)

Tests for elements with an area smaller than areavalue on layer.

See also: AreaCheck, DesignRuleChecker


void drc::minimumDimensionOnLayer(int length,int width, int layer, bool mergeBefore=false)

Tests, for element with axis dimension smaller a specified value.

See also: DimensionCheck, DesignRuleChecker


void drc::minimumDistance(int distance,int layer1, int layer2)

Tests, if all elements between layer1 and layer2 have a minimum distance

See also: maximumDistance(), [MinimumDistance]((/layout/design-rule-checker/multi-layer-checks#distane) DesignRuleChecker


void drc::minimumDistanceOrOverlap(int distance,int layer1, int layer2,bool mode=true)

Tests, if all elements between layer1 and layer2 have a minimum distance, an overlap is not marked as an error.

See also: MinimumDistanceOrOverlap, DesignRuleChecker


void drc::minimumEdgeLengthOnLayer(int edgeSize, int layer)

Tests for edges smaller edgeSize in polygon, path, and box elements on the layer. (introduced with release 20221119)


void drc::minimumElementDistance(int distance,int layer,bool mergeBefore=false)

Tests, if there are elements on layer with a lower distance.

See also: MinimumElementsDistance, DesignRuleChecker


void drc::minimumElementDistanceOnActiveLayer(int distance)

Tests, if there are elements on active layer with a lower distance.

See also: MinimumElementsDistance, DesignRuleChecker


void drc::minimumEnclosure(int distance,int layer1,int layer2)

layer1 must enclose layer2 by minimum of distance

See also: Enclosure, DesignRuleChecker


void drc::minimumInaccessibilityOnLayer(int layer, int inaccessibility ,bool mergeBefore=false)

wil check the most remote inner point of any shape. If it is located nearer to an edge as the entered value a violation is triggered.

See also: InaccessibilityCheck, DesignRuleChecker


void drc::minimumInside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)

Tests, if all elements on insidelayer are inside in one of layer1 to layer3 and have a minimum distance.

See also: Inside, DesignRuleChecker


void drc::minimumInsideOrOutside(int distance,int insideLayer, int layer1, int layer2=-1, int layer3=-1)

Tests, if all elements on insidelayer are inside in one of layer1 to layer3 and have a minimum distance or alternative completely outside of any inside layer.

See also: Inside, DesignRuleChecker


void drc::minimumNotchOnLayer(int notchsize, int layer, bool mergeBefore=false, bool testSlots=false)

Tests for notches smaller notchsize in polygon/path elements on the layer. If mergeBefore is true all shapes will be merged before the check. If testSlots is true, also slots within a single element will be checked.

See also: MinimumNotches, DesignRuleChecker


void drc::minimumOverlap(int overlap,int layer1, int layer2)

Tests, if all elements between layer1 and layer2 have a minimum overlap .

See also: MinimumOverlap, DesignRuleChecker


void drc::minimumOverlapDistance(int distance,int layer1,int layer2)

Performs an boolean and operation of the two layers and tests, if its distance.

See also: OverlapDistance, DesignRuleChecker


void drc::minimumPerimeterOnLayer(int layer, int perimetervalue ,bool mergeBefore=false)

Tests for perimeter smaller than perimetervalue on layer.

See also: PerimeterChecck, DesignRuleChecker


void drc::minimumSize(int size,int layer, bool mergeBefore=false, bool sharpAngles=true)

Tests, if all elements on layer have a minimum size. If mergeBefure is true, all elements are merged. If sharpAngles is true, sharp angles will also be marked as an error.

See also: MinimumSize, DesignRuleChecker


void drc::noBoxOnActiveLayer()

Tests ,if there are box elements on the active layer.

See also: NoBox, DesignRuleChecker


void drc::noBoxOnLayer(int layer)

Tests ,if there are box elements on the layer.

See also: NoBox, DesignRuleChecker


void drc::noCircleOnActiveLayer()

Tests, if there is a polygon with a circular shape on the active layer.

See also: NoCircle, DesignRuleChecker


void drc::noCircleOnLayer(int layer)

Tests, if there is a polygon with a circular shape on the layer.

See also: NoCircle, DesignRuleChecker


void drc::noElementOnActiveLayer()

Tests ,if there are elements on the active layer.

See also: NoElement, DesignRuleChecker


void drc::noElementOnLayer(int layer)

Tests ,if there are elements on the layer.

See also: NoElement, DesignRuleChecker


void drc::noHolesOnLayer(int layer,bool mergeBefore=false)

Tests, if there is a polygon with a hole on the layer.

See also: NoHoles, DesignRuleChecker


void drc::noPathOnActiveLayer()

Tests, if there are path elements on the active layer.

See also: NoPath, DesignRuleChecker


void drc::noPathOnLayer(int layer)

Tests, if there are path elements on the layer.

See also: NoPath, DesignRuleChecker


void drc::noPolygonOnActiveLayer()

Tests, if there are polygons on the active layer.

See also: NoPolygon, DesignRuleChecker


void drc::noPolygonOnLayer(int layer)

Tests, if there are polygons on the layer.

See also: NoPolygon, DesignRuleChecker


void drc::noSelfintersectionOnActiveLayer()

Tests, if there are self-intersecting polygons on the active layer..

See also: Self-Intersection, DesignRuleChecker


void drc::noSelfintersectionOnLayer(int layer)

Tests, if there are self-intersecting polygons on the layer.

See also: Self-Intersection, DesignRuleChecker


void drc::noSpikesOnLayer(int layer,bool sharpAngles=false)

Tests, if there are pathes with spikes on the layer. That means pathes with segments in the opposite direction to the previous segement. If sharpAngles is true, it will also check for sharp angles on pathes.

See also: NoPathesWithSpikes, DesignRuleChecker


void drc::noTextOnActiveLayer()

Tests, if there are text elements on the active layer.

See also: NoText, DesignRuleChecker


void drc::noTextOnLayer(int layer)

Tests, if there are text elements on the layer.

See also: NoText, DesignRuleChecker


void drc::noZeroWidthOnLayer(int layer)

Tests, if there are elements on the layer with a width of zero e.g. paths.

See also: NoZeroWidth, DesignRuleChecker


void drc::noZeroWidthOnActiveLayer()

Tests, if there are elements on the active layer with a width of zero e.g. paths.

See also: NoZeroWidth, DesignRuleChecker


void drc::onGrid(int grid,int layer)

Tests, if all points on the layer are on the grid.

See also: OnGrid, DesignRuleChecker


void drc::onlyCircleOnActiveLayer()

Tests, if there are other elements then polygons with a circular shape on the active layer.

See also: OnlyCircle, DesignRuleChecker


void drc::onlyCircleOnLayer(int layer)

Tests, if there are other elements then polygons with a circular shape on the layer.

See also: OnlyCircle, DesignRuleChecker


void drc::onlyRectangleOnActiveLayer()

Tests, if there are other elements then rectangles on the active layer.

See also: OnlyRectangle, DesignRuleChecker


void drc::onlyRectangleOnLayer(int layer)

Tests, if there are other elements then pRectangles on the layer.

See also: OnlyRectangle, DesignRuleChecker


void drc::overlapingElements(int layer)

Tests, if there are overlapping elements on layer.

See also: OverlappingElements, DesignRuleChecker


void drc::overlapingElementsOnActiveLayer()

Tests, if there are overlapping elements on the active layer.


void drc::removeNoDrcViolations(int layer)

Listed violations inside any shape of layer are removed from the list. The grafical display is not changed.


string drc::result

This string contains a little report of the last test results.


string drc::ruleName

The name of the next rule.


void drc::saveViolationList(string filename)

Saves the list of detected violations to a file. The default file format of it is a macro which can be executed to load the violations again into the LayoutEditor.


void drc::setCheckCell()

Call the method will remove all limitation of the design rule checks and the hole cell will be tested.


void drc::setCheckRegion(point min, point max)

Call the method will limit all design rule checks to a region defined by the to given points.


void drc::setCheckView()

Call the method will limit all design rule checks to the current view.


void drc::setErrorLayerToActiveLayer()

The error Layer is set to the active Layer.


void drc::setGraphical(bool)

If bool is true, all detected violations will be marked within the design.


void drc::setList(bool)

If bool is true, all detected violations will be displayed in a list.


void drc::setRegionMode()

Sets the drawing area in a mode which will allow to define the drc region by mouse.


void drc::showReport()

Shows a messagebox with the results of the design rule checker.


void drc::widthDependentDistance(int distance,int width,int layer,bool mergeBefore=false)

A minimum distance check on layer but only for shapes having a width more than width