PhysicalObject class#
- class laygo2.object.physical.PhysicalObject(xy, name=None, params=None)[source]#
Bases:
object
Base class for physical layout objects with physical coordinate info.
Public Data Attributes:
Object name.
Physical coordinate values of the object in the form of [bottom_left, top_right].
Master ojbect for current object (for arrays and pins).
Dictionary storing the parameters associated with the object
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.
The left-center coordinate of the object.
The right-center coordinate of the object.
The top-center coordinate of the object.
The bottom-center coordinate of the object.
The center-center coordinate of the object.
The bottom-left coordinate of the object.
The bottom-right coordinate of the object.
The top-left coordinate of the object.
The top-right coordinate of the object.
The physical bounding box of the object.
Public Methods:
- __init__(xy, name=None, params=None)[source]#
The constructor function.
- Parameters:
xy (numpy.ndarray) – Physical coordinate values of the object in the form of [bottom_left, top_right].
name (str) – Object name.
params (dict) – Dictionary storing the parameters associated with the object.
- Return type:
Example
>>> import laygo2 >>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]], name="test", params={'maxI': 0.005}) >>> print(obj) <laygo2.object.physical.PhysicalObject object at 0x000001ECF0022948> name: test, class: PhysicalObject, xy: [[0, 0], [200, 200]], params: {'maxI': 0.005},
- _update_pointers()[source]#
The internal function that updates the object’s pointers after a change in its physical coordinates.
- _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]])
- Type:
- 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])
- Type:
- 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])
- Type:
- 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])
- Type:
- 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])
- Type:
- 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])
- Type:
- 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:
- 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”
- Type:
- 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:
- 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] ) }
- Type:
- 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])
- Type:
- 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])
- Type:
- 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])
- Type:
- 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])
- Type:
- property xy#
Physical coordinate values of the object in the form of [bottom_left, top_right].
Example
>>> import laygo2 >>> obj = laygo2.object.physical.PhysicalObject(xy = [[0, 0], [200, 200]], name="test", params={'maxI': 0.005}) >>> obj.xy array([[ 0, 0], [200, 200]])
- Type: