via() method#

Design.via(grid, mn, params=None)[source]#

Create Via object(s) on abstract grid.

Parameters:

mn (list(numpy.ndarray)) – Abstract coordinate(s) that specify location(s) to insert via(s).

Returns:

The list containing the generated via objects.

Return type:

list(physical.PhysicalObject)

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')
>>> 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 vias #
>>> ##############
>>> mn_list = [[0, -2], [1, 0], [2, 5]]
>>> via = dsn.via(grid=g, mn=mn_list)
>>> # Display generated design.
>>> print(dsn)
<laygo2.object.database.Design object at 0x0000015A77C6A110>
name: mycell, params: None,
elements: {
'NoName_0': <laygo2.object.physical.Instance object at 0x0000015A77C6AC20>,
'NoName_1': <laygo2.object.physical.Instance object at 0x0000015A77C6AD10>,
'NoName_2': <laygo2.object.physical.Instance object at 0x0000015A77C6AD40>}
libname:genlib
rects:{}
paths:{}
pins:{}
texts:{}
instances:{
'NoName_0': <laygo2.object.physical.Instance object at 0x0000015A77C6AC20>,
'NoName_1': <laygo2.object.physical.Instance object at 0x0000015A77C6AD10>,
'NoName_2': <laygo2.object.physical.Instance object at 0x0000015A77C6AD40>}
virtual instances:{}
_images/object_grid_RoutingGrid_via.png