Class Cell (version 0.18)

Description: The cell object

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.

Class overview

Index

Method Overview

ref Shapes shapes( unsigned int )Return the shapes list of the given layer
clear_shapesClear all shapes in the cell
clear_instsClear the instance list
erase( Instance inst )Erase the instance given by the Instance object
swap( unsigned int layer_index1, unsigned int layer_index2 )Swap the layers given
clear( unsigned int layer_index )Clear the shapes on the given layer
Instance replace_prop_id( Instance instance, unsigned int property_id )Replace (or install) the properties of a cell
Instance transform( Instance instance, Trans trans )Transform the instance given by the instance with the given transformation
Instance transform( Instance instance, CplxTrans trans )Transform the instance given by the instance with the given complex transformation
Instance replace( Instance instance, CellInstArray cell_inst_array )Replace a cell instance (array) with a different one
Instance replace( Instance instance, CellInstArray cell_inst_array, unsigned int property_id )Replace a cell instance (array) with a different one with properties
Instance insert( Instance inst )Insert a cell instance given by another reference
Instance insert( CellInstArray cell_inst_array )Insert a cell instance (array)
Instance insert( CellInstArray cell_inst_array, unsigned int property_id )Insert a cell instance (array) with properties
[const] unsigned int cell_indexThe cell index accessor method
[const] unsigned int child_instancesNumber of child instances
[const] const ref Box bboxRetrieve the bounding box of the cell
[const] const ref Box bbox_per_layer( unsigned int layer_index )Retrieve the per-layer bounding box of the cell
yield Instance each_overlapping_inst( Box b )Region query for the instances in "overlapping" mode
yield Instance each_touching_inst( Box b )Region query for the instances in "touching" mode
yield unsigned int each_child_cellIterate over all child cells
[const] unsigned int child_cellsReport the number of child cells
yield Instance each_instIterate over all child instances (which may actually be instance arrays)
yield ParentInstArray each_parent_instIterate over the parent instance list (which may actually be instance arrays)
[const] unsigned int parent_cellsReport the number of parent cells
[const] yield unsigned int each_parent_cellIterate over all parent cells
[const] bool is_top?Tell if the cell is a top-level cell
[const] bool is_leaf?Tell if the cell is a leaf cell
[const] bool is_valid?( Instance instance )Test if the given Instance object is still pointing to a valid object
[const] yield Shape each_shape( unsigned int layer_index, unsigned int flags )Iterate all shapes of a given layer
[const] yield Shape each_shape( unsigned int layer_index )Iterate all shapes of a given layer
[const] yield Shape each_touching_shape( unsigned int layer_index, Box box, unsigned int flags )Iterate all shapes of a given layer that touch the given box
[const] yield Shape each_touching_shape( unsigned int layer_index, Box box )Iterate all shapes of a given layer that touch the given box
[const] yield Shape each_overlapping_shape( unsigned int layer_index, Box box, unsigned int flags )Iterate all shapes of a given layer that overlap the given box
[const] yield Shape each_overlapping_shape( unsigned int layer_index, Box box )Iterate all shapes of a given layer that overlap the given box
[const] unsigned int hierarchy_levelsReturn the number of hierarchy levels below (expensive)
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

[const] const ref Box bbox

Description: Retrieve the bounding box of the cell

returns:The bounding box of the cell

[const] const ref Box bbox_per_layer( unsigned int layer_index )

Description: Retrieve the per-layer bounding box of the cell

returns:The bounding box of the cell considering only the given layer

[const] unsigned int cell_index

Description: The cell index accessor method

returns:The cell index of the cell

[const] unsigned int child_cells

Description: Report the number of child cells

The number of child cells (not child instances!) is reported. CAUTION: this method is SLOW!

[const] unsigned int child_instances

Description: Number of child instances

returns:Returns the number of cell instances

clear( unsigned int layer_index )

Description: Clear the shapes on the given layer

clear_insts

Description: Clear the instance list

clear_shapes

Description: Clear all shapes in the cell

destroy

Description: Explicitly destroy the object

Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.

[const] bool destroyed

Description: Tell, if the object was 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.

yield unsigned int each_child_cell

Description: Iterate over all child cells

This iterator will report the child cell indices, not every instance.

yield Instance each_inst

Description: 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.

yield Instance each_overlapping_inst( 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.

b:The region to query

[const] yield Shape each_overlapping_shape( unsigned int layer_index, Box box, unsigned int flags )

Description: Iterate all shapes of a given layer that overlap the given box

flags:An "or"-ed combination of the s_.. constants of the Shapes class
box:The box by which to query the shapes
layer_index:The layer on which to run the query

[const] yield Shape each_overlapping_shape( unsigned int layer_index, 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::s_all). This convenience method has been introduced in version 0.16.

box:The box by which to query the shapes
layer_index:The layer on which to run the query

[const] yield unsigned int each_parent_cell

Description: Iterate over all parent cells

This iterator will iterate over the parent cells, just returning their cell index.

yield ParentInstArray each_parent_inst

Description: Iterate over the parent instance list (which may actually be instance arrays)

[const] yield 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'.

flags:An "or"-ed combination of the s_.. constants of the Shapes class
layer_index:The layer on which to run the query

[const] yield 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::s_all). This convenience method has been introduced in version 0.16.

layer_index:The layer on which to run the query

yield Instance each_touching_inst( 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.

b:The region to query

[const] yield Shape each_touching_shape( unsigned int layer_index, 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::s_all). This convenience method has been introduced in version 0.16.

box:The box by which to query the shapes
layer_index:The layer on which to run the query

[const] yield Shape each_touching_shape( unsigned int layer_index, Box box, unsigned int flags )

Description: Iterate all shapes of a given layer that touch the given box

flags:An "or"-ed combination of the s_.. constants of the Shapes class
box:The box by which to query the shapes
layer_index:The layer on which to run the query

erase( 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.

[const] unsigned int hierarchy_levels

Description: Return the number of hierarchy levels below (expensive)

Instance insert( Instance inst )

Description: Insert a cell instance given by another reference

This method allows to copy instances taken from a reference (an Instance object). It has been added in version 0.16.

returns:An Instance object representing the new instance

Instance insert( 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.

returns:An Instance object representing the new instance

Instance insert( CellInstArray cell_inst_array, unsigned int 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.

returns:An Instance object representing the new instance

[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_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?( 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.

[const] unsigned int parent_cells

Description: Report the number of parent cells

The number of parent cells (cells which reference our cell) is reported.

Instance replace( Instance instance, 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.

returns:An Instance object representing the new instance

Instance replace( Instance instance, CellInstArray cell_inst_array, unsigned int 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.

returns:An Instance object representing the new instance

Instance replace_prop_id( Instance instance, unsigned int 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.

returns:An Instance object representing the new instance

ref Shapes shapes( unsigned int )

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.

index:The layer index of the shapes list to retrieve
returns:A reference to the shapes list

swap( unsigned int layer_index1, unsigned int layer_index2 )

Description: Swap the layers given

Instance transform( Instance instance, Trans trans )

Description: Transform the instance given by 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.

returns:A reference (an Instance object) to the new instance

Instance transform( Instance instance, CplxTrans trans )

Description: Transform the instance given by 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.

returns:A reference (an Instance object) to the new instance