next up previous contents index
Next: Extraction Functions Up: Design Rule Checking Functions Previous: Design Rule Checking Functions   Contents   Index

DRC

The following functions relate to the design rule checking subsystem.

(int) DRCstate(state)
This function sets the interactive DRC state, and returns the existing state. If the argument is 0, interactive DRC is turned off. If nonzero, interactive DRC is turned on. If greater than 1, error messages will not pop up. The return value is the present state, which is a value of 0-2, similarly interpreted.

(int) DRCsetLimits(batch_cnt, intr_cnt, intr_time, skip_cells)
Deprecated in favor of DRCsetMaxErrors and similar.

This function sets the limits used in design rule checking. Each argument, if negative, will cause the related value to be unchanged by the function call. For the first three arguments, the value ``0'' is interpreted as ``no limit''.

batch_cnt
This sets the maximum number of errors to record in batch-mode error checking. When this number is reached, the checking is aborted. Values 0 - 100000 are accepted.
intr_cnt
This sets the maximum number of objects tested in interactive DRC. The testing aborts when this count is reached. Values of 0 - 100000 are accepted.
intr_time
This sets the maximum time allowed for interactive DRC testing. The value given is in milliseconds, and values of 0 - 30000 are accepted.
skip_cells
If nonzero, testing of newly placed, moved, or copied subcells is skipped in interactive DRC. If zero, subcells will be tested. This can be a lengthly operation.

This function always returns 1. Out-of-range arguments are set to the maximum permissible values.

(int) DRCgetLimits(array)
Deprecated in favor of DRCgetMaxErrors and similar.

This function fills the array, which must have size 4 or larger, with the current DRC limit values. These are, in order,

[0] The batch error count limit.
[1] The interactive object count limit.
[2] The interactive time limit in milliseconds.
[3] A flag which indicates interactive DRC is skipped for subcells.

The return value is always 1. The function fails if the array argument is bad.

(int) DRCsetMaxErrors(value)
Set the maximum violation count allowed before a batch DRC run is terminated. If set to 0, no limit is imposed. The value is clipped to the acceptable range 0 - 100,000. If not set, a value 0 (no limit) is assumed. The function returns the previous value.

(int) DRCgetMaxErrors()
Returns the maximum violation count before a batch DRC run is terminated. If set to 0, no limit is imposed.

(int) DRCsetInterMaxObjs(value)
Set the maximum number of objects tested in interctive DRC. Further testing is skipped when this value is reached. A value of 0 imposes no limit. The passed value is clipped to the acceptable range 0 - 100,000, the value used if not set is 1000. The function returns the previous setting.

(int) DRCgetInterMaxObjs()
Return the maximum number of objects tested in interctive DRC. Further testing is skipped when this value is reached. A value of 0 imposes no limit.

(int) DRCsetInterMaxTime(value)
Set the maximum time in milliseconds allowed for interactive DRC testing after an operation. The testing will abort after this limit, returning program control to the user. If set to 0, no time limit is imposed. the passed value is clipped to the acceptable range 0 - 30,000. If not set, a value of 5000 (5 seconds) is used. The function returns the previous value.

(int) DRCgetInterMaxTime()
Return the maximum time in milliseconds allowed for interactive DRC testing after an operation. The testing will abort after this limit, returning program control to the user. If set to 0, no time limit is imposed.

(int) DRCsetInterMaxErrors(value)
Set the maximum number of errors allowed in interactive DRC testing after an operation. Further testing is skipped after this count is reached. A value of 0 imposes no limit. The value will be clipped to the acceptable rnge 0 - 1000. If not set, a value of 100 is used. The function returns the previous value.

(int) DRCgetInterMaxErrors()
Return the maximum number of errors allowed in interactive DRC testing after an operation. Further testing is skipped after this count is reached. A value of 0 imposes no limit.

(int) DRCsetInterSkipInst(value)
If the boolean argument is nonzero, cell instances will not be checked for violations in interactive DRC. The test can be lengthly and the user may want to defer such testing. The return value is 0 or 1 representing the previous setting.

(int) DRCgetInterSkipInst()
The return value of this function is 0 or 1 representing whether cell instances are skipped (if 1) in interactive DRC testing.

(int) DRCsetLevel(level)
This function sets the DRC error recording level to the argument. The argument is interpreted as follows:

0 or negative One error is reported per object.
1 One error of each type is reported per object.
2 or larger All errors are reported.

This function always succeeds, and the previous level (0, 1, 2) is returned.

(int) DRCgetLevel()
This function returns the current error reporting level for design rule checking. Possible values are

0 One error is reported per object.
1 One error of each type is reported per object.
2 All errors are reported.

This function always succeeds.

(int) DRCcheckArea(array, file_handle_or_name)
This function performs batch-mode design rule checking in the current cell.

The array argument is an array of size 4 or larger, or 0 can be passed for this argument. If an array is passed, it represents a rectangular area where checking is performed, and the values are in microns in order L,B,R,T. If 0 is passed, the entire area of the current cell is checked.

The second argument can be a file handle opened with the Open function for writing, or the name of a file to open, or an empty string, or a null string or (equivalently) the scalar 0. This sets the destination for error recording. If the argument is null or 0, a file will be created in the current directory using the name template ``drcerror.log.cellname'', where cellname is the current cell. If an empty string is passed (give "" as the argument), output will go to the error log, and appear in the pop-up which appears on-screen. If a string is given, it is taken as a file name to open.

The function returns an integer, either the number of errors found or -1 on error. If -1 is returned, an error message is probably available from the GetError function.

(int) DRCchdCheckArea(chdname, cellname, gridsize, array, file_handle_or_name, flatten)
This function performs a batch-mode DRC of the given top-level cell, from the Cell Hierarchy Digest (CHD) whose access name is given as the first argument. Unlike other DRC commands, this function does not require that the entire layout be in memory, thus it is theoretically possible to perform DRC on designs that are too large for available memory.

If the given cellname is null or 0 is passed, the default cell for the named CHD is assumed.

The checking is performed on the areas of a grid, and only the cells needed to render the grid area are read into memory temporarily. The gridsize argument gives the size of this grid, in microns. If 0 is passed, no grid is used, and the entire layout will be read into memory, as in the normal case. If a negative value is passed, the value associated with the DrcPartitionSize variable is used. The chosen grid size should be small enough to avoid page swapping, but too-small of a grid will lengthen checking time (larger is better in this regard). The user can experiment to find a reasonable value for their designs. A good starting value might be 400.0 microns.

The array argument is an array of size 4 or larger, or 0 can be passed for this argument. If an array is passed, it represents a rectangular area where checking is performed, and the values are in microns in order L,B,R,T. If 0 is passed, the entire area of the cellname is checked.

The file_handle_or_name argument can be a file handle opened with the Open function for writing, or the name of a file to open, or an empty or null string or the scalar 0. This sets the destination for error recording. If the argument is null, empty or 0, a file will be created in the current directory using the name template ``drcerror.log.cellname'', where cellname is the top-level cell being checked. If a string is given, it is taken as a file name to open. There is no provision for sending output to the on-screen error logger, unlike in the DRCcheckArea function.

If the boolean argument flatten is true, the geometry will be flattened as it is read into memory. This will make life simpler and faster for the DRC evaluation functions, at the expense of (probably) much larger memory use. The user can experiment to find if this option provides any speed benefit.

The function returns an integer, either the number of errors found or -1 on error. If -1 is returned, an error message is probably available from the GetError function.

(int) DRCcheckObjects(file_handle)
This function checks each selected object for design rule violations. The file_handle argument is a file descriptor returned from the Open function, or 0. If a file descriptor is passed, output goes to that file, otherwise output goes to the on-screen error logger. This function returns the number of errors found.

(expr_handle) DRCregisterExpr(expr)
This function creates and tags a parse tree from the string argument, which is a layer expression, for later use, and returns a handle to the expression. This avoids the overhead of parsing the expression on each function call. The returned value is used by other functions (currently just the two below).

(int) DRCtestBox(left, bottom, right, top, expr_handle)
This function tests a rectangular area specified by the first four arguments for regions where a layer expression is true. The expr_handle argument is the handle of a layer expression returned by DRCregisterExpr. The returned value is 0 if the expression is nowhere true, 1 if the expression is true somewhere but not everywhere, and 2 if the expression is true everywhere in the test region.

(int) DRCtestPoly(num, points, expr_handle)
This function tests a polygon area for regions where a layer expression is true. The first argument is the number of points in the polygon. The second argument is the name of an array variable containing the polygon data. The polygon data are stored sequentially as x,y pairs, and the last point must be the same coordinate as the first. The length of the vector must be at least two times the value passed for the first argument. The expr_handle argument is the handle of a layer expression returned by DRCregisterExpr. The returned value is 0 if the expression is nowhere true, 1 if the expression is true somewhere but not everywhere, and 2 if the expression is true everywhere in the test region.

(zoidlist) DRCzList(layername, rulename, index, source)
This function will access existing design rule definitions, and use the associated test region generator to create a new trapezoid list, which is returned. For example, in a MinSpaceTo rule test, we construct a ``halo'' around source polygons. If this halo intersects any target polygons, a violation would be flagged. The list of trapezoids that constitute the halos around the source polygons is the return of this function.

The first three arguments specify an existing design rule. The rule is defined on the layer named in the first argument (a string). The type of rule is given as a string in the second argument. This is the name of an ``edge'' rule, which uses test regions constructed along edges to evaluate the rule. Valid names are the user-defined rules and

MinEdgeLength
MaxWidth
MinWidth
MinSpace
MinSpaceTo
MinSpaceFrom
MinOverlap
MinNoOverlap

The third argument is an integer index which specifies the rule to choose if there is more than one of the named type assigned to the layer. The index is zero based, and indicates the position of the rule when listed in the window of the Design Rule Editor panel from the Edit Rules button in the DRC Menu, relative to and counting only rules of the same type. The is also the order as first seen by Xic, as read from the technology file or created interactively.

The fourth argument is a ``zoidlist'' as is taken by many of the functions that deal with layer expressions and trapezoid lists, as explained for those functions (see F.7.1). If the value passed is a scalar 0, then geometry is obtained from the full hierarchy of the current cell. In this case, the created test areas will be identical to those created during a DRC run. It may be instructive to create a visible layer from this result, to see where testing is being performed.

If the argument instead passes trapezoids, the result will be creation of the test regions as if the passed trapezoids were features on the layer or Region associated with the rule. The actual features on the layer are ignored.

The function will fail and halt execution if the first three arguments do not indicate an existing design rule definition.

(zoidlist) DRCzListEx(source, target, inside, outside, incode, outcode, dimen)
This is similar to DRCzList, however it does not reference an existing rule. Instead, it accesses the test area generator directly, effectively creating an internal, temporary rule.

The first argument is a ``zoidlist'' as expected by other functions that accept this argument type (see F.7.1). Unlike for DRCzList, this argument can not be zero or null.

The second argument is a string providing a target layer expression. This may be scalar 0 or null. The inside and outside arguments are strings providing layer expressions that will select which parts of an edge will be used for test area generation. The inside is the area inside the figure at the edge, and outside is just outside of the figure along the edge. Either can be null or scalar 0.

The incode and outcode are integer values 0-2 which indicate how the inside and outside expressions are to be interpreted with regard to defining the ``active'' part of the edge. The values have the following interpretations:

0 Don't care, the value expression is ignored.
1 The active parts of the edge are where the expression is clear.
2 The active parts of the edge are where the expression is dark.

The dimen is the width of the test area, in microns. It must be a positive real number.

If all goes well, a trapezoid list reprseenting the effective test areas is returned.


next up previous contents index
Next: Extraction Functions Up: Design Rule Checking Functions Previous: Design Rule Checking Functions   Contents   Index
Stephen R. Whiteley 2024-09-29