next up previous contents index
Next: Clipping Functions Up: Geometry Editing Functions 2 Previous: Geometry Editing Functions 2   Contents   Index

Cells, PCells, Vias, and Instance Placement

(int) CheckPCellParam(library, cell, view, pname, value)
The first three arguments specify a parameterized cell. If library is not given as a scalar 0, it is the name of the OpenAccess library containing the pcell super-master, whose name is given in the cell argument. The view argument can be passed a scalar 0 to indicate that the OpenAccess view name is ``layout'', or the actual view name can be passed if different. For Xic native pcells not stored in OpenAccess, the library and view should both be 0 (zero).

The pname is a string containing a parameter name for a parameter of the specified pcell, and the value argument is either a scalar or string value. The function returns 1 if the value is not forbidden by a constraint, 0 otherwise.

(int) CheckPCellParams(library, cell, view, params)
The first three arguments specify a parameterized cell. If library is not given as a scalar 0, it is the name of the OpenAccess library containing the pcell super-master, whose name is given in the cell argument. The view argument can be passed a scalar 0 to indicate that the OpenAccess view name is ``layout'', or the actual view name can be passed if different. For Xic native pcells not stored in OpenAccess, the library and view should both be 0 (zero).

The params argument is a string providing the parameter values in the format of the pc_params property as applied to sub-masters and instances. i.e., values are constants and constraints are not included. The function returns 1 if no parameter has a value forbidden by a constraint, 0 otherwise.

(int) CreateCell(cellname, [orig_x, orig_y])
This will create a new cell from the contents of the selection queue, with the given name, which can not already be in use. The new cell is created in memory only, with the modified flag set so as to generate a reminder to the user to save the cell to disk when exiting Xic. This provides functionality similar to the Create Cell button in the Edit Menu.

If the optional coordinate pair orig_x and orig_y are given (in microns), then this point will be the new cell origin in physical mode only. Otherwise, the lower-left corner of the bounding box of the objects will be the new cell origin. In electrical mode, the cell origin is selected to keep contacts on-grid, and the origin arguments are ignored.

By default, this function will fail if a cell of the same name already exists in the current symbol table. However, if the CrCellOverwrite variable is set, existing cells will be overwritten with the new data, and the function will succeed.

(int) CopyCell(name, newname)
This function will copy the cell in memory named name to newname. The function returns 1 if the operation was successful, 0 otherwise. The name cell must exist in memory, and the newname can not clash with an existing cell or library device.

(int) RenameCell(oldname, newname)
This function will rename the cell in memory named oldname to newname, and update all references. The function returns 1 if the operation was successful, 0 otherwise. The oldname cell must exist in memory, and the newname can not clash with an existing cell or library device.

(int) DeleteEmpties(recurse)
This function will delete empty cells found in the hierarchy under the current cell. This operation can not be undone. The argument is an integer flag; if zero, one pass is done, and all empty cells are deleted. If the argument is nonzero, additional passes are done to delete cells that are newly empty due to their subcells being deleted on the previous pass. The top-level cells is never deleted. The return value is the number of cells deleted.

(int) Place(cellname, x, y [, refpt, array, smash, usegui, tfstring])
This function places an instance of the named cell at x, y. The first argument is of string type and contains the name of the cell to place. The string can consist of two space-separated words. If so, the first word may be a CHD name, an archive file name, or a library name (including OpenAccess when available).

The interpretation is similar to the new selection in the Open command in the File Menu. In the case of two words, the second word is the name of the cell to extract from the source specified as the first word. If only one word is given, it can be an archive file name in which case the top-level cell is understood, or a CHD name in which case the default cell is understood, or it can be the name of a cell available as a native cell from a library or the search path, or already exist in memory.

The second two arguments define the placement location, in microns.

The remaining arguments are optional, meaning that they need not be given, but all arguments to the left must be given.

The refpt argument is an integer code that specifies the reference point which will correspond to x, y after placement. The values can be

0 the cell origin (the default)
1 the lower left corner
2 the upper left corner
3 the upper right corner
4 the lower right corner
The corners are those of the untransformed array or cell.

In electrical mode, if the cell has terminals, this code is ignored, and the location of the first terminal is the reference point. If the cell has no terminals, the corner reference points are snapped to the nearest grid location. This is to avoid producing off-grid terminal locations.

The array argument, if given, can be a scalar, or the name of an array containing four numbers. This argument specifies the arraying parameters for the instance placement, which apply in physical mode only. If a scalar 0 is passed, the placement will not be arrayed, which is also the case if this argument does not appear and is always true in electrical mode. If the scalar is nonzero, then the placement will use the current array parameters, as displayed in the Cell Placement Control pop-up, or set with the PlaceSetArrayParams function. If the argument is the name of an array, the array contains the arraying parameters. These parameters are:

array[0] NX, integer number in the X direction.
array[1] NY, integer number in the Y direction.
array[2] DX, the real value spacing between cells in the X direction, in microns.
array[3] DY, the real value spacing between cells in the Y direction, in microns.

The NX and NY values will be clipped to the range of 1 through 32767. The DX and DY are edge to adjacent edge spacing, i.e., when zero the elements will abut. If DX or DY is given the negative cell width or height, so that all elements appear at the same location, the corresponding NX or NY is taken as 1. Otherwise, there is no restriction on DX or DY.

If the boolean value smash is given and nonzero (TRUE), the cell will be flattened into the parent, rather than placed as an instance. The flatten-level is 1, so subcells of the cell (if any) become subcells of the parent. This argument is ignored if the cell being placed is a parameterized cell (pcell).

The usegui argument applies only when placing a pcell. If nonzero (TRUE), the Parameters panel will appear, and the function will block until the user dismisses the panel. The panel can be used to set cell parameters before instantiation. Initially, the parameters will be shown with default values, or values that were last given to PlaceSetPCellParams. If the usegui argument is not given or zero (FALSE), the default parameter set as updated with parameters given to PlaceSetPCellParams will be used to instantiate the cell immediately.

The final argument can be a null string or scalar 0 which is equivalent, an empty string, or a transform description in the format returned by GetTransformString. If null or not given, the arguemnt is ignored. In this case, the cell will be transformed before placement according to the current transform. Otherwise, the given transformation will be used when placing the instance. An empty string is taken as the identity transform. If the UseTransform mode is in effect, the current transform will be added to the string transform, giving an overall transfromation that will match geometry placement in this mode.

On success, the function returns 1, 0 otherwise.

(object_handle) PlaceH(cellname, x, y [, refpt, array, smash, usegui, tfstring])
This is similar to the Place function, however it returns a handle to the newly created instance. However, if the smash boolean is true or on error, a scalar 0 is returned.

(int) PlaceSetArrayParams(nx, ny, dx, dy)
This function provides array parameters which may be used when instantiating physical cells. These parameters will appear in the Cell Placement Control panel. The arguments are:

nx Integer number in the X direction.
ny Integer number in the Y direction.
dx The real value spacing between cells in the X direction, in microns.
dy The real value spacing between cells in the Y direction, in microns.

The nx and ny values will be clipped to the range of 1 through 32767. The dx and dy are edge to adjacent edge spacing, i.e., when zero the elements will abut. If dx or dy is given the negative cell width or height, so that all elements appear at the same location, the corresponding nx or ny is taken as 1. Otherwise, there is no restriction on dx or dy.

The function returns 1 and sets the array parameters in physical mode. In electrical mode, the function returns 0 and does nothing.

(int) PlaceSetPCellParams(library, cell, view, params)
This sets the default parameterized cell (pcell) parameters used when instantiating the pcell indicated by the libname/cell/view. If library is not given as a scalar 0, it is the name of the OpenAccess library containing the pcell super-master, whose name is given in the cell argument. The view argument can be passed a scalar 0 to indicate that the OpenAccess view name is ``layout'', or the actual view name can be passed if different. For Xic native pcells not stored in OpenAccess, the library and view should both be 0 (zero).

The params argument is a string providing the parameter values in the format of the pc_params property as applied to sub-masters and instances, i.e., values are constants and constraints are not included. Not all parameters need be given, only those with non-default values.

Be aware that there is no immediate constraint testing of the parameter values given to this function, though bad values will cause subsequent instantiation of the named pcell to fail. The CheckPCellParams fuction can be used to validate the params list before calling this function. When giving parameters for non-native pcells, it is recommended that the type specification prefixes be used, though an attempt is made internally to recognize and adapt to differing types.

The saved parameter set will be used for all instantiations of the pcell, until changed with another call to PlaceSetPCellParams. The placement is done with the Place script function, as for normal cells.

In graphical mode, the given parameter set will initialize the Parameters pop-up.

This function manages an internal table of cellname/parameter list associations. If 0 is given for all arguments, the table will be cleared. If the params argument is 0, the specified entry will be removed from the table. When the script terminates, parameter lists set with this function will revert to the pre-script values. Entries that were cleared by passing null arguments are not reverted, and remain cleared.

The function returns 1 on success, 0 if an error occurred, with an error message available from GetError.

(int) Replace(cellname, add_xform, array)
This will replace all selected subcells with cellname. The same transformation applied to the previous instance is applied to the replacing instance. In addition, if add_xform is nonzero, the current transform will be added. The function returns 1 if successful, 0 if the new cell could not be opened.

The array argument can be a scalar, or the name of an array containing four numbers. This argument specifies the arraying parameters for the instance placement, which apply in physical mode only. If a scalar 0 is passed, the placement will retain the same arraying parameters as the previous instance. If the scalar is nonzero, then the placement will use the current array parameters, as displayed in the Cell Placement Control pop-up, or set with the PlaceSetArrayParams function. If the argument is the name of an array, the array contains the arraying parameters. These parameters are:

array[0] NX, integer number in the X direction.
array[1] NY, integer number in the Y direction.
array[2] DX, the real value spacing between cells in the X direction, in microns.
array[3] DY, the real value spacing between cells in the Y direction, in microns.

The NX and NY values will be clipped to the range of 1 through 32767. The DX and DY are edge to adjacent edge spacing, i.e., when zero the elements will abut. If DX or DY is given the negative cell width or height, so that all elements appear at the same location, the corresponding NX or NY is taken as 1. Otherwise, there is no restriction on DX or DY.

(int) OpenViaSubMaster(vianame, defnstr)
This function will create if necessary and return the name of a standard via sub-master cell in memory. The first argument is the name of a standard via, as defined in the technology file or imported from Virtuoso. The second argument contains a string that specifies the parameters that differ from the default values. This can be null or empty if no non-default values are used. The format is the same as described for the stdvia property, with the standard via name token stripped (see 5.8.1).

On success, a name is returned. One can use this name with the Place function to instantiate the via. Otherwise, a fatal error is triggered.


next up previous contents index
Next: Clipping Functions Up: Geometry Editing Functions 2 Previous: Geometry Editing Functions 2   Contents   Index
Stephen R. Whiteley 2022-05-28