Structure#

laygo2 is composed of the following three sub-packages.

  • object package implements various physical and abstract objects that compose layouts.

  • interface package handles various interactions between laygo2 and external objects (EDA tools, data structures, files).

  • util package contains useful functions for other sub-packages.

Brief explanations on the sub-packages can be found in the following sections, and check the API reference for details on key classes and functions.

object package#

The object package includes various classes for physical and abstract objects (API reference link).

The folowing modules compose the object package:

  • physical module is defining classes for physical objects that compose actual IC layout.

  • template module describes classes for templates that generate various instance objects for target technology and design parameters.

  • grid module describes grid classes to abstract placement and routing coordinates. parameterizations.

  • database module implements classes for design hierarchy management.

The following figure illustrates a UML diagram of the object package. laygo2 UML diagram

physical module#

The physical module implments classes for physical layout objects (API reference link).

Here are the summary of classes in the physical module:

  • PhysicalObject is the base class for physical objects.

  • IterablePhysicalObject(PhysicalObject) is the base class for ‘iterable’ physical objects (such as arrays and groups).

  • PhysicalObjectGroup(IterablePhysicalObject) is a dedicated class for groups of physical objects (not implemented yet).

  • Rect(PhysicalObject) is for rect objects.

  • Path(PhysicalObject) is for path objects.

  • Pin(IterablePhysicalObject) is for pin objects.

  • Text(PhysicalObject) is for text objects.

  • Instance(IterablePhysicalObject) is for instances.

  • VirtualInstance(IterablePhysicalObject) is for virtual instances (a group of objects that acts as a single instance).

The following figure illustrates examples of the physical objects from one of the classes.

laygo2 physical_objects

template module#

template module is composed of classes that abstract instances and virtual instances. (API reference link).

Here are the summary of classes in the template module:

grid module#

grid module is composed of classes that implement abstract coordinate systems that are interacting with technology-specific physical coordinate systems. (API reference link).

laygo2 implements the layout designs based on the abstract coordinate system.

laygo2 grid

The grid module implements the following classes.

CircularMapping class#

CircularMapping class implements basic circular mappings (their indices extend to the entire axis with cyclic mapping). The following code block shows several examples of using CircularMapping objects.

>>> map = CircularMapping(elements=[100, 200, 300])
>>> print(map[0])
100
>>> print(map[2])
300
>>> print(map[4])
200
>>> print(map[-3])
100
>>> print(map[[2, 3, -2])
[300, 100, 200]
>>> print(map[2:7])
[300, 100, 200, 300, 100]

_AbsToPhyGridConverter class#

_AbsToPhyGridConverter is an internal class that converts abstract coordinates to physical coordinates. It also supports reverse conversions (physical-to-abstract) with comparison operators (which requires its pair converter class, _PhyToAbsGridConverter defined in its master grid object).

laygo2 abs2phy

_PhyToAbsGridConverter class#

_PhyToAbsGridConverter is an internal class that converts physical coordinates to abstract coordinates. It also supports reverse conversions (abstract-to-physical) with comparison operators (which requires its pair converter class, _AbsToPhyGridConverter defined in its master grid object).

laygo2 phy2abs

Grid class#

Grid class implements an abstract coordinate that is mapped to a 2-dimensional physical coordinate system.

The Grid class and its objects support various coordinate conversion functions, with their examples introduced in the following figure.

laygo2 grid_conversion

database module#

database module consists classes that implement design hierarchy to manage designs and libraries with its component classes described as follows:

  • BaseDatabase is the basic database management class.

  • Library(BaseDatabase) is the library management class.

  • Design(BaseDatabase) is the design management class.

(API reference link).

interface package#

interface package includes classes and functions that interact with laygo2 and external EDA tools or data structures. (API reference link).

laygo2 interface

  • gds module contains various functions to store the layout structures in GDS-II format, which is the most popular format to store layout structures.

  • yaml module contains various I/O functions to express designs in yaml format.

  • virtuoso module contains various functions that interacts with Cadence Virtuoso using Skill language.

util package#

util package contains various functions used in other packages.