Glade Reference


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)

bool ok = 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 ok = ui::updatePCellMaster(char *pcellName)

Searches all libraries for instances of PCells with supermaster names given by name. 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.

 

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

 

ui::setMaxErrorCount(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::maxErrorCount()

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.

 

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::fileSaveAs( 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::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 ok = ui::importTech( const char *libName, const char *techFileName, unsigned int32_t dbu=1000, bool merge=true, bool verbose=true)

Imports the techfile techFileName into the library libName. dbu is the number of database units to one micron. If merge is true, the techfile is merged with the eixting techfile, else the existing techfile is overwritten. if verbose is true, detailed information is written to the logfile. The library is created if it does not already exist. Returns true if no error occurred.

 

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

Exports the techfile techFileName from the library libName. The library must exist. If systemLayers is true, Glade system layers e.g. cursor, backgnd etc will be written to the techfile. This is only necessary if you have modified the system layers in the LSW - for example changed the backgnd color from black to white. Returns true if no error occurred.

 

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 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)

Import the GDS2 file gdsFileName into library libName. The library is created if it does not already exist.
If do_dump is true and dumpFile is a valid file name, the GDS2 will be written in an ascii format suitable for debugging purposes.
gdsScaleFactor can be used to scale all coordinates in the GDS2 file.
gdsXOffset and gdsYOffset can be used to apply a fixed offset to all GDS2 coordinates.
gdsNetAttr specifies the GDS2 attribute number used for net names, if present, gdsDevAttr specifies the GDS2 attribute number used for devices, if present, and gdsInstAttr specifies the GDS2 attribute number for instance names, if present.
If compressed is true, a gzip compressed format file is expected and will be uncompressed during stream in.
If dubiousDatais true, dubious data constructs in the GDS2 file are reported.
IfsetDBUfromGDS is true, the library DBUperUU is set from the GDS DBU.
If reportCells is true, cells are reported in the message window as they are read.
pathconv is used to control 2 point path conversion. If set to 0, 2point manhattan paths are converted to rectangles. If set to 1, 2 pointmanhattan paths are set to H/VSegs. If set to 2 (the default), paths remain as paths.
convLayers determines which layers are imported. If set to0 (the default), all layers found in the GDS2 file are converted. If set to1, only layers that are defined in the techfile with gds layer number/datatypes are imported. If set to 2, only a single layer will be imported, defined by layer and datatype.
If openTopCell is true, all potential top cell candidates are opened in the gui. A top cell candidate is any cell that is not referenced by another cell, and is not empty.
If setLibName is true, the library name is set to that of the GDS2 library name.
If convertVias is true, Glade will convert via cells to Glade vias, and instances of these via cells to viaInsts.
duplicates controls handling of duplicate cell definitions. If 0, duplicate cells replace any existing cell definitions. If 1, duplicate cells definitions are ignored. If 2, duplicate cell data is merged into existing cells.
viewName sets the view name of cellViews created during import GDS2.
If importPCells is true, PCell information is imported from GDS2 properties written by exportGds2.

 

bool ok = ui::exportGds2 ( const char * libName, const char * viewNames, const char * gdsFileName, 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)

Export a GDS2 file gdsFileName from the library libName. viewNames is a space seperated list of view names to export.
If outputAllCells is true then all cells in the library are output to the GDS2 file and topCellName is ignored.
If outputAllCells is false then topCellName is a space or comma delimited list of cells to output.
If outputChildCells is true, child cells of the top cell are output, else only the top level cell(s) are output.
If outputNetAttrs is true then net names are output as GDS2 attributes with attribute number given by netAttr.
If outputDevAttrs is true then device names are output as GDS2 attributes with attribute number given by devAttr.
If outputInstAttrs is true then instance names are output as GDS2 attributes with attribute number given by instAttr.
If compressed is true the GDS2 file is written in gzip compressed format according to RFC1951.
If reportCells is true, cells are reported in the message window as they are written.
grid specifies the manufacturing grid, used to snap vertices of circles/ellipses as they are converted to polygons on export.
writeViaCells if true will write vias as cells and viaInsts as instances, else vias will get flattened.
polyVertexLimit sets the maximum number of vertices for the polygon; polygons with more vertices will be decomposed into trapezoids.
If singleNet is true, then only shapes and vias with net attributes and a net name matching netName will be output.
If exportPCells is true, PCell information is exported as GDS2 properties that can be read by importGds2.

 

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 lefFileName into the library libName. The library will be created if it does not already exist.
If compressed is true a gzip compressed format file is expected and will be uncompressed during LEF in.
If generateLabels is true, text labels will be generated on the Text layer for each pin in the LEF macro.
size sets the size of the generated labels.
If allShapes is true, then text labels are generated for all pin shapes. If metLayers is true, the LEF pin tect is created on the pin layer, else it is created on the system TEXT layer.

 

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=NULL, const char * groundNets=NULL, bool separatePorts=false, bool writeNonDefRules=true)

Export a LEF file lefFileName from library libName. If technology is true, the LEF technology section will be included in the LEF file. If allCells is true, all library cells will be output. If allCells is false, LEF for the cell defined by cellName and viewName is output. The string powerNets is a space delimited list of net names. Any pins with a name in this list will have their +USE attribute set to POWER. Similarly, the string groundNets is a space delimited list of net names; any pins with a name in this list will have their +USE attribute set to GROUND. If seperatePorts is true, net shapes will be written as separate PORTs in the LEF. If writeNonDefRules is true, any non default rules defined in the library will be written.

 

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 defFileName into the library libName, which must exist. The cellName is determined from the DEF DESIGN keyword and the view name from viewName.
If ecoMode is true then the COMPONENTS and PINS sections only are read, and existing components and pins will have their origin and orientation updated from the DEF file.
If compressed is true a gzip compressed format file is expected and will be uncompressed during DEF in.
If reportMissingPins is true, missing net connections to pins will be reported.
If importSpecial is true then the SPECIALNETS section is imported.
if importRegular is true then the NETS section is imported.
If reportUnplacedComps is true then any components with a placement status of UNPLACED will be reported.
If openTopCell is true, the top cell (the DESIGN in DEF) will be opened.
viewList is a space delimited list of views that are used to resolve instance (DEF COMPONENT) masters. When an instance is encountered, a search is made for the a view that matches any of those in the viewList. The first cellView that matches is used.
If generateLabels is true, pin text labels are created for the DEF PINs.
If metLayers is true, the pin labels are created on the same layer as the pin, else the system layer TEXT is used.
If additionalPurpose is true, an additional pin shape is created on the same layer as the pin shape, but with purpose given by purpose.

 

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 defFileName from the library libName, cell cellName and view viewName.
If comps is true the COMPONENTS section will be output.
If pins is true the PINS section will be output.
If regular is true the NETS section will be output;
if special is true the SPECIALNETS section will be output.
If regularRouting is true then routing from the NETS section is output, else just the connectivity.
If specialRouting is true then routing from the SPECIALNETS section is output, else just the connectivity.

 

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 verilogFileName into library libName.
Cells with names matching the verilog module names are created with a view type of netlist.
powerNet and groundNet specify the supply and ground nets used to resolve 1'b1 and 1'b0 references respectively.
If flatten is true the Verilog netlist will be flattened into view flatViewName; topCellName is used as the top cell of the design to flatten.
hPinLayer and vPinLayer are the layer numbers that are used for pins created in the flattened view.
aspect is the aspect ratio of the resulting boundary layer created in the flattened view and utilisation sets the area out the boundary layer such that the total cell area divided by the boundary area equals the utilisation.

 

bool ok = ui::exportVerilog ( const char * libName, const char * cellName, const char * viewName, const char * verilogFileName)

Export a Verilog file verilogFileName from library libName, cell name cellName, and view name viewName. 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 ok = ui::importOasis( const char * libName, const char * oasisFileName, bool dubiousData=true, bool allowNonPrintingChars=false, bool reportCells=false, 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")

Import an OASIS file oasisFileName into the library libName. The library is created if it does not already exist.
If dubiousData is true, dubious constructs in the Oasis data are reported.
If allowNonPrintingChars is true, non-printing characters will be allowed to be read; normally Oasis only permits printable characters in a-string or n-string types.
If reportCells is true, cells are reported in the message window as they are read.
If openTopCell is true, all potential top cell candidates are opened in the gui. A top cell candidate is any cell that is not referenced by another cell, and is not empty.
scale allows scaling of all input data by the factor specified.
xoffset will add the specified offset to all x coordinate data,
yoffset will add the specified offset to all y coordinate data.
csen controls case sensitivity, 0 means preserve case, 1 converts to uppercase, 2 to lowercase.
duplicates controls handling of duplicate cell definitions.
If 0, duplicate cells replace any existing cell definitions.
If 1, duplicate cells definitions are ignored.
If 2, duplicate cell data is merged into existing cells.
viewName sets the view name of cellViews created during import.

 

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 = false, bool cblock = false, bool cellOfsets = false, bool reportCells = false, double grid=0.005)

Export an OASIS file oasisFileName from library libName.
All views specified in the space or comma delimited list viewNamesviewNames are output.
If outputAllCells is true then all cells in the library are output to the GDS2 file and topCellName is ignored.
If outputAllCells is false then topCellName is a space or comma delimited list of cells to output.
If strict is true, the OASIS file is written in STRICT mode.
If cblock is true, CBLOCK compression is used which can substantially reduce the output file size.
IfcellOfsets is checked in STRICT mode, the property S_CELL_OFFSET is written for each cell in the cellname table so that random access to cells are possible allowing e.g. multithreaded reading of the OASIS file.
If reportCells is checked, cells are reported in the message window as they are written.
grid is used when exporting ellipses and is the snap grid for vertices.

 

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

Import a DXF file dxfFileName into the library libName.
The library is created if it does not already exist.
The DXF file is imported into a cell with name cellName and viewname layout.

 

bool ok = ui::exportDxf( const char * libName, const char * cellName, const char * dxfFileName, bool outputText=true, bool allLayers=true)

Export a DXF file dxfFileName from the library libName, cell cellName and view name layout.
If outputText is true then text labels are output.
If allLayers is true then all layers are output to the DXF file, else only the currently visible layers are output.

 

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

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

 

bool ok = ui::exportCDL( const char * libName, const char *cellname, const char *viewName, const char * cdlFileName, const char *globals, 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, const char *nlpPropName="", const char *busLeft="<", const char *busRight=">")

Export a flat CDL file cdlFileName from the library libName with cell cellname, view viewName.
globals is a space delimited list of global net names e.g. VDD and VSS.
If annotateXY is true, XY coordinates of instances are written in the CDL file as $X= / $Y= values.
If rmodel is true then the resistor model name is reported, else the resistor value (R=...) is reported. rpropname is the property that is used to report the resistor value and should be a property of the resistor extraction pcell.
cmodel and cpropname act similarly for capacitors (but not for parasitic capacitors which are always reported by value).
If filterCaps is true and a positive filterCapLimit is specified, any parasitic capacitances below this limit (in Farads) will not be written in the CDL file.
If mergeCaps is true then parasitic caps between net pairs are lumped all togther and reported only once per net pair.
nlpPropName is the name of the NLP property controlling instance netlisting.
busLeft is the left bus bit character.
busRight is the right bus bit character.

<> 

ui::schHNLOut(char *libName, char *cellName, char *viewName, char *cdlFileName, char *switchList, char *stopList, char *globals, bool addEnd=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=">" )

Export a hierarchical CDL file cdlFileName from the library libName with cell cellName and view viewName.
switchList is a space delimited list of view names the netlister can switch into e.g. "schematic symbol".
stopList is a space delimited list of views the netlist can stop on, which should have a NLPDeviceFormat string property to describe the netlist format for the cellView.
globals is a space delimited list of global net names.
If addEnd is true, a '.end' line is added to the end of the netlist (for Spice correct syntax of a complete netlist).
If rmodel is true then the resistor model name is reported, else the resistor value (R=...) is reported.
rpropname is the property that is used to report the resistor value and should be a property of the resistor extraction pcell.
cmodel and cpropname act similarly for capacitors (but not for parasitic capacitors which are always reported by value).
If filterCaps is true and a positive filterCapLimit is specified, any parasitic capacitances below this limit (in Farads) will not be written in the CDL file.
If mergeCaps is true then parasitic caps between net pairs are lumped all togther and reported only once per net pair.
nlpPropName is the name of the NLP property controlling instance netlisting.
busLeft is the left bus bit character.
busRight is the right bus bit character.

 

bool ok = 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 dspfFileName into library libName. netsToRead is an optional space delimited list of net names to read; if null then all nets are read. If saveC is true, parasitic capacitors in the DSPF are saved to the db. if saveR is true, parasitic resistors in the DSPF are saved to the db. If saveI is true, instances in the DSPF are savved to the db. If overwrite is true, existing net info is overwitten. purpose is the layer purpose that the net shapes in the DSPF are created on.

 

bool ok = ui::importEDIF( const char * edifFileName, bool useScale)

Imports a EDIT file edifFileName. If useScale is set, the database units in the EDIF file are used, else the default database units (1000 for layout views, 160 for schematic/symbol views) are used.

 

bool ok = ui::exportEDIF( const char *libName, const char *cellName, const char *viewName, const char * edifFileName, const char *extLibs)

Exports a EDIF file edifFileName from library libName, cell cellName, view viewName. extLibs is a space delimited list of external libs to be used as external in the EDIF. If a library referenced by the cellView is not in extLibs, it is written to the EDIF file.

 

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

Imports a Cadence techfile to library libName displayName is the display.drf file name. techName is the Skill techfile name. dbu is the database units per micron. If useMapFile is true, the map file mapFile is used to read layer name/purpose to GDS layer/datatype mappings.

 

bool ok = 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 to library libName displayName is the display.drf file name. techName is the Laker techfile name. dbu is the database units per micron. If useMapFile is true, the map file mapFile is used to read layer name/purpose to GDS layer/datatype mappings.

 

bool ok = ui::ImportHercules( const char *fileName, const char *libName, const char *cellName, const char *viewName)

Imports a Hercules error file to library libName, cell cellName, view viewName.

 

bool ok = ui::ImportCalibre( const char *fileName, const char *libName, const char *cellName, const char *viewName)

Imports a Calibre error file to library libName, cell cellName, view viewName.

 

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

Reads a hierarchical CDL file inFile and flattens it, writing it to outFile. topCellName is the name of the top level subcircuit, and delimiter is the delimiter character to use for hierarchical names in the output file.

 

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

> Scale cell(s) hierarcically. cv is the cellView of the cell to scale, or any cell in the library. scaleFactor is the scale factor to apply to the cell(s). grid is the snap grid to snap resulting shapes to. If allCells is true, then all cellViews in the library containing cv will be scaled.

 

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

> Scale a cell. cv is the cellView of the cell to bias, or any cell in the library. scaleFactor is the scale factor to apply to the cell(s). grid is the snap grid to snap resulting shapes to.

 

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

Bias cell(s). cv is the cellView of the cell to bias, or any cell in the library. layer is the layer to bias, and biasFactor is the amount to bias the layer in database units. A positive biasFactor will grow the shapes, a negative biasFactor will shrink the shapes. grid is the snap grid to snap resulting shapes to. If allCells is true, then all cellViews in the library containing cv will be biassed.

 

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

Bias a cell. cv is the cellView of the cell to bias, or any cell in the library. layer is the layer to bias, and biasFactor is the amount to bias the layer in database units. A positive biasFactor will grow the shapes, a negative biasFactor will shrink the shapes. grid is the snap grid to snap resulting shapes to. biassed.

 

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::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::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::displayAddThisNet(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.

 

ok = 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.

 

ok = ui::setAllVisible(bool val)

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

 

bool ok = 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 ok = 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.

 

ok = 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.

 

menu = ui::createMenu(const char *name)

Creates a menu called name in the menu bar

 

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

Creates a submenu called name in menu.

 

ui::addSeparator(QMenu *menu)

Adds a separator to the menu.

 

action = 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.

 

action = 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.

 

actionGroup = 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, "!")
        

 

int32_t ui::traceNet(cellView *cv, Point start, int32_t mode, bool addNetName=false, const char *netName=NULL, const char *libName=NULL, const char *cellName=NULL, const char *viewName=NULL)

Runs the net tracer using the current cellView cv, starting tracing from the Point start. Mode can be:

  1. Trace the net and highlight the resulting traced shapes.
  2. Trace the net, and select shapes on the top level only (traced shapes in lower levels of the hierarchy cannot be selected).
  3. Trace the net, hightlight the traced shapes, and save the shapes to the cellView given by libName / cellName / viewName. Note the shapes are flattened.

If addNetName is set true and a netName is given, all traced shapes will be assigned to a net of that name.

The numTraced return parameter is the number of traced shapes.

 

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)

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 comparison is done for compareLayer; if this is set to -1 all layers in the cellViews are compared, else just the layer specified. If hier is false (the default), then the comparison is done at the top level only; if true then it is done hierarchically. The function returns 0 if the two cellViews are identical, -1 if an error occurred e.g. different number of layers in the cells, or different number of shapes (but see countShapes), or the number of differences found. If countShapes is false (the default) then the number of shapes may differ between the cells, but the XOR result must match.

 

int32_t val = 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, int32_t tileWidth=1, int32_t tileHeight=1, int16_t outputLayer=TECH_DRCMARKER_LAYER)

Compares two cellViews using a tiled XOR operation. The comparison is done for compareLayer; if this is set to -1 all layers in the cellViews are compared. If hier is true (1), then the comparison is done hierarchically. The function returns 0 if the two cellViews are identical, -1 if an error occurred, or the number of differences found. If multiThreaded is true (the default), then the layout is tiled and run with maxThreads threads. If tileAuto is true (the default), an intelligent tiling algorithm is used, else tile widths and heights must be specified.

 

bool ok = 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. The cellView is selected by libName, cellName, viewName. The operation type opType can be one of OP_AND (two layer AND), OP_OR2 (Two layer OR), OP_OR1 (single layer merge), OP_NOT2 (Two layer ANDNOT), OP_NOT1 (Single layer NOT), OP_XOR, OP_SIZE, OP_OVERUNDERSIZE (sizes a layer up and then down), OP_SELECTTOUCH (Selects layer1 shapes that touch layer2), OP_SELECTOVERLAP (Selects layer1 shapes that overlap layer2), OP_SELECTABUT (Selects layer1 shapes that abut layer2). hier if true will flatten any hierarchy before applying the operation. If outputTraps is true, outputs the resulting shapes as trapezoids rather than polygons (with holes using cutlines). size if true will size the output shapes by sizeBy microns.

 

bool ok = 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) in a cellView. The cellView is selected by libName, cellName, viewName. The operation type opType can be one of OP_AND (two layer AND), OP_OR2 (Two layer OR), OP_OR1 (single layer merge), OP_NOT2 (Two layer ANDNOT), OP_NOT1 (Single layer NOT), OP_XOR, OP_SIZE, OP_OVERUNDERSIZE (sizes a layer up and then down), OP_SELECTTOUCH (Selects layer1 shapes that touch layer2), OP_SELECTOVERLAP (Selects layer1 shapes that overlap layer2), OP_SELECTABUT (Selects layer1 shapes that abut layer2). hier if true will flatten any hierarchy before applying the operation. If outputTraps is true, outputs the resulting shapes as trapezoids rather than polygons (with holes using cutlines). size if true will size the output shapes by sizeBy microns.

 

bool val = 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, boolcollapseLikeSized= 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. globalNets is a space delimited list of global net names. workDir is used for the creation of temporary files. If isHierNetList is true, then the netlist is treated as hierarchical and will be flattened with delimiter character delimiter and top cell name topCellName. If checkDeviceProps is true, device properties e.g. W, L or MOS devices are checked according to the tolerance specified byTolerance. The remainder of the parameters correspond to Gemini options.

 

int32_t errors = ui::schCheck(char *libName, char *cellName, char *viewName, bool snapLabels, float64_t snapDist)

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.

 

int32_t errors = ui::symCheck(char *libName, char *cellName, char *viewName, bool snapLabels, float64_t snapDist)

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

 

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

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.

 

bool ok = 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

 

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

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

 

ui::renameCell(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.

 

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

Copy 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.

 

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.

 

 

Contents|Index

Copyright © Peardrop Design 2024.