laygo2.interface.skill module#

This module implements interface with virtuoso in skill language

laygo2.interface.skill.export(db, filename=None, cellname=None, scale=0.001, reset_library=False, tech_library=None)[source]#

Export a laygo2.object.database.Library object to skill code.

Parameters:
  • db (laygo2.database.Library) – The library database to exported.

  • filename (str, optional) – If specified, the generated skill script is stored in filename.

  • cellname (str or List[str]) – The name(s) of cell(s) to be exported.

  • scale (float) – The scaling factor between laygo2’s integer coordinats actual physical coordinates.

  • reset_library (bool, optional) – If True, the library to export the cells is reset.

  • tech_library (str, optional) – The name of technology library to be attached to the resetted library.

Returns:

str

Return type:

The generated skill script.

Example

>>> import laygo2
>>> from laygo2.object.database import Design
>>> from laygo2.object.physical import Rect, Pin, Instance, Text
>>> # Create a design.
>>> dsn = Design(name="mycell", libname="genlib")
>>> # Create layout objects.
>>> r0 = Rect(xy=[[0, 0], [100, 100]], layer=["M1", "drawing"])
>>> p0 = Pin(xy=[[0, 0], [50, 50]], layer=["M1", "pin"], name="P")
>>> i0 = Instance(libname="tlib", cellname="t0", name="I0", xy=[0, 0])
>>> t0 = Text(xy=[50, 50], layer=["text", "drawing"], text="T")
>>> # Add the layout objects to the design object.
>>> dsn.append(r0)
>>> dsn.append(p0)
>>> dsn.append(i0)
>>> dsn.append(t0)
>>> #
>>> # Export to skill.
>>> lib = laygo2.object.database.Library(name="mylib")
>>> lib.append(dsn)
>>> scr = laygo2.interface.skill.export(lib, filename="myscript.il")
>>> print(scr)
; (definitions of laygo2 skill functions)
; exporting mylib__mycell
cv = _laygo2_open_layout("mylib" "mycell" "layout")
_laygo2_generate_rect(cv, list( "M1" "drawing" ), list( list( 0.0000  0.0000  ) list( 0.1000  0.1000  ) ), "None")
_laygo2_generate_pin(cv, "P", list( "M1" "pin" ), list( list( 0.0000  0.0000  ) list( 0.0500  0.0500  ) ) )
_laygo2_generate_instance(cv, "I0", "tlib", "t0", "layout", list( 0.0000  0.0000  ), "R0", 1, 1, 0, 0, nil, nil)
_laygo2_save_and_close_layout(cv)
laygo2.interface.skill.load_cell_list(libname, filename, yaml_filename='import_skill_scratch.yaml')[source]#
laygo2.interface.skill.load(libname, mpt=False, cellname=None, filename=None, yaml_filename='import_skill_scratch.yaml')[source]#