Glade Reference


Libraries

All design data is stored in libraries. Libraries contain  cells and views; the combination of a cell and a view is a cellView, which contains the actual design data. For example a library may contain a cell 'NAND2'. This cell may contain a cellView 'NAND2' 'layout', where 'layout is the view of the cell.

 

lib = library("fred")

Construct a library called "fred", returning the library object.

 

bool result = lib.dbOpenLib("libPath")

Opens and reads a previously saved library. libPath is the full path to the library, including the library name. Returns True if the library can be opened successfully, otherwise False.

 

bool result = lib.dbSaveLib("libPath")

Saves a library to disk. libPath is the full path to the library, including the library name. Returns True if the library can be saved successfully, otherwise False.

 

lib.dbClose("cellName", "viewName")

Closes a cellview. Currently this does not purge the cellview from virtual memory.

 

list = lib.cellNames()

Returns a Python list of all the cell names in the library.

 

list = lib.viewNames()

Returns a Python list of all the view names in the library.

 

int size = lib.dbu()

Return the size of a database unit in meters.

 

int num = lib.dbuPerUU()

Return the number of database units per micron (defaults to 1000)

 

cellView *cv = lib.dbOpenCellView("cellName", "viewName", 'mode')

Returns a cellView object. "mode" can be 'r', 'w' or 'a'. 'w' mode is used to create a new cellView; the cellView must not exist. 'a' mode is used to append (edit) an existing cellView; the cellView must exist. 'r' mode is used to read an existing cellView; the cellView must exist. An exception is thrown on failure.

 

bool result = lib.dbCopyCellView("newCellName", "newViewName", "oldLibName", "oldCellName", "oldViewName")

Copies a cellview. Returns True if successful.

 

bool result = lib.dbRenameCellView("newCellName", "newViewName", "oldCellName", "oldViewName")

Renames a cellView. Returns True if successful.

 

cellView *cv = lib.dbFindCellViewByName("cellName", "viewName")

Returns a cellView object corresponding to the given cellName and viewName, or None if it does not exist in the library.

 

cell * c = lib.dbFindCellByName("cellName")

Returns a cell object corresponding to the given cellName, or None if it does not exist.

 

view *v = lib.dbFindViewByName("viewName")

Returns a view object corresponding to the given viewName, or None if it does not exist.

 

bool result = lib.dbDeleteCellView("cellName", "viewName")

Deletes the cellview specified by cellName and viewName and returns True if sucessful, None if not.

 

bool result = lib.dbRenameCell("newCellName", "oldCellName")

Renames a cell. Returns True if sucessful, False if not.

 

bool result = lib.dbDeleteCell("cellName")

Deletes the cell specified by cellName and returns True if sucessful, False if not.

 

char * name = lib.libName()

Returns the name of the library.

 

char * path = lib.libPath()

Returns the library path if the library has been read or saved on disk, otherwise None.

 

dbTechfile *tech = lib.tech()

Returns a pointer to the library's techfile.

 

library *lib = cvar.dbptr.getLibByName("libName")

Get a library by name.

 

int index = lib.addVia(via *v, bool check)

Adds a via  v to the library via table and returns the via's index in that table. If check is true (the default is false), the via name is checked and the new via will NOT be added; the index returned is that of the existing via.

 

via *v = lib.getVia(int index)

Gets a via by index from the library. No bounds checking is performed.

 

via *v = lib.getViaByName(char *name)

Gets a via by name.

 

int index = lib.getViaIndexByName(char *name)

Gets a via's index by the via name.

 

char *name = lib.getViaNameByindex(int index)

Gets a via's name from its index.

 

int num = lib.getNumVias()

Gets the number of vias in the library's via table. Note the table size is currently limited to 8192 vias.

 

 

 

Contents|Index

Copyright © Peardrop Design 2016.