ACG package

Submodules

ACG.AutoRouter module

ACG.AutoRouterExtension module

ACG.AyarDesignManager module

class ACG.AyarDesignManager.AyarDesignManager(bprj, spec_file, gds_layermap='')[source]

Bases: object

Class that oversees the creation of layouts, schematics, testbenches, and simulations. Overrides DesignMaster for more intuitive yaml file organization and handles the RoutingGrid in grid-free layouts

generate_layout(layout_params_list=None, cell_name_list=None)[source]

Generates a batch of layouts with the layout package/class in the spec file with parameters set by layout_params_list and names them according to cell_name_list. Each dict in the layout_params_list creates a new layout

layout_params_list:obj:’list’ of :obj:’dict’

list of parameter dicts to be applied to the specified layout class

cell_name_list:obj:’list’ of :obj:’str’

list of names to be applied to each implementation of the layout class

generate_schematic(sch_params_list=None, cell_name_list=None)[source]

Generates a batch of schematics specified by sch_params_list and names them according to cell_name_list. Each dict in the sch_params_list creates a new schematic

Parameters
  • sch_params_list (:obj:'list' of :obj:'dict') – parameter dicts to be applied to the specified layout class

  • cell_name_list (:obj:'list' of :obj:'str') – list of names to be applied to each implementation of the layout class

generate_tb(tb_params_list=None, tb_name_list=None)[source]

Generates a batch of testbenches specified by tb_params_list and names them according to tb_name_list. Each dict in tb_params_list creates a new set of tb’s

Parameters
  • tb_params_list (:obj:'list' of :obj:'dict') – list of parameter dicts to be applied to the testbench generator class

  • tb_name_list (:obj:'list' of :obj:'str') – list of names to be applied to each implementation of the tb class

import_schematic_library(lib_name)[source]

Imports a Cadence library containing schematic templates for use in BAG, this must be called if changes to the schematic were made since the last run

Parameters

lib_name (str) – string containing name of the library to be imported

load_sim_data()[source]

Returns simulation data for all TBs in spec file

make_tdb(layermap='')[source]

Makes a new TemplateDB object. If no routing grid parameters are sent in, dummy parameters are used.

run_LVS(cell_name_list=None)[source]

Runs LVS on a batch of cells contained within the implementation library

Parameters

cell_name_list (:obj:'list' of :obj:'str') – list of strings containing the names of the cells we should run LVS on

run_PEX(cell_name_list)[source]

Runs PEX on a batch of cells contained within the implementation library

Parameters

cell_name_list (:obj:'list' of :obj:'str') – list of strings containing the names of the cells we should run PEX on

run_flow()[source]

Override and call this method to specify your design procedure when subclassing

simulate()[source]

Runs a batch of simulations on the generated TB’s. All parameters for simulation are set within the spec file

ACG.AyarLayoutGenerator module

ACG.Label module

ACG.LayoutParse module

ACG.PrimitiveUtil module

Utility functions

ACG.PrimitiveUtil.Md(direction)[source]

Get direction/projection matrix

Parameters

direction (str) – direction/projection parameter. Possible values are ‘left’, ‘right’, ‘top’, ‘bottom’, ‘omni’, ‘x’, ‘y’.

Returns

directional matrix

Return type

np.array([[int, int], [int, int]])

ACG.PrimitiveUtil.Mt(transform)[source]

Get transform matrix

Parameters

transform (str) – transform parameter. possible values are ‘R0’, ‘MX’, ‘MY’, ‘MXY’, and ‘R180’

Returns

transform matrix

Return type

np.array([[int, int], [int, int]])

ACG.PrimitiveUtil.Mtinv(transform)[source]

Get inverse of transform matrix

Parameters

transform (str) – transform parameter. possible values are ‘R0’, ‘MX’, ‘MY’, ‘MXY’, and ‘R180’

Returns

inverse of transform matrix

Return type

np.array([[int, int], [int, int]])

ACG.PrimitiveUtil.format_float(value, res)[source]

Format float numbers for pretty printing

Parameters
  • value (float) – number to be printed

  • res (float) – resolution

Returns

Return type

str

ACG.PrimitiveUtil.locate_xy(xy0, xy1, location)[source]

Find a corresponding xy coordinate from location parameters

Parameters
  • xy0 (np.array([float, float])) – first coordinate

  • xy1 (np.array([float, float])) – second coordinate

  • location (str) – direction/projection parameter. Possible values are ‘lowerLeft’, ‘upperRight’, ‘centerCenter’, …

Returns

resulting coordinate

Return type

np.array([float, float])

ACG.Rectangle module

class ACG.Rectangle.Rectangle(xy, layer, virtual=False)[source]

Bases: ACG.VirtualObj.VirtualObj

Creates a better rectangle object with stretch and align capabilities

align(target_handle: str, ref_rect: Optional[ACG.Rectangle.Rectangle] = None, ref_handle: str = None, track=None, align_opt: Tuple[bool, bool] = True, True, offset: Union[Tuple[float, float], ACG.XY.XY] = 0, 0)ACG.Rectangle.Rectangle[source]

Moves the rectangle to co-locate the target and ref handles

property center
copy(virtual=False, layer=None)ACG.Rectangle.Rectangle[source]
dict_compatability = ('handle0', 'handle1', 'xy0', 'xy1', 'layer')
export_locations()[source]

This method should return a dict of relevant locations for the virtual obj

classmethod from_dict(params: dict)ACG.Rectangle.Rectangle[source]

Enable the creation of a rectangle from a dictionary of parameters

get_dim(dim)[source]

Returns measurement of the dimension of the rectangle

get_enclosure(rect: ACG.Rectangle.Rectangle, virtual: bool = True)ACG.Rectangle.Rectangle[source]

Returns a rectangle that encloses all provided rectangles

get_highest_layer(rect: Optional[Rectangle] = None, layer: Optional[str] = None) → Tuple[str, str][source]

Returns the highest layer used by provided rectangles

get_midpoint(handle: str, coord: Union[Tuple[float, float], ACG.XY.XY]) → Union[Tuple[float, float], ACG.XY.XY][source]

Gets the midpoint between a location on this rectangle and another coordinate

get_overlap(rect: ACG.Rectangle.Rectangle, virtual: bool = True)ACG.Rectangle.Rectangle[source]

Returns a rectangle corresponding to the overlapped region between two rectangles

property height
property layer
property ll
property lpp
static overlap(A, B)[source]

Returns whether or not two rectangles overlap in both dimensions

scale(size, dim=None)ACG.Rectangle.Rectangle[source]

Additvely resizes the rectangle by the provided size

set_dim(dim: str, size: float)ACG.Rectangle.Rectangle[source]

Sets either the width or height of the rect to desired value. Maintains center location of rect

shift_origin(origin=0, 0, orient='R0', virtual=True)ACG.Rectangle.Rectangle[source]

Takes xy coordinates and rotation, returns a virtual Rect2 that is re-referenced to the new origin Assumes that the origin of the rectangle is (0, 0)

stretch(target_handle: str, ref_rect=None, ref_handle: str = None, track=None, stretch_opt=True, True, offset=0, 0)ACG.Rectangle.Rectangle[source]

Stretches rectangle to co-locate the target and ref handles. If ref handles are not provided, stretch by given offset

to_bbox() → bag.layout.util.BBox[source]
update_dict()[source]

Updates the location dictionary based on the current ll and ur coordinates

property ur
property width
property xy

ACG.Track module

class ACG.Track.Track(dim, spacing, origin=0)[source]

Bases: object

A class for creating consistently spaced reference lines

align(ref_rect, ref_handle, num=0, offset=0)[source]

Aligns the provided track number to handle of reference rectangle

property dim
get_track(num)ACG.XY.XY[source]

Returns [x, y] coordinates of desired track #

property origin
property spacing
stretch(track_num, ref_rect, ref_handle, offset=0)[source]

Stretches the track spacing to co-locate track and handle

class ACG.Track.TrackManager[source]

Bases: object

A class that enables users to create tracks and use them as references for routing

add_track(name, dim, spacing, origin=0)[source]

Adds a track to the database.

Parameters
  • name – name to associate with the added track

  • dim – ‘x’ or ‘y’ for the desired routing direction

  • spacing – space between tracks

  • origin – coordinate to place the zero track

classmethod from_routing_grid(grid: RoutingGrid)[source]

Generates a track manager object from the current grid

Parameters

grid – RoutingGrid object used as reference to build all of the desired tracks

Returns

Generated TrackManager object from the provided RoutingGrid

Return type

TrackManager

ACG.Via module

ACG.VirtualInst module

class ACG.VirtualInst.VirtualInst(master, origin=0, 0, orient='R0', inst_name=None)[source]

Bases: ACG.VirtualObj.VirtualObj

A class to enable movement/access of low level instances without directly accessing the master class

align(target_handle: str, target_rect: ACG.VirtualObj.VirtualObj = None, ref_rect: ACG.VirtualObj.VirtualObj = None, ref_handle: str = None, align_opt: Tuple[bool, bool] = True, True, offset: Union[Tuple[Union[float, int], Union[float, int]], ACG.XY.XY] = 0, 0)ACG.VirtualInst.VirtualInst[source]

Moves the instance to co-locate target rect handle and reference rect handle

edges = ('l', 'b', 'r', 't')
export_locations()dict[source]

Recursively shift all of the elements in the location dictionary

move(origin=None, orient=None)ACG.VirtualInst.VirtualInst[source]

Set the origin and orientation to new values

property orient
property origin
shift_origin(origin=None, orient=None)ACG.VirtualInst.VirtualInst[source]

Moves the instance origin to the provided coordinates and performs transformation

valid_orientation = ('R0', 'MX', 'MY', 'R180')
vertices = ('ll', 'lr', 'ur', 'ul', 'c', 'cl', 'cb', 'cr', 'ct')

ACG.VirtualObj module

class ACG.VirtualObj.VirtualObj[source]

Bases: object

Abstract class for creation of primitive objects

export_locations()[source]

This method should return a dict of relevant locations for the virtual obj

abstract shift_origin(origin=0, 0, orient='R0')[source]

This method should shift the coordinates of relevant locations according to provided origin/transformation, and return a new shifted object. This is important to allow for deep manipulation in the hierarchy

ACG.XY module

class ACG.XY.XY(xy, res=0.001)[source]

Bases: ACG.VirtualObj.VirtualObj

Primitive class to describe a single coordinate on xy plane and various associated utility functions Keeps all coordinates on the grid

export_locations()[source]

For now just returns a dict of the coordinates

shift_origin(origin=0, 0, orient='R0')[source]

This method should shift the coordinates of relevant locations according to provided origin/transformation, and return a new shifted object. This is important to allow for deep manipulation in the hierarchy

property x
property xy
property y

ACG.tech module

When imported, this module will extract tech information for easy access from a module specified by the ‘ACG_TECH’ environment variable

Module contents