API reference - Class CellNotation used in Ruby API documentation Description: A cell
A cell object consists of a set of shape containers (called layers), a set of child cell instances and auxiliary informations such as the parent instance list. A cell is identified through an index given to the cell upon instantiation. Cell instances refer to single instances or array instances. Both are encapsulated in the same object, the CellInstArray object. In the simple case, this object refers to a single instance. In the general case, this object may refer to a regular array of cell instances as well. Starting from version 0.16, the child_inst and erase_inst methods are no longer available since they were using index addressing which is no longer supported. Instead, instances are now addressed with the Instance reference objects. See The Database API for more details about the database objects like the Cell class. Public constructors
Public methods
Deprecated methods (protected, public, static, non-static and constructors)
Detailed descriptionvoid _createDescription: Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. void _destroyDescription: Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing. [const] bool _destroyed?Description: Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. [const] bool _is_const_object?Description: Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self. void _manageDescription: Marks the object as managed by the script side. After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. Usually it's not required to call this method. It has been introduced in version 0.24. void _unmanageDescription: Marks the object as no longer owned by the script side. Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. Usually it's not required to call this method. It has been introduced in version 0.24. [const] string basic_nameDescription: Returns the name of the library or PCell or the real name of the cell For non-proxy cells (see is_proxy?), this method simply returns the cell name. For proxy cells, this method returns the PCell's definition name or the library cell name. This name may differ from the actual cell's name because to ensure that cell names are unique, KLayout may assign different names to the actual cell compared to the source cell. This method has been introduced in version 0.22. [const] Box bboxDescription: Retrieve the bounding box of the cell
The bounding box is computed over all layers. To compute the bounding box over single layers, use bbox_per_layer. [const] Box bbox_per_layer(unsigned int layer_index)Description: Retrieve the per-layer bounding box of the cell
The bounding box is the box enclosing all shapes on the given layer. [const] RecursiveShapeIterator begin_shapes_rec(unsigned int layer)Description: Delivers a recursive shape iterator for the shapes below the cell on the given layer
For details see the description of the RecursiveShapeIterator class. This method has been added in version 0.23. [const] RecursiveShapeIterator begin_shapes_rec_overlapping(unsigned int layer,Box region)Description: Delivers a recursive shape iterator for the shapes below the cell on the given layer using a region search
For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box overlaps the given region. This method has been added in version 0.23. [const] RecursiveShapeIterator begin_shapes_rec_touching(unsigned int layer,Box region)Description: Delivers a recursive shape iterator for the shapes below the cell on the given layer using a region search
For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box touches the given region. This method has been added in version 0.23. [const] unsigned int[] called_cellsDescription: Return a list of all called cells
This method determines all cells which are called either directly or indirectly by the cell. It returns an array of cell indexes. Use the 'cell' method of Layout to retrieve the corresponding Cell object. This method has been introduced in version 0.19. [const] unsigned int[] caller_cellsDescription: Return a list of all caller cells
This method determines all cells which call this cell either directly or indirectly. It returns an array of cell indexes. Use the 'cell' method of Layout to retrieve the corresponding Cell object. This method has been introduced in version 0.19. [const] unsigned int cell_indexDescription: The cell index accessor method
Instance change_pcell_parameter(const Instance instance,string name,variant value)Description: Changes a single parameter for an individual PCell instance given by name
This will set the PCell parameter named 'name' to the given value for the instance addressed by 'instance'. If no parameter with that name exists, the method will do nothing. This method has been introduced in version 0.23. Instance change_pcell_parameters(const Instance instance,map<string,variant> dict)Description: Changes the given parameter for an individual PCell instance
This version receives a dictionary of names and values. It will change the parameters given by the names to the values given by the values of the dictionary. The functionality is similar to the same function with an array, but more convenient to use. Values with unknown names are ignored. This method has been introduced in version 0.24. Instance change_pcell_parameters(const Instance instance,variant[] parameters)Description: Changes the parameters for an individual PCell instance
If necessary, this method creates a new variant and replaces the given instance by an instance of this variant. The parameters are given in the order the parameters are declared. Use pcell_declaration on the instance to get the PCell declaration object of the cell. That PCellDeclaration object delivers the parameter declaration with it's 'get_parameters' method. Each parameter in the variant list passed to the second list of values corresponds to one parameter declaration. There is a more convenient method (change_pcell_parameter) that changes a single parameter by name. This method has been introduced in version 0.22. [const] unsigned long child_cellsDescription: Report the number of child cells The number of child cells (not child instances!) is returned. CAUTION: this method is SLOW, in particular if many instances are present. [const] unsigned long child_instancesDescription: Number of child instances
void clear(unsigned int layer_index)Description: Clear the shapes on the given layer void clearDescription: Clears the cell (deletes shapes and instances) This method has been introduced in version 0.23. void clear_instsDescription: Clear the instance list void clear_shapesDescription: Clear all shapes in the cell void copy(unsigned int src,unsigned int dest)Description: Copy the shapes from the source to the target layer
The destination layer is not overwritten. Instead, the shapes are added to the shapes of the destination layer. If source are target layer are identical, this method does nothing. This method will copy shapes within the cell. To copy shapes from another cell this cell, use the copy method with the cell parameter. This method has been introduced in version 0.19. void copy(Cell ptr src_cell,unsigned int src_layer,unsigned int dest)Description: Copies shapes from another cell to the target layern this cell
This method will copy all shapes on layer 'src_layer' of cell 'src_cell' to the layer 'dest' of this cell. The destination layer is not overwritten. Instead, the shapes are added to the shapes of the destination layer. If the source cell lives in a layout with a different database unit than that current cell is in, the shapes will be transformed accordingly. The same way, shape properties are transformed as well. Note that the shape transformation may require rounding to smaller coordinates. This may result in a slight distortion of the original shapes, in particular when transforming into a layout with a bigger database unit. void copy_instances(const Cell source_cell)Description: Copies the instances of child cells in the source cell to this cell
The source cell must reside in the same layout than this cell. The instances of child cells inside the source cell are copied to this cell. No new cells are created, just new instances are created to already existing cells in the target cell. The instances will be added to any existing instances in the cell. More elaborate methods of copying hierarchy trees between layouts or duplicating trees are provided through the copy_tree_shapes (in cooperation with the CellMapping class) or copy_tree methods. This method has been added in version 0.23. void copy_shapes(const Cell source_cell)Description: Copies the shapes from the given cell into this cell
All shapes are copied from the source cell to this cell. Instances are not copied. The source cell can reside in a different layout. In this case, the shapes are copied over from the other layout into this layout. Database unit conversion is done automatically if the database units differ between the layouts. Note that this may lead to grid snapping effects if the database unit of the target layout is not an integer fraction of the source layout. If source and target layout are different, the layers of the source and target layout are identified by their layer/datatype number or name (if no layer/datatype is present). The shapes will be added to any shapes already in the cell. This method has been added in version 0.23. void copy_shapes(const Cell source_cell,const LayerMapping layer_mapping)Description: Copies the shapes from the given cell into this cell
All shapes on layers specified in the layer mapping object are copied from the source cell to this cell. Instances are not copied. The target layer is taken from the mapping table. The shapes will be added to any shapes already in the cell. This method has been added in version 0.23. unsigned int[] copy_tree(const Cell source_cell)Description: Copies the cell tree of the given cell into this cell
The complete cell tree of the source cell is copied to the target cell plus all shapes in that tree are copied as well. This method will basically duplicate the cell tree of the source cell. The source cell may reside in a separate layout. This method therefore provides a way to copy over complete cell trees from one layout to another. The shapes and instances will be added to any shapes or instances already in the cell. This method has been added in version 0.23. void copy_tree_shapes(const Cell source_cell,const CellMapping cell_mapping)Description: Copies the shapes from the given cell and the cell tree below into this cell or subcells of this cell
This method is provided if source and target cell reside in different layouts. If will copy the shapes from all cells below the given source cell, but use a cell mapping object that provides a specification how cells are identified between the layouts. Cells in the source tree, for which no mapping is provided, will be flattened - their shapes will be propagated into parent cells for which a mapping is provided. The cell mapping object provides various methods to map cell trees between layouts. See the CellMapping class for details about the mapping methods available. The cell mapping object is also responsible for creating a proper hierarchy of cells in the target layout if that is required. Layers are identified between the layouts by the layer/datatype number of name if no layer/datatype number is present. The shapes copied will be added to any shapes already in the cells. This method has been added in version 0.23. void copy_tree_shapes(const Cell source_cell,const CellMapping cell_mapping,const LayerMapping layer_mapping)Description: Copies the shapes from the given cell and the cell tree below into this cell or subcells of this cell with layer mapping
This method is provided if source and target cell reside in different layouts. If will copy the shapes from all cells below the given source cell, but use a cell mapping object that provides a specification how cells are identified between the layouts. Cells in the source tree, for which no mapping is provided, will be flattened - their shapes will be propagated into parent cells for which a mapping is provided. The cell mapping object provides various methods to map cell trees between layouts. See the CellMapping class for details about the mapping methods available. The cell mapping object is also responsible for creating a proper hierarchy of cells in the target layout if that is required. In addition, the layer mapping object can be specified which maps source to target layers. This feature can be used to restrict the copy operation to a subset of layers or to convert shapes to different layers in that step. The shapes copied will be added to any shapes already in the cells. This method has been added in version 0.23. void createDescription: Ensures the C++ object is created Use of this method is deprecated. Use _create instead void deleteDescription: Deletes this cell This deletes the cell but not the sub cells of the cell. These subcells will likely become new top cells unless they are used otherwise. All instances of this cell are deleted as well. Hint: to delete multiple cells, use "delete_cells" which is far more efficient in this case. After the cell has been deleted, the Cell object becomes invalid. Do not access methods or attributes of this object after deleting the cell. This method has been introduced in version 0.23. void delete_property(variant key)Description: Deletes the user property with the given key This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. This method has been introduced in version 0.23. void destroyDescription: Explicitly destroys the object Use of this method is deprecated. Use _destroy instead [const] bool destroyed?Description: Returns a value indicating whether the object was already destroyed Use of this method is deprecated. Use _destroyed? instead [const] string display_titleDescription: Returns a nice looking name for display purposes For example, this name include PCell parameters for PCell proxy cells. This method has been introduced in version 0.22. [iter] unsigned int each_child_cellDescription: Iterate over all child cells This iterator will report the child cell indices, not every instance. [iter] Instance each_instDescription: Iterate over all child instances (which may actually be instance arrays) Starting with version 0.15, this iterator delivers Instance objects rather than CellInstArray objects. [iter] Instance each_overlapping_inst(const Box b)Description: Region query for the instances in "overlapping" mode
This will iterate over all child cell instances overlapping with the given region b. Starting with version 0.15, this iterator delivers Instance objects rather than CellInstArray objects. [const,iter] Shape each_overlapping_shape(unsigned int layer_index,const Box box,unsigned int flags)Description: Iterate all shapes of a given layer that overlap the given box
[const,iter] Shape each_overlapping_shape(unsigned int layer_index,const Box box)Description: Iterate all shapes of a given layer that overlap the given box
This call is equivalent to each_overlapping_shape(layer_index,box,RBA::Shapes::SAll). This convenience method has been introduced in version 0.16. [const,iter] unsigned int each_parent_cellDescription: Iterate over all parent cells This iterator will iterate over the parent cells, just returning their cell index. [iter] ParentInstArray each_parent_instDescription: Iterate over the parent instance list (which may actually be instance arrays) The parent instances are basically inversions of the instances. Using parent instances it is possible to determine how a specific cell is called from where. [const,iter] Shape each_shape(unsigned int layer_index,unsigned int flags)Description: Iterate all shapes of a given layer
This iterator is equivalent to 'shapes(layer).each'. [const,iter] Shape each_shape(unsigned int layer_index)Description: Iterate all shapes of a given layer
This call is equivalent to each_shape(layer_index,RBA::Shapes::SAll). This convenience method has been introduced in version 0.16. [iter] Instance each_touching_inst(const Box b)Description: Region query for the instances in "touching" mode
This will iterate over all child cell instances touching the given region b. Starting with version 0.15, this iterator delivers Instance objects rather than CellInstArray objects. [const,iter] Shape each_touching_shape(unsigned int layer_index,const Box box,unsigned int flags)Description: Iterate all shapes of a given layer that touch the given box
[const,iter] Shape each_touching_shape(unsigned int layer_index,const Box box)Description: Iterate all shapes of a given layer that touch the given box
This call is equivalent to each_touching_shape(layer_index,box,RBA::Shapes::SAll). This convenience method has been introduced in version 0.16. void erase(const Instance inst)Description: Erase the instance given by the Instance object This method has been introduced in version 0.16. It can only be used in editable mode. void fill_region(const Region region,unsigned int fill_cell_index,const Box fc_box,const Point ptr origin)Description: Fills the given region with cells of the given type
This method creates a regular pattern of fill cells to cover the interior of the given region as far as possible. This process is also known as tiling. The current implementation supports rectangular (not necessarily square) tile cells. The tile cell's footprint is given by the fc_box parameter and the cells will be arranged with their footprints forming a seamless array. The algorithm supports a global fill raster as well as local (per-polygon) origin optimization. In the latter case the origin of the regular raster is optimized per individual polygon of the fill region. A more elaborate version of this method is available which also returns informations about the non-filled parts. This method has been introduced in version 0.23. void fill_region(const Region region,unsigned int fill_cell_index,const Box fc_box,const Point ptr origin,Region ptr remaining_parts,const Point fill_margin,Region ptr remaining_polygons)Description: Fills the given region with cells of the given type (extended version)
First of all, this method behaves like the simple form. In addition, it can be configured to return information about the parts which could not be filled. Those can be full polygons from the input (without a chance to fill) or parts of original polygons which are worth being fed into the fill algorithm again. If the 'remaining_parts' argument is non-nil, the corresponding region will receive the parts of the polygons which are not covered by tiles. Basically the tiles are subtracted from the original polygons. A margin can be specified which is applied separately in x and y direction before the subtraction is done ('fill_margin' parameter). If the 'remaining_polygons' argument is non-nil, the corresponding region will receive all polygons from the input region which could not be filled and where there is no chance of filling because not a single tile will fit into them. 'remaining_parts' and 'remaining_polygons' can be identical with the input. In that case the input will be overwritten with the respective output. Otherwise, the respective polygons are added to these regions. This allows to set up a more elaborate fill scheme using multiple iterations and local origin-optimization ('origin' is nil): r = ... # region to fill c = ... # cell in which to produce the fill cells fc_index = ... # fill cell index fc_box = ... # fill cell footprint fill_margin = RBA::Point::new(0, 0) # x/y distance between tile cells with different origin # Iteration: fill a region and fill the remaining parts as long as there is anything left. # Polygons not worth being considered further are dropped (last argument is nil). while !r.is_empty? c.fill_region(r, fc_index, fc_box, nil, r, fill_margin, nil) end This method has been introduced in version 0.23. void flatten(bool prune)Description: Flattens the given cell
This method propagates all shapes from the hierarchy below into the given cell. It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. If prune is set to true, these cells are removed if not used otherwise. A version of this method exists which allows to specify the number of hierarchy levels to which subcells are considered. This method has been introduced in version 0.23. void flatten(int levels,bool prune)Description: Flattens the given cell
This method propagates all shapes from the specified number of hierarchy levels below into the given cell. It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. If prune is set to true, these cells are removed if not used otherwise. This method has been introduced in version 0.23. void ghost_cell=(bool flag)Description: Sets the "ghost cell" flag See is_ghost_cell? for a description of this property. This method has been introduced in version 0.20. Python specific notes:The object exposes a writable attribute 'ghost_cell'. This is the setter. [const] bool has_prop_id?Description: Returns true, if the cell has user properties This method has been introduced in version 0.23. [const] unsigned int hierarchy_levelsDescription: Return the number of hierarchy levels below This method returns the number of call levels below the current cell. If there are no child cells, this method will return 0, if there are only direct children, it will return 1. CAUTION: this method may be expensive! Instance insert(const Instance inst)Description: Insert a cell instance given by another reference
This method allows to copy instances taken from a reference (an Instance object). This method is not suited to inserting instances from other Layouts into this cell. For this purpose, the hierarchical copy methods of Layout have to be used. It has been added in version 0.16. Instance insert(const CellInstArray cell_inst_array)Description: Insert a cell instance (array)
With version 0.16, this method returns an Instance object that represents the new instance. It's use is discouraged in readonly mode, since it invalidates other Instance references. Instance insert(const CellInstArray cell_inst_array,unsigned long property_id)Description: Insert a cell instance (array) with properties
The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. With version 0.16, this method returns an Instance object that represents the new instance. It's use is discouraged in readonly mode, since it invalidates other Instance references. [const] bool is_const_object?Description: Returns a value indicating whether the reference is a const reference Use of this method is deprecated. Use _is_const_object? instead [const] bool is_empty?Description: Returns a value indicating whether the cell is empty An empty cell is a cell not containing instances nor any shapes. This method has been introduced in version 0.20. [const] bool is_ghost_cell?Description: Returns a value indicating whether the cell is a "ghost cell" The ghost cell flag is used by the GDS reader for example to indicate that the cell is not located inside the file. Upon writing the reader can determine whether to write the cell or not. To satisfy the references inside the layout, a dummy cell is created in this case which has the "ghost cell" flag set to true. This method has been introduced in version 0.20. [const] bool is_leaf?Description: Tell if the cell is a leaf cell A cell is a leaf cell if there are no child instantiations. [const] bool is_library_cell?Description: Returns true, if the cell is a proxy cell pointing to a library cell If the cell is imported from some library, this attribute returns true. Please note, that this attribute can combine with is_pcell? for PCells imported from a library. This method has been introduced in version 0.22. [const] bool is_pcell_variant?Description: returns true, if this cell is a pcell variant this method returns true, if this cell represents a pcell with a distinct set of parameters (a PCell proxy). This also is true, if the PCell is imported from a library. Technically, PCell's imported from a library are library proxies which are pointing to PCell variant proxies. This scheme can even proceed over multiple indirections, i.e. a library using PCell's from another library. This method has been introduced in version 0.22. [const] bool is_pcell_variant?(const Instance instance)Description: Returns true, if this instance is a PCell variant This method returns true, if this instance represents a PCell with a distinct set of parameters. This method also returns true, if it is a PCell imported from a library. This method has been introduced in version 0.22. [const] bool is_proxy?Description: Returns true, if the cell presents some external entity A cell may represent some data which is imported from some other source, i.e. a library. Such cells are called "proxy cells". For a library reference, the proxy cell is some kind of pointer to the library and the cell within the library. For PCells, this data can even be computed through some script. A PCell proxy represents all instances with a given set of parameters. Proxy cells cannot be modified, except that pcell parameters can be modified and PCell instances can be recomputed. This method has been introduced in version 0.22. [const] bool is_top?Description: Tell if the cell is a top-level cell A cell is a top-level cell if there are no parent instantiations. [const] bool is_valid?(const Instance instance)Description: Test if the given Instance object is still pointing to a valid object This method has been introduced in version 0.16. If the instance represented by the given reference has been deleted, this method returns false. If however, another instance has been inserted already that occupies the original instances position, this method will return true again. Layout ptr layoutDescription: returns a reference to the layout where the cell resides this method has been introduced in version 0.22. [const] const Layout ptr layoutDescription: returns a reference to the layout where the cell resides (const references) this method has been introduced in version 0.22. [const] Library ptr libraryDescription: returns a reference to the library from which the cell is imported if the cell is not imported from a library, this reference is nil. this method has been introduced in version 0.22. [const] unsigned int library_cell_indexDescription: Returns the index of the cell in the layout of the library (if it's a library proxy) Together with the library method, it is possible to locate the source cell of a library proxy. The source cell can be retrieved from a cell "c" with c.library.layout.cell(c.library_cell_index) This cell may be itself a proxy, i.e. for pcell libraries, where the library cells are pcell variants which itself are proxies to a pcell. This method has been introduced in version 0.22. void move(unsigned int src,unsigned int dest)Description: Move the shapes from the source to the target layer
The destination layer is not overwritten. Instead, the shapes are added to the shapes of the destination layer. This method will move shapes within the cell. To move shapes from another cell this cell, use the copy method with the cell parameter. This method has been introduced in version 0.19. void move(Cell ptr src_cell,unsigned int src_layer,unsigned int dest)Description: Moves shapes from another cell to the target layern this cell
This method will move all shapes on layer 'src_layer' of cell 'src_cell' to the layer 'dest' of this cell. The destination layer is not overwritten. Instead, the shapes are added to the shapes of the destination layer. If the source cell lives in a layout with a different database unit than that current cell is in, the shapes will be transformed accordingly. The same way, shape properties are transformed as well. Note that the shape transformation may require rounding to smaller coordinates. This may result in a slight distortion of the original shapes, in particular when transforming into a layout with a bigger database unit. void move_instances(Cell source_cell)Description: Moves the instances of child cells in the source cell to this cell
The source cell must reside in the same layout than this cell. The instances of child cells inside the source cell are moved to this cell. No new cells are created, just new instances are created to already existing cells in the target cell. The instances will be added to any existing instances in the cell. More elaborate methods of moving hierarchy trees between layouts are provided through the move_tree_shapes (in cooperation with the CellMapping class) or move_tree methods. This method has been added in version 0.23. void move_shapes(Cell source_cell)Description: Moves the shapes from the given cell into this cell
All shapes are moved from the source cell to this cell. Instances are not moved. The source cell can reside in a different layout. In this case, the shapes are moved over from the other layout into this layout. Database unit conversion is done automatically if the database units differ between the layouts. Note that this may lead to grid snapping effects if the database unit of the target layout is not an integer fraction of the source layout. If source and target layout are different, the layers of the source and target layout are identified by their layer/datatype number or name (if no layer/datatype is present). The shapes will be added to any shapes already in the cell. This method has been added in version 0.23. void move_shapes(Cell source_cell,const LayerMapping layer_mapping)Description: Moves the shapes from the given cell into this cell
All shapes on layers specified in the layer mapping object are moved from the source cell to this cell. Instances are not moved. The target layer is taken from the mapping table. The shapes will be added to any shapes already in the cell. This method has been added in version 0.23. unsigned int[] move_tree(Cell source_cell)Description: Moves the cell tree of the given cell into this cell
The complete cell tree of the source cell is moved to the target cell plus all shapes in that tree are moved as well. This method will basically rebuild the cell tree of the source cell and empty the source cell. The source cell may reside in a separate layout. This method therefore provides a way to move over complete cell trees from one layout to another. The shapes and instances will be added to any shapes or instances already in the cell. This method has been added in version 0.23. void move_tree_shapes(Cell source_cell,const CellMapping cell_mapping)Description: Moves the shapes from the given cell and the cell tree below into this cell or subcells of this cell
This method is provided if source and target cell reside in different layouts. If will move the shapes from all cells below the given source cell, but use a cell mapping object that provides a specification how cells are identified between the layouts. Cells in the source tree, for which no mapping is provided, will be flattened - their shapes will be propagated into parent cells for which a mapping is provided. The cell mapping object provides various methods to map cell trees between layouts. See the CellMapping class for details about the mapping methods available. The cell mapping object is also responsible for creating a proper hierarchy of cells in the target layout if that is required. Layers are identified between the layouts by the layer/datatype number of name if no layer/datatype number is present. The shapes moved will be added to any shapes already in the cells. This method has been added in version 0.23. void move_tree_shapes(Cell source_cell,const CellMapping cell_mapping,const LayerMapping layer_mapping)Description: Moves the shapes from the given cell and the cell tree below into this cell or subcells of this cell with layer mapping
This method is provided if source and target cell reside in different layouts. If will move the shapes from all cells below the given source cell, but use a cell mapping object that provides a specification how cells are identified between the layouts. Cells in the source tree, for which no mapping is provided, will be flattened - their shapes will be propagated into parent cells for which a mapping is provided. The cell mapping object provides various methods to map cell trees between layouts. See the CellMapping class for details about the mapping methods available. The cell mapping object is also responsible for creating a proper hierarchy of cells in the target layout if that is required. In addition, the layer mapping object can be specified which maps source to target layers. This feature can be used to restrict the move operation to a subset of layers or to convert shapes to different layers in that step. The shapes moved will be added to any shapes already in the cells. This method has been added in version 0.23. [const] string nameDescription: Gets the cell's name This method has been introduced in version 0.22. Python specific notes:The object exposes a readable attribute 'name'. This is the getter. void name=(string name)Description: Renames the cell Renaming a cell may cause name clashes, i.e. the name may be identical to the name of another cell. This does not have any immediate effect, but the cell needs to be renamed, for example when writing the layout to a GDS file. This method has been introduced in version 0.22. Python specific notes:The object exposes a writable attribute 'name'. This is the setter. [static] new Cell ptr newDescription: Creates a new object of this class Python specific notes:This method is the default initializer of the object [const] unsigned long parent_cellsDescription: Report the number of parent cells The number of parent cells (cells which reference our cell) is reported. [const] const PCellDeclaration ptr pcell_declarationDescription: Returns a reference to the PCell declaration If this cell is not a PCell variant, this method returns nil. PCell variants are proxy cells which are PCell incarnations for a specific parameter set. The PCellDeclaration object allows to retrieve PCell parameter definitions for example. This method has been introduced in version 0.22. [const] const PCellDeclaration ptr pcell_declaration(const Instance instance)Description: Returns the PCell declaration of a pcell instance If the instance is not a PCell instance, this method returns nil. The PCellDeclaration object allows to retrieve PCell parameter definitions for example. This method has been introduced in version 0.22. [const] unsigned long pcell_idDescription: Returns the PCell ID if the cell is a pcell variant This method returns the ID which uniquely identifies the PCell within the layout where it's declared. It can be used to retrieve the PCell declaration or to create new PCell variants. The method will be rarely used. It's more convenient to use pcell_declaration to directly retrieve the PCellDeclaration object for example. This method has been introduced in version 0.22. [const] Library ptr pcell_libraryDescription: Returns the library where the PCell is declared if this cell is a PCell and it is not defined locally. A PCell often is not declared within the current layout but in some library. This method returns a reference to that library, which technically is the last of the chained library proxies. If this cell is not a PCell or it is not located in a library, this method returns nil. This method has been introduced in version 0.22. [const] variant[] pcell_parametersDescription: Returns the PCell parameters for a pcell variant If the cell is a PCell variant, this method returns a list of values for the PCell parameters. If the cell is not a PCell variant, this method returns an empty list. This method also returns the PCell parameters if the cell is a PCell imported from a library. This method has been introduced in version 0.22. [const] variant[] pcell_parameters(const Instance instance)Description: Returns the PCell parameters for a pcell instance If the given instance is a PCell instance, this method returns a list of values for the PCell parameters. If the instance is not a PCell instance, this method returns an empty list. This method has been introduced in version 0.22. [const] map<string,variant> pcell_parameters_by_nameDescription: Returns the PCell parameters for a pcell variant as a name to value dictionary If the cell is a PCell variant, this method returns a dictionary of values for the PCell parameters with the parameter names as the keys. If the cell is not a PCell variant, this method returns an empty dictionary. This method also returns the PCell parameters if the cell is a PCell imported from a library. This method has been introduced in version 0.24. [const] map<string,variant> pcell_parameters_by_name(const Instance instance)Description: Returns the PCell parameters for a pcell instance as a name to value dictionary If the given instance is a PCell instance, this method returns a dictionary of values for the PCell parameters with the parameter names as the keys. If the instance is not a PCell instance, this method returns an empty dictionary. This method has been introduced in version 0.24. [const] unsigned long prop_idDescription: Gets the properties ID associated with the cell This method has been introduced in version 0.23. Python specific notes:The object exposes a readable attribute 'prop_id'. This is the getter. void prop_id=(unsigned long id)Description: Sets the properties ID associated with the cell This method is provided, if a properties ID has been derived already. Usually it's more convenient to use delete_property, set_property or property. This method has been introduced in version 0.23. Python specific notes:The object exposes a writable attribute 'prop_id'. This is the setter. variant property(variant key)Description: Gets the user property with the given key This method is a convenience method that gets the property with the given key. If no property with that key exists, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. This method has been introduced in version 0.23. void prune_cellDescription: Deletes the cell plus subcells not used otherwise This deletes the cell and also all sub cells of the cell which are not used otherwise. All instances of this cell are deleted as well. A version of this method exists which allows to specify the number of hierarchy levels to which subcells are considered. After the cell has been deleted, the Cell object becomes invalid. Do not access methods or attributes of this object after deleting the cell. This method has been introduced in version 0.23. void prune_cell(int levels)Description: Deletes the cell plus subcells not used otherwise
This deletes the cell and also all sub cells of the cell which are not used otherwise. The number of hierarchy levels to consider can be specified as well. One level of hierarchy means that only the direct children of the cell are deleted with the cell itself. All instances of this cell are deleted as well. After the cell has been deleted, the Cell object becomes invalid. Do not access methods or attributes of this object after deleting the cell. This method has been introduced in version 0.23. void prune_subcellsDescription: Deletes all sub cells of the cell which are not used otherwise This deletes all sub cells of the cell which are not used otherwise. All instances of the deleted cells are deleted as well. A version of this method exists which allows to specify the number of hierarchy levels to which subcells are considered. This method has been introduced in version 0.23. void prune_subcells(int levels)Description: Deletes all sub cells of the cell which are not used otherwise down to the specified level of hierarchy
This deletes all sub cells of the cell which are not used otherwise. All instances of the deleted cells are deleted as well. It is possible to specify how many levels of hierarchy below the given root cell are considered. This method has been introduced in version 0.23. void refreshDescription: Refreshes the cell If the cell is a PCell or a proxy to a PCell in a library, this method recomputes the PCell. If the cell is a library proxy, this method reloads the information from the library, but not the library itself. This method has been introduced in version 0.22. Instance replace(const Instance instance,const CellInstArray cell_inst_array)Description: Replace a cell instance (array) with a different one
This method has been introduced in version 0.16. It can only be used in editable mode. The instance given by the instance object (first argument) is replaced by the given instance (second argument). The new object will not have any properties. Instance replace(const Instance instance,const CellInstArray cell_inst_array,unsigned long property_id)Description: Replace a cell instance (array) with a different one with properties
This method has been introduced in version 0.16. It can only be used in editable mode. The instance given by the instance object (first argument) is replaced by the given instance (second argument) with the given properties Id. The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. The new object will not have any properties. Instance replace_prop_id(const Instance instance,unsigned long property_id)Description: Replace (or install) the properties of a cell
This method has been introduced in version 0.16. It can only be used in editable mode. Changes the properties Id of the given instance or install a properties Id on that instance if it does not have one yet. The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. void set_property(variant key,variant value)Description: Set the user property with the given key to the given value This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. This method has been introduced in version 0.23. Shapes shapes(unsigned int layer_index)Description: Return the shapes list of the given layer
This method allows to access the shapes list on a certain layer. If the layer does not exist yet, it is created. void swap(unsigned int layer_index1,unsigned int layer_index2)Description: Swap the layers given This method swaps two layers inside this cell. Instance transform(const Instance instance,const Trans trans)Description: Transform the instance with the given transformation
This method has been introduced in version 0.16. The original instance may be deleted and re-inserted by this method. Therefore, a new reference is returned. It is permitted in editable mode only. Instance transform(const Instance instance,const CplxTrans trans)Description: Transform the instance with the given complex transformation
This method has been introduced in version 0.16. The original instance may be deleted and re-inserted by this method. Therefore, a new reference is returned. It is permitted in editable mode only. Instance transform(const Instance instance,const ICplxTrans trans)Description: Transform the instance with the given complex integer transformation
This method has been introduced in version 0.23. The original instance may be deleted and re-inserted by this method. Therefore, a new reference is returned. It is permitted in editable mode only. Instance transform_into(const Instance instance,const Trans trans)Description: Transform the instance into a new coordinate system with the given transformation
In contrast to the transform method, this method allows propagation of the transformation into child cells. More precisely: it applies just a part of the given transformation to the instance, such that when transforming the cell instantiated and it's shapes with the same transformation, the result will reflect the desired transformation. Mathematically spoken, the transformation of the instance (A) is transformed with the given transformation T using "A' = T * A * Tinv" where Tinv is the inverse of T. In effect, the transformation T commutes with the new instance transformation A' and can be applied to child cells as well. This method is therefore useful to transform a hierarchy of cells. This method has been introduced in version 0.23. The original instance may be deleted and re-inserted by this method. Therefore, a new reference is returned. It is permitted in editable mode only. Instance transform_into(const Instance instance,const CplxTrans trans)Description: Transform the instance into a new coordinate system with the given complex transformation
See the comments for the simple-transformation version for a description of this method. This method has been introduced in version 0.23. The original instance may be deleted and re-inserted by this method. Therefore, a new reference is returned. It is permitted in editable mode only. Instance transform_into(const Instance instance,const ICplxTrans trans)Description: Transform the instance into a new coordinate system with the given complex integer transformation
See the comments for the simple-transformation version for a description of this method. This method has been introduced in version 0.23. The original instance may be deleted and re-inserted by this method. Therefore, a new reference is returned. It is permitted in editable mode only. void transform_into(const Trans trans)Description: Transform the cell into a new coordinate system with the given transformation This method transforms all instances and all shapes. The instances are transformed in a way that allows propagation of the transformation into child cells. For this, it applies just a part of the given transformation to the instance such that when transforming the shapes of the cell instantiated, the result will reflect the desired transformation. Mathematically spoken, the transformation of the instance (A) is transformed with the given transformation T using "A' = T * A * Tinv" where Tinv is the inverse of T. In effect, the transformation T commutes with the new instance transformation A' and can be applied to child cells as well. This method is therefore useful to transform a hierarchy of cells. It has been introduced in version 0.23. void transform_into(const ICplxTrans trans)Description: Transform the cell into a new coordinate system with the given complex integer transformation See the comments for the simple-transformation version for a description of this method. This method has been introduced in version 0.23. [const] void write(string file_name)Description: Writes the cell to a layout file The format of the file will be determined from the file name. Only the cell and it's subtree below will be saved. This method has been introduced in version 0.23. [const] void write(string file_name,const SaveLayoutOptions options)Description: Writes the cell to a layout file The format of the file will be determined from the file name. Only the cell and it's subtree below will be saved. In contrast to the other 'write' method, this version allows to specify save options, i.e. scaling etc. This method has been introduced in version 0.23. |