Pin class#
- class laygo2.object.physical.Pin(xy, layer, name=None, netname=None, params=None, master=None, elements=None)[source]#
Bases:
laygo2.object.physical.IterablePhysicalObject
Pin object class.
Example
>>> from laygo2.object.physical import Pin >>> pin0 = Pin(xy=[[0, 0], [100, 100]], layer=['M1', 'drawing'], netname='net0', params={'direction': 'input'}) >>> print(pin0) <laygo2.object.physical.Pin object at 0x000002049A77FF70> name: None, class: Pin, xy: [[0, 0], [100, 100]], params: {'direction': 'input'}, , layer: ['M1' 'drawing'], netname: net0, shape: None, master: None
Notes
(Korean): Pin 객체 클래스.
Public Data Attributes:
The physical layer information of the object, represented as a list with two elements: [name, purpose].
The net name associated with the object.
The instance that the pin belongs to.
The height of the object.
The width of the object.
The size of the object.
The height direction vector [0, self.height] of the object.
The width direction vector [self.width, 0] of the object.
Inherited from
IterablePhysicalObject
Numpy array containing its element objects.
Retrive x,y coordinate values of the object.
Array size of the object.
Inherited from
PhysicalObject
Object name.
Retrive x,y coordinate values of the object.
The instance that the pin belongs to.
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, layer[, name, netname, params, ...])The constructor function.
Get object information summary.
Inherited from
IterablePhysicalObject
__init__
(xy, layer[, name, netname, params, ...])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.
Enumerate over the element array.
Inherited from
PhysicalObject
__init__
(xy, layer[, name, netname, params, ...])The constructor function.
__str__
()Return the summary of the object information.
Get object information summary.
- __init__(xy, layer, name=None, netname=None, params=None, master=None, elements=None)[source]#
The constructor function.
- Parameters
xy (numpy.ndarray) – Physical coordinate values of the object in the form of [bottom_left, top_right].
layer (list) – The physical layer information of the object, represented as a list with two elements: [name, purpose].
name (str) – Object name.
netname (str) – The net name associated with the object.
params (dict) – Dictionary storing the parameters associated with the object.
- Return type
Example
>>> import laygo2 >>> pin0 = laygo2.object.physical.Pin(xy=[[0, 0], [100, 100]], layer=['M1', 'drawing'], netname='net0', params={'direction': 'input'}) >>> print(pin0) <laygo2.object.physical.Pin object at 0x000002049A77FF70> name: None, class: Pin, xy: [[0, 0], [100, 100]], params: {'direction': 'input'}, , layer: ['M1' 'drawing'], netname: net0, shape: None, master: None
Notes
(Korean): Pin 클래스의 생성자 함수
- 파라미터
xy(numpy.ndarray): 객체의 물리적 좌표 (bbox).
layer(list): 객체의 layer 정보 ([name, purpose]).
name(str): 객체의 이름.
netname(str): 객체의 노드 명.
params(dict): 객체의 주요 속성을 갖는 dict.
- _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.
- _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]])
Notes
(Korean): numpy.ndarray: 객체의 bbox (bounding box).
- 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
- 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)
Notes
(Korean): 객체의 하위 구성원을 담고 있는 list.
- Type
- property height#
The height of the object.
Example
>>> import laygo2 >>> pin0 = laygo2.object.physical.Pin(xy=[[0, 0], [100, 100]], layer=['M1', 'drawing'], netname='net0', params={'direction': 'input'}) >>> pin0.height 100
Notes
(Korean): 객체의 높이.
- Type
- property height_vec#
The height direction vector [0, self.height] of the object.
- Type
numpy.ndarray(dtype=int)
- layer = None#
The physical layer information of the object, represented as a list with two elements: [name, purpose].
Example
>>> import laygo2 >>> pin0 = laygo2.object.physical.Pin(xy=[[0, 0], [100, 100]], layer=['M1', 'drawing'], netname='net0', params={'direction': 'input'}) >>> pin0.layer ['M1', 'drawing']
numpy.ndarray: 객체의 layer 정보 [name, purpose].
- 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
- 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
- netname = None#
The net name associated with the object.
Example
>>> import laygo2 >>> pin0 = laygo2.object.physical.Pin(xy=[[0, 0], [100, 100]], layer=['M1', 'drawing'], netname='net0', params={'direction': 'input'}) >>> pin0.netname “net0”
str: 객체의 노드 명.
- 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 }
Notes
(Korean): 객체의 속성.
- 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] ) }
Notes
(Korean): 객체의 주요 좌표들을 담고 있는 dictionary.
- 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
- 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])
Notes
(Korean): numpy.ndarray: 객체의 element의 배열 크기.
- property size#
The size of the object.
Example
>>> import laygo2 >>> pin0 = laygo2.object.physical.Pin(xy=[[0, 0], [100, 100]], layer=['M1', 'drawing'], netname='net0', params={'direction': 'input'}) >>> pin0.size [100, 100]
Notes
(Korean): 객체의 크기.
- 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 width#
The width of the object.
Example
>>> import laygo2 >>> pin0 = laygo2.object.physical.Pin(xy=[[0, 0], [100, 100]], layer=['M1', 'drawing'], netname='net0', params={'direction': 'input'}) >>> pin0.width 100
Notes
(Korean): 객체의 폭.
- Type
- property width_vec#
The width direction vector [self.width, 0] of the object.
- Type
numpy.ndarray(dtype=int)
- property xy#
Retrive x,y coordinate values of the object.
- Type
numpy.ndarray(dtype=numpy.int)