Glade

UI Python command reference

This document describes the Python functions available from the Glade GUI. Argument types are shown as C++ types with default values where applicable, however all arguments are really python variables. All of the following functions are part of the ui class. There is a global pointer to the gui called cvar.guiptr. Therefore to use them , define you own variable e.g. gui=cvar.guiptr, then call as gui.OpenCellView(...)

ui::redraw(bool force = true)

Refresh the display. If force is False, the operation is put on the event queue, else it is immediately acted on.

bool ui::loadPCell(char *libName, char *pcellName)

Loads the PCell with name pcellName into the library libName. If the PCell already exists in the library, the action is ignored and returns true. If a cellView with the same name exists, it is deleted and is replaced by the PCell supermaster. Note that once a PCell is loaded into a library and that library is saved, it will remain a PCell, so there is no need to load it again (although it is harmless and you will just get warnings about the load being ignored). If the PCell cannot be created, it returns false.

bool ui::updatePCellMaster(char *pcellName)

Searches all libraries for instances of PCells with supermaster names given by pcellName. Any instances found are updated with the (potentially new) python code for the PCell. This is necessary if you change the PCell code as there is no automatic updating performed.

ui::setMaxErrCount(int32_t val)

Sets the maximum error count before errors are suppressed. THe default is 50. This is used in e.g. import commands where there may be many errors generated.

int32_t ui::maxErrCount()

Gets the maximum error count.

ui::editFile(char *fileName=null)

Edit or view a file. If fileName is not specified, a file open dialog is displayed, else the f ile given by fileName will be opened. This function does nothing in non-graphics mode.

ui::execPythonFile (const char *fileName)

Execute the python script given by fileName.

ui::load(const char *moduleName)

Imports the Python module moduleName and adds its contents to the global namespace, so its functions can be called without the module prefix. The module must be on the PYTHONPATH.

cellView ui::getEditCellView()

Returns the current cellview being edited. If multiple cellviews are open, it returns the cellview of the current active window. There is also a top level python binding to this function, getEditCellView(). This function returns None in non-graphics mode.

library ui::getLibByName(const char *name)

Returns the library given by name.

bool ui::deleteLib(const library *lib)

Deletes a library.

dbObjList<library> * ui::getLibList()

Returns a dbObjList of all open libraries. There is also a top level python binding of the same name that returns a python list of open libraries.

ui::fileSaveLibAs( const char *libName, const char *libPath, bool verbose=true, bool saveCells=true )

Saves a library to disk as libName to the path libPath. A library is a directory structure containing metadata in a glade.lib file, plus cellViews in subdirectories where each subdirectory is the cell name, and the subdirectory contains files each of which are the viewName of the cellView.
If verbose is true, detailed information on cells saved is written to the logfile. If saveCells is true, library cells are saved; if false, then only the library tech info is saved (to the glade.lib file in the library directory).

bool ui::closeLib(const char *name)

Closes the library given by name. If cellViews from that library are displayed, their windows will be closed. The library is removed from the list of open libraries. No checking is performed for edited cells. This function does nothing in non-graphics mode.

dbObjList<cellView> * ui::getCellList()

Returns a dbObjList of all open cellViews. There is also a top level python binding of the same name that returns a python list of open cellViews. This function returns None in non-graphics mode.

bool ui::newCell( const char *libName, const char *cellName, const char *viewName, db_viewType viewType=maskLayout, const char *pCellName=NULL, bool isPCell=false, bool openCell=true)

Creates a new cellView in the library libName, which must be open.

Returns false if the view type does not match, the cellView could not be created, or the PCell could not be built.

bool ui::openCellView (const char * libName, const char * cellName, const char * viewName, bool editable=true)

Opens the cellview specified by libName, cellName and viewName in a new window. if editable is true the cellView is opened in edit mode, else it is opened in read mode. Returns true if successful. This function does nothing in non-graphics mode.

bool ui::closeCellView (const char * libName, const char * cellName, const char * viewName)

Closes the cellview specified by libName, cellName and viewName and returns true if successful. This function does nothing in non-graphics mode.

ui::closeAllWindows ()

Closes all open windows.This function does nothing in non-graphics mode.

bool ui::importTech( const char *libName, const char *techFileName, unsigned int32_t dbu=1000, bool merge=true, bool verbose=true)

Imports the techfile. Returns true if no error occurred.

bool ui::importLyp( const char *libName, const char *lypFileName, uint32_t dbu=1000, bool merge=true, bool verbose=true)

Imports a KLayout layer properties (.lyp) file as the techfile of library libName, which is created if it does not exist. The arguments are as for importTech. Returns true if no error occurred.

bool ui::importMap(const char *libName, const char *mapFileName)

Reads the layer map file mapFileName into the techfile of library libName, setting the GDS2 layer/datatype of the layer name/purpose pairs it lists. The library is created if it does not exist. Returns true if no error occurred.

bool ui::exportTech( const char *libName, const char *techFileName, bool systemLayers=false)

Exports the techfile. The library must exist.

bool ok = ui::importGds2 ( const char * libName, const char * gdsFileName, const char * dumpFile = "", int32_t csen = 0, bool do_dump = false, double gdsScaleFactor = 1.0, double gdsXOffset = 0.0, double gdsYOffset = 0.0, int32_t gdsNetAttr = 23, int32_t gdsDevAttr = 7, int32_t gdsInstAttr = 102, bool compressed=false, bool dubiousData=true, bool setDBUfromGDS=true, bool reportCells=false, int32_t pathConv=2, int32_t layers=allLayers, int32_t layer=0, int32_t datatype=0, bool openTopCell=false, bool setLibName=false, bool convertVias=false, int32_t duplicates=0, char *viewName="layout", bool importPCells=false, list<gdsReadCellMap> *mapList=NULL, QStringList refLibList=QStringList())

Import a GDS2 file.

bool ok = ui::exportGds2 ( const char * libName, const char * viewNameList, const char * gdsFileName, int16_t outputLayers = -1, bool outputNetAttrs=false, bool outputDevAttrs=false, bool outputInstAttrs=false, bool outputAllCells=true, bool outputChildCells=true, const char * topCellName =NULL, int32_t netAttr=23, int32_t devAttr=7, int32_t InstAttr=102, bool compressed=false, bool reportCells=false, double grid=0.005, bool writeViaCells=true, int32_t polyVertexLimit=8192, bool singleNet = false, const char *netName="", bool exportPCells=false, bool writeSegsAsPaths=true, bool allowNonOrthoArrays=false, list<gdsWriteCellMap> *mapList=NULL, QStringList refLibList=QStringList())

Export a GDS2 file.

bool ok = ui::importLef ( const char * libName, const char * lefFileName, bool compressed=false, bool generateLabels=true, float64_t size=0.25. bool allShapes=false, bool metLayers=false)

Import a LEF file.

bool ok = ui::exportLef ( const char * libName, const char * lefFileName, bool technology=true, bool allCells=true, const char *cellName=NULL, const char viewName="abstract", const char * powerNets="", const char * groundNets="", bool separatePorts=false, bool writeNonDefRules=true, int32_t namesCaseSense=1, const char *busBitChars="[]", const char *dividerChar="/")

Export a LEF file.

bool ok = ui::importDef ( const char * libName, const char * viewName, const char * defFileName, bool ecoMode=false, bool compressed=false, bool reportMissingPins=true, bool importSpecial=true, bool importRegular=true, bool reportUnplacedComps=false, bool openTopCell=true, const char *viewList="autoLayout abstract layout", bool generateLabels=false, float64_t labelSize=1.0, bool metLayers=false, bool additionalPurpose=false, const char *purpose="boundary")

Import a DEF file.

bool ok = ui::exportDef ( const char * libName, const char * cellName, const char * viewName, const char * defFileName, bool comps=true, bool pins=true, bool regular=true, bool special=true, bool regularRouting=true, bool specialRouting=true)

Export a DEF file.

bool ok = ui::importVerilog ( const char * libName, const char * verilogFileName, const char * powerNet, const char * groundNet, const char * flatViewName, bool flatten, const char * topCellName, int16_t hPinLayer, int16_t vPinLayer, double aspect, double utilisation)

Import a Verilog file.

bool ok = ui::exportVerilog ( const char * libName, const char * cellName, const char * viewName, const char * verilogFileName, bool flatMode=true, const char * switchList="", const char * stopList="")

Export a Verilog file. Currently only a flat verilog netlist is output.

bool ok = ui::importECO (const char * ecoFileName)

Import an ECO file from file ecoFileName into the current open cellView. This function does nothing in non-graphics mode.

bool ui::importOasis( const char * libName, const char * oasisFileName, bool dubiousData=true, bool allowNonPrintingChars=true, bool reportCells=false, int32_t pathConv=2, bool openTopCell=false, double scale=1.0, double xoffset=0.0, double yoffset=0.0, int32_t csen=0, int32_t duplicates=0, char *viewName="layout", bool verbose=false, bool layer_names=false, bool annotate_nets=false, int32_t net_attr_num=23, bool annotate_devs=false, int32_t dev_attr_num=7, bool annotate_insts=false, int32_t inst_attr_num=102, list<oasisReadCellMap> *mapList=NULL)

Import an OASIS file.

bool ok = ui::exportOasis ( const char * libName, const char * viewNames, const char * oasisFileName, bool outputAllCells = true, bool outputChildCells = true, const char * topCellName = NULL, bool strict = true, bool cblock = true, bool cellOfsets = true, bool reportCells = false, double grid=0.005, bool layer_names=false, int32_t output_layer=-1, bool writeSegsAsPaths=true, bool writeViasAsCells=false, bool allowNonPrintingChars=true, int32_t compression=5, bool allowNonOrtho=false, bool writeImplicitRefs=false, bool write_S_BOUNDING_BOX=false, list<oasisWriteCellMap> *mapList=NULL)

Export an OASIS file.

bool ui::importDxf( const char * libName, const char * cellName, const char * dxfFileName, int32_t dbu=10000)

Import a DXF file.

bool ui::exportDxf( const char * libName, const char * cellName, const char * dxfFileName, bool outputText=true, bool allLayers=true, bool netText=false, float64_t netHeight=1.0)

Export a DXF file.

bool ui::importGerber( const char *gerberFile, const char *libName, const char *cellName, const char *viewName="layout")

Gerber import is not yet implemented; this function does nothing.

bool ui::importCDL( const char * libName, const char * cdlFileName)

Import a CDL file. Note that no attempt is made to create a schematic from this netlist, although the connectivity will be present.

bool ui::exportCDL( const char * libName, const char *cellname, const char *viewName, const char * cdlFileName, const char *globals, const char *pinOrder="", bool annotateXY=0, bool microns=false, bool rmodel=false, char * rpropname="r", bool cmodel=false, char *cpropname="c", double filterCapLimit=-1.0, bool filterCaps= true, bool mergeCaps=false, bool trueSpice=false, const char *nlpPropName="", const char *busLeft="<", const char *busRight=">")

Export a flat CDL file.

ui::schHNLOut( char *libName, char *cellName, char *viewName, char *cdlFileName, char *switchList, char *stopList, char *globals, bool addEnd=false, bool microns=false, bool rmodel=false, char * rpropname="r", bool cmodel=false, char *cpropname="c", double filterCapLimit=-1.0, bool filterCaps= true, bool mergeCaps=false, const char *nlpPropName="", const char *busLeft="<", const char *busRight=">", bool writeAsSubckt=true )

Export a hierarchical CDL file.

bool ui::importDSPF( const char * libName, const char * dspfFileName, const char * netsToRead=NULL, bool saveC = true, bool saveR = true, bool saveI = false, bool overwrite = true, const char *purpose = "net")

Imports a DSPF file.

bool ui::exportDSPF( const char * libName, const char * cellName, const char * viewName, const char * dspfFileName)

Exports a DSPF file.

bool ui::importEdif( const char * edifFileName, bool useScale)

Imports a EDIF file.

bool ui::exportEdif( const char * libName, const char * cellName, const char * viewName, const char * edifFileName, const char * extLibs)

Exports a EDIF file.

bool ui::importSkill( const char *libName, const char *displayName, const char *skillFileName, uint32_t dbu=1000, bool useMapFile=false, const char *mapFile=NULL)

Imports a Cadence Skill techfile using the new Skill parser.

bool ui::importCds( const char * libName, const char * displayName, const char * techFileName, uint32_t dbu=1000, bool useMapFile=false, const char *mapFile=NULL)

Imports a Cadence Skill techfile. Deprecated.

bool ui::importLaker( const char *libName, const char *displayName, const char *techName, uint32_t dbu=1000, bool useMapFile=false, const char *mapFile=NULL)

Imports a Laker techfile.

bool ui::importLaff(const char *fileName)

Imports the LAFF file fileName. Returns true if no error occurred.

bool ui::importHercules( const char *fileName, const char *libName, const char *cellName, const char *viewName)

Imports a Hercules error file.

bool ui::importCalibre( const char *fileName, const char *libName, const char *cellName, const char *viewName)

Imports a Calibre error file.

bool ui::importDerivedLayer( const char *fileName, const char *libName, const char *cellName, const char *viewName="layout", uint16_t layer=TECH_Y6_LAYER)

Reads a derived layer (edge) file written by the DRC engine, merges it and writes the result as polygons on layer in the cellView libName/cellName/viewName. The library and cellView are created if needed. Returns false if the file could not be loaded.

bool ui::dbReadSkill(const char *skillFileName)

Reads a Cadence Skill database file skillFileName with the Skill interpreter. Requires an enterprise license. Returns true if the file was read without error.

bool ui::dbReadSkillDir(const char *skillDirName, const QList<QStringList> &liblist)

Reads a directory of Cadence Skill database files, one library per entry of liblist (library name, display.drf file, techfile, and a regular expression for the files to read). This is used by the Read Skill dialog; liblist cannot be built from Python.

bool ui::cdlFlatten( const char *inFile, const char *outFile, const char *topCellName, const char *delimiter="|")

Reads a hierarchical CDL file.

ui::scaleCells( cellView *cv, db_Float64 scaleFactor, db_Int32 grid, bool allCells)

> Scale cell(s) hierarchically.

ui::scaleCell( cellView *cv, db_Float64 scaleFactor, db_Int32 grid)

> Scale a cell.

ui::biasCells( cellView *cv, int16_t layer, int32_t biasFactor, int32_t grid, int32_t allCells)

Bias cell(s).

ui::biasCell( cellView *cv, int16_t layer, int32_t biasFactor, int32_t grid)

Bias a cell.

ui::updateCellBBox(cell *c)

Recomputes the bounding boxes of the cellViews of cell c from their instances.

ui::zoomIn()

Zoom in according to the current zoomin factor.This function does nothing in non-graphics mode.

ui::zoomIn(int32_t x1, int32_t y1, int32_t x2, int32_t y2)

Zoom in to the area given by x1 y1 x2 y2. This function does nothing in non-graphics mode.

ui::zoomOut()

Zoom out according to the current zoomout factor. This function does nothing in non-graphics mode.

ui::zoomOut (int32_t x1, int32_t y1, int32_t x2, int32_t y2)

Zoom out by the area given by x1 y1 x2 y2. This function does nothing in non-graphics mode.

ui::zoomToNet(const char *netName)

Zoom in to the net netName. This function does nothing in non-graphics mode.

ui::zoomToNets(list names)

Zoom in to the nets whose names are given in the Python list names. This function does nothing in non-graphics mode.

ui::selectArea (int32_t x1, int32_t y1, int32_t x2, int32_t y2, bool add = false)

Select objects in the area given by x1 y1 x2 y2. If add is true, then the objects are added to the selected set. This function does nothing in non-graphics mode.

ui::deselectArea (int32_t x1, int32_t y1, int32_t x2, int32_t y2)

Deselect objects in the area given by x1 y1 x2 y2. This function does nothing in non-graphics mode.

ui::selectAll()

Select all objects in the current canvas cellView. This function does nothing in non-graphics mode.

ui::deselectAll()

Deselect all objects in the current canvas cellView. This function does nothing in non-graphics mode.

ui::selectPoint (int32_t x1, int32_t y1, bool add = false)

Select an object at the coordinate x1 y1. If add is true, then the object is added to the selected set. This function does nothing in non-graphics mode.

ui::deselectPoint (int32_t x1, int32_t y1)

Deselect an object at the coordinate x1 y1. This function does nothing in non-graphics mode.

ui::selectObj(dbObj *obj)

Selects an object. The existing selection list is cleared. This function does nothing in non-graphics mode.

ui::selectObj(net *net)

Selects shapes for the net net. The existing selection list is cleared. This function does nothing in non-graphics mode.

ui::deselectObj(dbObj *obj)

Deselects an object. This function does nothing in non-graphics mode.

ui::deselectObj(net *net)

Deselects shapes for a net net. This function does nothing in non-graphics mode.

ui::addSelected(dbObj *obj)

Adds the object to the selected set. This function does nothing in non-graphics mode.

ui::addSelected(net *net)

Adds the net shapes to the selected set. This function does nothing in non-graphics mode.

dbObjList<dbObj * ui::getSelectedSet()

Returns a dbObjList of the selected set. There is also a top level python binding of the same name that returns a python list of selected objects. This function does nothing in non-graphics mode.

ui::moveSelected(Point delta, orient_t orient)

Moves the selected set by delta, optionally rotating it by orient. This function does nothing in non-graphics mode.

ui::copySelected(Point delta, orient_t orient)

Copies the selected set, moving the copy by delta, optionally rotating it by orient. This function does nothing in non-graphics mode.

ui::addMarker( int32_t x, int32_t y, int32_t size=20, int32_t lineWidth=0, color=Qt::yellow)

Adds a marker at the specified x and y values (given in database units). The size of the marker defaults to 20 dbu and the linewith to 0 (i.e. one pixel wide). This function does nothing in non-graphics mode.

ui::clearMarkers()

Clears all markers. This function does nothing in non-graphics mode.

ui::addHilite(dbHierObj obj, uint32_t r, uint32_t g, uint32_t b, uint32_t a=255)

Add a hilite to the dbHierObj obj using the given rgba colour value.

ui::addHilite(dbObj * obj, uint32_t r, uint32_t g, uint32_t b, uint32_t a=255)

Add a hilite to the dbObj obj using the given rgba colour value.

ui::addHilite(net obj, uint32_t r, uint32_t g, uint32_t b, uint32_t a=255)

Add a hilite to the net obj using the given rgba colour value.

ui::addHilite(const char *name, uint32_t r, uint32_t g, uint32_t b, uint32_t a=255)

Add a hilite to the name name using the given rgba colour value.

ui::addHilite(const Rect &box, uint32_t r, uint32_t g, uint32_t b, uint32_t a=255)

Add a hilite to the rectangle box using the given rgba colour value.

ui::addHiliteByLayer(const char *name, int16_t lyr, uint32_t r, uint32_t g, uint32_t b, uint32_t a=255)

Add a hilite to the name name on layer lyrusing the given rgba colour value.

ui::addHilite(int32_t x1, int32_t y1, int32_t x2, int32_t y2,, uint32_t r, uint32_t g, uint32_t b, uint32_t a=255)

Add a hilite to the rectangle defined by x1,y1,x2,y2 the given rgba colour value.

ui::clearHilites()

Clear all hilites.

ui::hiliteSubNetsByCap(const char *netName, uint32_t a=128)

Hilite subnets of the net netName according to their capacitance.

ui::displayOnlyThisNet(const char *name)

Display only shapes of the named net. All other shapes with net info will be hiddent from the display.

ui::displayAddThisNetS(const char *name)

Add shapes of the named net to the display to the show list.

ui::displayHideThisNet(const char *name)

Hide shapes of the named net from the display by removing the net from the show list. Adds the net to the hide list.

ui::displayAllNets()

Show all net shapes. Effectively the show list is cleared.

const char *ui::getDisplayNets()

Get a space delimited list of nets in the show list.

bool ui::isMemberOfDisplayNets(const char *name)

Returns true if net name is a member of the show list.

const char *ui::getHideNets()

Get a space delimited list of nets in the hide list.

bool ui::isMemberOfHideNets(const char *name)

Returns true if net name is a member of the hise list.

ui::updateLibBrowser()

Updates (refreshes) the library browser. This function does nothing in non-graphics mode.

ui::updateLSW()

Updates (refreshes) the LSW. This function does nothing in non-graphics mode.

ui::setLayerVisible(const char *layerName, const char *purpose, bool val)

Returns true if the layer specified by layerName and purpose can be set visible in the current cellView or false if there is no current cellView. This function does nothing in non-graphics mode.

bool ok = ui::isLayerVisible(const char *layerName, const char *purpose)

Returns true if the layer specified by layerName and purpose is visible in the current cellView or false if it is invisible, or there is no current cellView. This function does nothing in non-graphics mode.

ui::setAllVisible(bool val)

Sets all layers visible. This function does nothing in non-graphics mode.

bool ui::setLayerSelectable(const char *layerName, const char *purpose, bool val)

Returns true if the layer specified by layerName and purpose can be set visible in the current cellView or false if there is no current cellView. This function does nothing in non-graphics mode.

bool ui::isLayerSelectable(const char *layerName, const char *purpose)

Returns true if the layer specified by layerName and purpose is selectablein the current cellView or false if it is invisible, or there is no current cellView. This function does nothing in non-graphics mode.

ui::setAllSelectable(bool val)

Sets all layers selectable. This function does nothing in non-graphics mode.

Extending Glade by creating menus / bindkeys etc.

cvar.uiptr

A global pointer to the ui class instanciation in Glade. Use this rather than creating your own ui variable using ui(). For example:

gui=cvar.uiptr gui.OpenCellView("default", "nand", "layout")

Although you can use e.g. ui().<functionName()>, this will not work for commands like createAction() which only work with the existing instanciated ui object.

ui::createMenu(const char *name)

Creates a menu called name in the menu bar

ui::createMenu(QMenu *menu, const char *name)

Creates a submenu called name in menu.

ui::addSeparator(QMenu *menu)

Adds a separator to the menu.

ui::createAction(const char *name, const char *cmd)

Creates an action called name with a command cmd. The command should be a valid Python command. An action defines a common command that can be invoked by any or all of a menu item, a bindkey or a toolbar button.

ui::createAction(const char *name, const char *cmd, QActionGroup *group)

Creates an action called name with a command cmd that is part of an actionGroup group. The command should be a valid Python command. An action defines a common command that can be invoked by any or all of a menu item, a bindkey or a toolbar button.

ui::createActionGroup()

Create an actionGroup.

ui::createMenuItem(menu, action)

Adds the action to the menu. The action name will be shown on the menu, along with any key binding defined for the action.

ui::setBindKey(action, const char *keysequence)

Sets the bindkey for action. keysequence can be a key e.g. "k" or a combination e.g. "Ctrl+p", "Shift+p", "Alt+p"

icon = ui::createIcon (char *fileName)

Creates an icon from an image file (.png format)

ui::setIcon (QAction *action, const char *fileName)

Sets the icon for an action from the image file (.png format)

ui::setIcon (QAction *action, QIcon *icon)

Sets the icon for an action

toolbar = ui::createToolBar (const char*name)

Creates a tool bar with name name.

ui::createToolBarItem (QToolBar *toolBar, QAction *action)

Adds an action to a toolbar.

ui::addSeparator (QToolBar *toolBar)

Adds a separator to a toolbar.

An example of a python script for setting up a user-defined menu is as follows:

        # define some user function
        def myFunction() :
          print "Hello World!"

        gui = cvar.uiptr
        menu = gui.createMenu("MyMenu")
        action=gui.createAction("MyAction", "myFunction()")
        gui.createMenuItem(menu, action)
        gui.setBindKey(action, "!")

dialog = ui::createDialog(const char *okCallback)

Creates a dialog with OK and Cancel buttons, where clicking OK runs the Python command okCallback. Returns the QDialog, or None in non-graphics mode or if okCallback is None.

int32_t ui::traceNet(cellView *cv, Point start, int32_t mode, bool addConnectivity=false, const char *netName=NULL, const char *libName=NULL, const char *cellName=NULL, const char *viewName=NULL, int32_t red=255, int32_t green=255, int32_t blue=0, int32_t alpha=255)

Runs the net tracer (see Trace Net) on cv, from the shape on a visible routing layer under start, using the techfile's CONNECT rules. Returns the number of shapes traced, or 0 if there is no shape to trace from.

int32_t ui::traceLabel(cellView *cv, int16_t labelLayer, int16_t attachLayer, int32_t mode, bool useLabelNameForNet=false, const char *labelName=NULL, const char *libName=NULL, const char *cellName=NULL, const char *viewName=NULL, int32_t red=255, int32_t green=255, int32_t blue=0, int32_t alpha=255)

As traceNet, tracing from the shape on attachLayer under the label called labelName on labelLayer (on the top level of cv). If useLabelNameForNet is True, the traced shapes are assigned to a net named labelName. Returns the number of shapes traced, or 0 if the label, or a shape under it, is not found.

int32_t ui::findShort(cellView *cv, Point a, Point b, int32_t red=255, int32_t green=255, int32_t blue=0, int32_t alpha=255, int32_t shortRed=255, int32_t shortGreen=0, int32_t shortBlue=0, int32_t shortAlpha=255)

Finds the shortest chain of shapes connecting the shapes at points a and b, which are believed to be shorted together, by tracing from both at once (see finding shorts). The chain is highlighted in red/green/blue/alpha, and the shape where the two traces met in shortRed/shortGreen/shortBlue/shortAlpha, and each shape on the chain is listed in the log. Returns the number of shapes on the chain, 0 if the two shapes are not connected, or -1 if no shape to trace from was found at a point.

int32_t ui::findShortLabels(cellView *cv, int16_t labelLayer, int16_t attachLayer, const char *label1, const char *label2, int32_t red=255, int32_t green=255, int32_t blue=0, int32_t alpha=255, int32_t shortRed=255, int32_t shortGreen=0, int32_t shortBlue=0, int32_t shortAlpha=255)

As findShort, from the shapes on attachLayer under the labels label1 and label2 on labelLayer. Returns -1 if either label, or a shape under it, is not found.

uint32_t ui::shortTracer(cellView *cv, net *nt)

For each shape and viaInst of net nt in cv, finds objects of other nets that touch or overlap it on the same layer. Each short is reported in the log and marked with polygons on the marker layer. Returns the number of shorts found.

int32_t ui::compareCells( const char *libName1, const char *cellName1, const char *viewName1, const char *libName2, const char *cellName2, const char *viewName2, int16_t compareLayer, bool hier, bool countShapes=false, int16_t outputLayer=TECH_MARKER_LAYER, int32_t outputCell=1)

Compares two cellViews using an XOR operation using a simple non-tiled approach. This is good for cells of less than a few thousand transistors/shapes.

The function returns 0 if the two cellViews are identical, -1 if an error occurred, or the number of differences (but see countShapes).

int32_t ui::compareCells2( const char *libName1, const char *cellName1, const char *viewName1, const char *libName2, const char *cellName2, const char *viewName2, int16_T compareLayer, bool hier, bool multiThreaded=1, int32_t maxThreads=QThread::idealThreadCount(), bool tileAuto=1, float64_t tileWidth=0.0, float64_t tileHeight=0.0, int16_t outputLayer=TECH_MARKER_LAYER, int32_t outputCell=1)

Compares two cellViews using a tiled XOR operation.

The function returns 0 if the two cellViews are identical, -1 if an error occurred, or the number of differences (but see countShapes).

int32_t ui::compareCells3( const char *libName1, const char *cellName1, const char *viewName1, const char *libName2, const char *cellName2, const char *viewName2, const char *libName3, const char *cellName3, const char *viewName3, int16_T compareLayer, bool hier, bool multiThreaded=1, int32_t maxThreads=QThread::idealThreadCount(), bool tileAuto=1, float64_t tileWidth=0.0, float64_t tileHeight=0.0, int16_t outputLayer=TECH_MARKER_LAYER)

Compares two cellViews using a tiled XOR operation.

The function returns 0 if the two cellViews are identical, -1 if an error occurred, or the number of differences (but see countShapes). Error shapes are written to the library/cell/view output.

bool ui::booleanOp( const char* libName, const char *cellName, const char *viewName, int32_t opType, int16_t lyr1, int16_t lyr2, int16_t lyr3, bool hier=true, bool outputTraps=false, bool size=false, float64_t sizeBy=1.0)

Performs boolean operations on layer(s) in a cellView.

bool ui::booleanOp( const char* libName1, const char *cellName1, const char *viewName1, const char* libName2, const char *cellName2, const char *viewName2, const char* libName3, const char *cellName3, const char *viewName3, int32_t opType, int16_t lyr1, int16_t lyr2, int16_t lyr3, bool hier=true, bool outputTraps=false, bool size=false, float64_t sizeBy=1.0)

Performs boolean operations on layer(s) between two cellviews, outputting to a third.

bool ui::tiledBooleanOp( const char* libName, const char *cellName, const char *viewName, int32_t opType, int16_t lyr1, int16_t lyr2, int16_t lyr3, bool hier=true, bool outputTraps=false, bool size=false, float64_t sizeBy=1.0, bool multiThreaded=true, int32_t maxThreads=QThread::idealThreadCount(), bool tileAuto=true, float64_t tileWidth=0.0, float64_t tileHeight=0.0)

Performs tiled boolean operations on layer(s) in a cellView.

bool ui::tiledBooleanOp( const char* libName1, const char *cellName1, const char *viewName1, const char* libName2, const char *cellName2, const char *viewName2, const char* libName3, const char *cellName3, const char *viewName3, int32_t opType, int16_t lyr1, int16_t lyr2, int16_t lyr3, bool hier=true, bool outputTraps=false, bool size=false, float64_t sizeBy=1.0, bool multiThreaded=true, int32_t maxThreads=QThread::idealThreadCount(), bool tileAuto=true, float64_t tileWidth=1, float64_t tileHeight=1)

Performs tiled boolean operations on layer(s) between two cellviews, outputting to a third.

bool ui::runLVS( const char *libName, const char *cellName, const char *viewName, const char *netlist, const char *globalNets=NULL, const char *workDir= ".", bool isHierNetList=false, const char *delimiter= "/", const char *topCellName=NULL, bool checkDeviceProps=false, bool collapseLikeSized= false, bool noCollapseFingered= false, bool noCollapseChains= false, bool warnChains= false, bool caseFoldNets= false, bool noLocalMatching= false, bool noOptLabelling= false, bool matchProperties=false, bool matchPorts=false, bool warnZeroNets= false, bool verbose= false, const char *errorLimit= NULL, const const char *netSizeLimit= NULL, const char *progressLimit= NULL, const char *suspectNodeLimit= NULL, double Tolerance=10.0 , const char *equivInFileName= NULL, const char *equivOutFileName= NULL)

Runs LVS, comparing the cellview given by libName/cellName/viewName, which should be an extracted cellView, against the Spice/CDL netlist given by netlist.

int32_t ui::schCheck(char *libName, char *cellName, char *viewName, bool snapLabels=false, float64_t snapDist=0.0, bool instNamesSpice=true)

Check a schematic cellView. errors is the number of errors found, or -1 if the cell could not be checked. If snapLabels is true, labels within snapDist of a wire will be snapped to the wire. If instNamesSpice is true, instance names are given the Spice prefix of their master's device type (e.g. M for a MOS device) when the schematic is extracted.

int32_t ui::symCheck(char *libName, char *cellName, char *viewName)

Check a symbol cellView. errors is the number of errors found, or -1 if the cell could not be checked.

int32_t ui::uiSchCheck(cellView *cv, int32_t fwires=2, int32_t finputs=2, int32_t foutputs=1, int32_t fios=1, int32_t dupinsts=1, int32_t soutputs=2, bool snapLabels=false, int32_t snapSize=5, bool instNamesSpice=true)

Checks and extracts the schematic cv; schCheck calls this with the settings of the Check Schematic dialog. Each of fwires (floating wires), finputs (floating inputs), foutputs (floating outputs), fios (floating inouts), dupinsts (duplicate instance names) and soutputs (shorted outputs) sets how that check is reported: 0 = ignored, 1 = warning, 2 = error. snapLabels, snapSize and instNamesSpice are as for schCheck. Returns the number of errors.

int32_t ui::uiSymCheck(cellView *cv)

Checks the symbol cv; symCheck calls this. Returns the number of errors.

int32_t ui::viewCheck(const char *libName, const char *cellName=NULL, const char *viewName="symbol")

Checks that the views of a cell agree: each view must have the same pins, with the same directions, as the reference view viewName (or the first view if the cell has no such view). If cellName is None, all cells in library libName are checked. Returns the number of errors, or -1 if the library is not open.

bool ui::checkExtracted(cellView *cv)

Returns true if the schematic cv, and the schematics of the cells it instantiates, have been checked (extracted) since they were last modified. Reports the first one that has not and returns false.

line = ui::routeWire(Point start, Point stop, char *netName=null, float64_t wrongWayCost=4.0, float64_t blockageCost=4.0, float64_t heuristic=1.2)

Routes a line on the wire layer from start to stop, avoiding obstacles (symbols and parallel collinear wires). If the route is successful, returns the line object created, or None if failed. If netName is specified, then the line is assigned that net name. wrongWayCost and blockageCost are the router's costs for a wrong way step and for passing a blockage, and heuristic weights its estimate of the remaining distance. This function does nothing in non-graphics mode.

bool ui::routeTrack(Point start, Point stop, int16_t layer, const char *netName=NULL, int16_t stopLayer=-1)

Routes a track in the current window from start on layer to stop on stopLayer (by default the same layer). Between routing layers this uses all the routing layers and vias; otherwise it routes on the one layer. If netName is not given, the net of the shape at start is used. Returns true if successful. This function does nothing in non-graphics mode.

bool ui::globalRoute(cellView *cv=NULL, int32_t tracksPerGcell=15, int32_t iterations=30)

Global routes cv, or the design in the current window if cv is None. The other settings (costs, options) are this session's ones from the Route menu's dialogs. The congestion map is shown if cv is in the current window. Returns false if routing could not be set up or was cancelled.

bool ui::detailRoute(cellView *cv=NULL, int32_t tracksPerGcell=15, int32_t globalIterations=30, int32_t detailIterations=5, bool deleteExisting=false, bool useCurrentGlobalRoute=false)

Global routes cv (or the design in the current window if None), then detail routes the nets inside its guides, writing wires and vias into cv.

Returns false if routing could not be set up or was cancelled.

int32_t ui::deleteRouting(cellView *cv=NULL, bool specialToo=false, bool regularOfSpecialNets=false, bool specialSignalNets=false)

Deletes the routing (paths, segments, vias) of the regular nets of cv (or the design in the current window if None), and of special nets too if specialToo. With regularOfSpecialNets, the regular routing of special nets (e.g. a clock's wiring to regular pins) goes too, keeping their special routing. Returns the number of objects deleted.

bool ui::createCellView(char *libName, char *cellName, char *viewName, int32_t shape=0, int32_t pinSize=4, float64_t snapGrid=0.0625)

Create a symbol cellView from the given cellView (normally a schematic). Returns true if successful. The symbol outline can be set by shape, and can be 0 (rectangular), 1 (triangular) or 2 (circular). pinSize sets the pi size in database units. snapGrid sets the snapping grid of the generated shapes

bool ui::deleteCellView(const char *libName, const char *cellName, const char *viewName)

Delete the cellView specified by libName, cellName and viewName, closing any window it is open in. Returns true if successful, false if the cellView is not found.

bool ui::renameCellView(const char *libName, const char *cellName, const char *viewName)

Rename the cell specified by libName, cellName and viewName. A dialog will be displayed prompting for the new cell name. This function does nothing in non-graphics mode.

bool ui::copyCell(const char *libName, const char *cellName)

Copy all views of the cell specified by libName and cellName. A dialog will be displayed prompting for the destination library and new cell name. Returns true if successful. This function does nothing in non-graphics mode.

ui::properties(const char *libName, const char *cellName, const char *viewName)

Display the properties of the cell specified by libName, cellName and viewName. This function does nothing in non-graphics mode.

ui::properties(dbObj *obj)

Display the properties of the object obj in the Query dialog. This function does nothing in non-graphics mode.

bool ui::copyCellView(const char *libName, const char *cellName, const char *viewName)

Copy the cellView specified by libName, cellName and viewName. A dialog will be displayed prompting for the destination library, cell and view names, and whether to copy the hierarchy. Returns true if successful. This function does nothing in non-graphics mode.

bool ui::copyHierCellView(library *dest, cellView *cv)

Copies the cellViews of the cells instantiated by cv, hierarchically, into library dest, skipping any that already exist there and cells from the basic library. Returns false if a master cell does not exist.

bool ui::saveCellView(cellView *cv)

Saves the cellView cv to its library on disk. Returns true if successful.

bool ui::saveCellView(const char *libName, const char *cellName, const char *viewName)

Saves the cellView specified by libName, cellName and viewName to its library on disk. Returns true if successful, false if it is not found.

bool ui::saveLib(library *lib, bool verbose=true, bool saveCells=true)

Saves the library lib to its existing path; if it has none, prompts for one. verbose and saveCells are as for fileSaveLibAs. Returns true if successful.

bool ui::checkIfEdited(cellView *cv)

If cv has been edited, asks whether to save it. Returns true if it is OK to go on and close the cellView, false if the user cancelled.

QVector<QString> ui::findTopCells(library *lib)

Finds the cellViews of lib that are not instantiated by any other cellView, returning "cellName viewName" for each. The QVector result is not converted to a Python list.

ui::execCallback(const char *cmd)

Runs the Python command cmd; this is how menu, toolbar and dialog callbacks are run.