route_via_track() method#

Design.route_via_track(grid, mn, track, via_tag=[None, True])[source]#

Perform routing on the specified track with accessing wires to mn.

Parameters:
  • grid (laygo2.object.grid.RoutingGrid) – The placement grid where the wire is placed on.

  • mn (list(numpy.ndarray)) – list containing coordinates of the points being connected through a track

  • track (numpy.ndarray) – list containing coordinate values and direction of a track. Vertical tracks have [v, None] format, while horizontal tracks have [None, v] format (v is the coordinates of the track).

  • via_tag (list(Boolean), optional.) – The list containing switches deciding whether to place via at the edges of individual stubs.

Returns:

The list containing the generated routing objects; The last object corresponds to the routing object on the track.

Return type:

list

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")
>>> # Do routing
>>> mn_list = [[0, -2], [1, 0], [2, 5], [3, 4], [4, 5], [5, 5]]
>>> track = dsn.route_via_track(grid=g, mn=mn_list, track=[None,0])
>>> # Display design
>>> print(dsn)
    <laygo2.object.database.Design object at 0x0000015A77C6BA60>
    name: mycell, params: None
    elements: {
    'NoName_0': <laygo2.object.physical.Rect object at 0x0000015A77C6B790>,
    'NoName_1': <laygo2.object.physical.Instance object at 0x0000015A77C6B820>,
    'NoName_2': <laygo2.object.physical.Instance object at 0x0000015A77C6B7C0>,
    'NoName_3': <laygo2.object.physical.Rect object at 0x0000015A77C6B760>,
    'NoName_4': <laygo2.object.physical.Instance object at 0x0000015A77C6A2F0>,
    'NoName_5': <laygo2.object.physical.Rect object at 0x0000015A77C6BA90>}
    libname:genlib
    rects:{
    'NoName_0': <laygo2.object.physical.Rect object at 0x0000015A77C6B790>,
    'NoName_3': <laygo2.object.physical.Rect object at 0x0000015A77C6B760>,
    'NoName_5': <laygo2.object.physical.Rect object at 0x0000015A77C6BA90>}
    paths:{}
    pins:{}
    texts:{}
    instances:{
    'NoName_1': <laygo2.object.physical.Instance object at 0x0000015A77C6B820>,
    'NoName_2': <laygo2.object.physical.Instance object at 0x0000015A77C6B7C0>,
    'NoName_4': <laygo2.object.physical.Instance object at 0x0000015A77C6A2F0>}
    virtual instances:{}
>>> print(track[-1])
    <laygo2.object.physical.Rect object at 0x0000015A77C6BA90>
    name: None,
    class: Rect,
    xy: [[0, 0], [100, 0]],
    params: None, , layer: ['M2' 'drawing'], netname: None
_images/object_grid_RoutingGrid_route_via_track.png