pin() method#
- Design.pin(name, grid, mn, direction=None, netname=None, params=None)[source]#
Create a Pin object over the abstract coordinates specified by mn, on the specified routing grid.
- Parameters:
name (str) – Pin name.
mn (numpy.ndarray) – Abstract coordinates for generating Pin.
direction (str, optional.) – Direction.
netname (str, optional.) – Net name of Pin.
params (dict, optional) – Pin attributes.
- Returns:
laygo2.physical.Pin
- Return type:
The generated pin object.
Example
>>> import laygo2 >>> from laygo2.object.grid import CircularMapping as CM >>> from laygo2.object.grid import CircularMappingArray as CMA >>> from laygo2.object.grid import OneDimGrid, RoutingGrid >>> from laygo2.object.template import NativeInstanceTemplate >>> from laygo2.object.database import Design >>> from laygo2.object.physical import Instance >>> # Routing grid construction (not needed if laygo2_tech is set up). >>> gv = OneDimGrid(name="gv", scope=[0, 50], elements=[0]) >>> gh = OneDimGrid(name="gv", scope=[0, 100], elements=[0, 40, 60]) >>> wv = CM([10]) # vertical (xgrid) width >>> wh = CM([20, 10, 10]) # horizontal (ygrid) width >>> ev = CM([10]) # vertical (xgrid) extension >>> eh = CM([10, 10, 10]) # horizontal (ygrid) extension >>> e0v = CM([15]) # vert. extension (for zero-length wires) >>> e0h = CM([15, 15, 15]) # hori. extension (for zero-length wires) >>> lv = CM([['M1', 'drawing']], dtype=object) # layer information >>> lh = CM([['M2', 'drawing']]*3, dtype=object) >>> plv = CM([['M1', 'pin']], dtype=object) # pin layers >>> plh = CM([['M2', 'pin']]*3, dtype=object) >>> xcolor = CM([None], dtype=object) # Not multipatterned >>> ycolor = CM([None]*3, dtype=object) >>> primary_grid = 'horizontal' >>> tvia = NativeInstanceTemplate(libname='tlib', cellname='via0') # via >>> viamap = CMA(elements=[[tvia, tvia, tvia]], dtype=object) >>> g = laygo2.object.grid.RoutingGrid(name='mygrid', vgrid=gv, hgrid=gh, vwidth=wv, hwidth=wh, vextension=ev, hextension=eh, vlayer=lv, hlayer=lh, pin_vlayer=plv, pin_hlayer=plh, viamap=viamap, primary_grid=primary_grid, xcolor=xcolor, ycolor=ycolor, vextension0=e0v, hextension0=e0h) >>> # Create a design >>> dsn = Design(name="mycell", libname="genlib") >>> ############### >>> # Place a pin # >>> ############### >>> mn = [[0, 0], [10, 10]] >>> pin = dsn.pin(name="pin", grid=g, mn=mn) >>> print(pin) <laygo2.object.physical.Pin object at 0x0000028DABE3AB90> name: pin, class: Pin, xy: [[0, -10], [500, 350]], params: None, , layer: ['M2' 'pin'], netname: pin, shape: None, master: None >>> print(dsn) <laygo2.object.database.Design object at 0x0000028DABE3A110> name: mycell, params: None elements: {'pin': <laygo2.object.physical.Pin object at 0x0000028DABE3AB90>} libname:genlib rects:{} paths:{} pins:{'pin': <laygo2.object.physical.Pin object at 0x0000028DABE3AB90>} texts:{} instances:{} virtual instances:{}