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)
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)
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) 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 fuction 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 wich 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)
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. The chosen grid size should be 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.

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.


next up previous contents index
Next: Extraction Functions Up: Design Rule Checking Functions Previous: Design Rule Checking Functions   Contents   Index
Stephen R. Whiteley 2012-04-01