PhysicalObjectGroup class#

class laygo2.object.physical.PhysicalObjectGroup(xy, name=None, params=None, elements=None)[source]#

Bases: IterablePhysicalObject

A class for grouped physical objects, designed to be generated as a group in Cadence Virtuoso (currently not implemented).

Public Data Attributes:

Inherited from IterablePhysicalObject

elements

Numpy array containing its element objects.

xy

Retrive x,y coordinate values of the object.

shape

Array size of the object.

Inherited from PhysicalObject

name

Object name.

xy

Physical coordinate values of the object in the form of [bottom_left, top_right].

master

Master ojbect for current object (for arrays and pins).

params

Dictionary storing the parameters associated with the object

pointers

The dictionary containing the key-value pairs of the major physical coordinates of the object, such as 'left', 'right', 'top', 'bottom', 'bottom_left', 'center', etc.

left

The left-center coordinate of the object.

right

The right-center coordinate of the object.

top

The top-center coordinate of the object.

bottom

The bottom-center coordinate of the object.

center

The center-center coordinate of the object.

bottom_left

The bottom-left coordinate of the object.

bottom_right

The bottom-right coordinate of the object.

top_left

The top-left coordinate of the object.

top_right

The top-right coordinate of the object.

bbox

The physical bounding box of the object.

Public Methods:

summarize()

Get object information summary.

__init__(xy[, name, params, elements])

The constructor function.

Inherited from IterablePhysicalObject

__init__(xy[, name, params, elements])

The constructor function.

__getitem__(pos)

Return the sub-elements of the object, based on the pos parameter.

__setitem__(pos, item)

Update the sub-elements of the object, based on the pos and item parameters.

__iter__()

Iterator that maps directly to the elements attribute of this object.

__next__()

Iterator that maps directly to the iterator function of the elements attribute of this object.

ndenumerate()

Enumerate over the element array.

Inherited from PhysicalObject

__init__(xy[, name, params])

The constructor function.

__str__()

Return the summary of the object information.

summarize()

Return the summary of the object information.


__init__(xy, name=None, params=None, elements=None)[source]#

The constructor function.

Parameters:
  • xy (numpy.ndarray(dtype=int)) – The coordinate of this object represented as a Numpy array [x, y].

  • name (str, optional) – The name of the object.

  • params (dict or None) – The dictionary that contains the parameters of this object, with parameter names as keys.

  • elements (numpy.ndarray(dtype=LayoutObject) or None) – The iterable elements of the object.

_get_xy()#

numpy.ndarray(dtype=numpy.int): Retrive x,y coordinate values of the object.

_set_xy(value)#

numpy.ndarray(dtype=numpy.int): Update x,y coordinates of the object.

_update_elements(xy_ofst)#

Update the xy coordinates of the elements of this object, used internally by the _set_xy() function.

_update_pointers()#

The internal function that updates the object’s pointers after a change in its physical coordinates.

ndenumerate()#

Enumerate over the element array. Calls np.ndenumerate() of the elements of this object.

summarize()[source]#

Get object information summary.

_xy = array([0, 0])#

The x and y coordinate values stored within.

Type:

numpy.ndarray(dtype=numpy.int)

property bbox#

The physical bounding box of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.bbox
array([[  0,   0],
       [200, 200]])
_images/object_physical_PhysicalObject_bbox.png
Type:

numpy.ndarray

bottom = None#

The bottom-center coordinate of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.top
array([100,   0])
_images/object_physical_PhysicalObject_bottom.png
Type:

numpy.ndarray

bottom_left = None#

The bottom-left coordinate of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.bottom_left
array([  0,   0])
_images/object_physical_PhysicalObject_bottom_left.png
Type:

numpy.ndarray

bottom_right = None#

The bottom-right coordinate of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.bottom_right
array([200,   0])
_images/object_physical_PhysicalObject_bottom_right.png
Type:

numpy.ndarray

center = None#

The center-center coordinate of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.center
array([100, 100])
_images/object_physical_PhysicalObject_center.png
Type:

numpy.ndarray

elements = None#

Numpy array containing its element objects.

Example

>>> import laygo2
>>> phy0 = laygo2.object.physical.PhysicalObject(xy=[[0, 0], [100, 100]])
>>> phy1 = laygo2.object.physical.PhysicalObject(xy=[[0, 0], [200, 200]])
>>> phy2 = laygo2.object.physical.PhysicalObject(xy=[[0, 0], [300, 300]])
>>> element = [phy0, phy1, phy2]
>>> iphy0 = laygo2.object.physical.IterablePhysicalObject(
        xy=[[0, 0], [300, 300]], elements = elements)
>>> iphy0.elements
array([<laygo2.object.physical.PhysicalObject object at 0x000002049A77FDF0>,
       <laygo2.object.physical.PhysicalObject object at 0x000002049A77F3D0>,
       <laygo2.object.physical.PhysicalObject object at 0x000002049A77FF40>],
      dtype=object)
Type:

dict

left = None#

The left-center coordinate of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.left
array([  0, 100])
_images/object_physical_PhysicalObject_left.png
Type:

numpy.ndarray

master = None#

Master ojbect for current object (for arrays and pins).

Example

>>> import laygo2
>>> obj1 = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]],
        name="test1", params=None)
>>> obj2 = laygo2.object.physical.Pin(xy = [[0, 0], [100, 100]],
        layer = ["M1", "drawing"], master=obj1)
>>> obj2.master
<laygo2.object.physical.PhysicalObject object at 0x00000204AAF3C7C0>
Type:

numpy.ndarray

name = None#

Object name.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]],
        name="test", params={'maxI': 0.005})
>>> obj.name
“test”
_images/object_physical_PhysicalObject_name.png
Type:

str

params = None#

Dictionary storing the parameters associated with the object

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]],
        name="test", params={'maxI': 0.005})
>>> obj.params
{‘maxI’: 0.005 }
Type:

dict

pointers = None#

The dictionary containing the key-value pairs of the major physical coordinates of the object, such as ‘left’, ‘right’, ‘top’, ‘bottom’, ‘bottom_left’, ‘center’, etc.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.pointers
{'left': array([0, 100]), 'right': array([200, 100]),
 'bottom': array([100, 0]), 'top': array([100, 200]),
 'bottom_left': array([0, 0]), 'bottom_right': array([200, 0]),
 'top_left': array([0, 200]), 'top_right': array([200, 200]),
 ‘center’: array( [100, 100] )
}
_images/object_physical_PhysicalObject_pointers.png
Type:

dict

right = None#

The right-center coordinate of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.right
array([200, 100])
_images/object_physical_PhysicalObject_right.png
Type:

numpy.ndarray

property shape#

Array size of the object.

Example

>>> import laygo2
>>> phy0 = laygo2.object.physical.PhysicalObject(xy=[[0, 0], [100, 100]])
>>> phy1 = laygo2.object.physical.PhysicalObject(xy=[[0, 0], [200, 200]])
>>> phy2 = laygo2.object.physical.PhysicalObject(xy=[[0, 0], [300, 300]])
>>> element = [phy0, phy1, phy2]
>>> iphy0 = laygo2.object.physical.IterablePhysicalObject(
    xy=[[0, 0], [300, 300]], elements = elements)
>>> iphy0.shape
array([3])
top = None#

The top-center coordinate of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.top
array([100, 200])
_images/object_physical_PhysicalObject_top.png
Type:

numpy.ndarray

top_left = None#

The top-left coordinate of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.top_left
array([  0, 200])
_images/object_physical_PhysicalObject_top_left.png
Type:

numpy.ndarray

top_right = None#

The top-right coordinate of the object.

Example

>>> import laygo2
>>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]])
>>> obj.top_right
array([200, 200])
_images/object_physical_PhysicalObject_top_right.png
Type:

numpy.ndarray

property xy#

Retrive x,y coordinate values of the object.

Type:

numpy.ndarray(dtype=numpy.int)