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.
- libName The library to create the cellView in.
- cellName The cell name.
- viewName The view name. The view is created if it does not exist; if it does, its view type must match viewType.
- viewType The view type, e.g. maskLayout, schematic, symbol.
- pCellName If isPCell is True, the PCell Python file to create the PCell supermaster from; the cell is then named after it.
- isPCell If True, a PCell supermaster is created from pCellName.
- openCell If True, the new cellView is opened in a window.
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.
- libName The library name to import the techfile into. The library is created if it does not already exist.
- techFileName The name of the techfile.
- dbu The number of database units to one micron.
- merge If True, the techfile is merged with the eixting techfile, else the existing techfile is overwritten.
- verbose If True, detailed information is written to the logfile.
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.
- libName The library to export the techfile from.
- techFileName The name of the techfile.
- systemLayers If 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 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.
- libName The name of the library to import to.
- gdsFileName The GDS2 file name.
- dumpFile The name of an ascii file representing the GDS data, if do_dump is True.
- csen sets case sensitivity.
- 0 = preserve case,
- 1 = convert to upper,
- 2 = convert to lower.
- do_dump To write an ascii representation, set to True and set dumpFile to the name of a file.
- 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.
- gdsInstAttr specifies the GDS2 attribute number for instance names, if present.
- compressed Tf True, a gzip compressed format file is expected and will be uncompressed during stream in.
- dubiousDataIf True, dubious data constructs in the GDS2 file are reported.
- setDBUfromGDS If True, the library DBUperUU is set from the GDS DBU.
- reportCells If True, cells are reported in the message window as they are read.
- pathConv is used to control 2 point path conversion.
- 0 = 2point manhattan paths are converted to rectangles.
- 1 = 2 point manhattan paths are set to H/VSegs.
- 2 = (the default), paths remain as paths.
- layers determines which layers are imported.
- 0 = (the default), all layers found in the GDS2 file are converted.
- 1 = Only layers that are defined in the techfile with gds layer number/datatypes are imported.
- 2 = Only a single layer will be imported, defined by layer and datatype.
- layer is used if the layers param is set to 2 (single layer) and specified the GDS layer number to read.
- datatype is used if layers param is set to 2 (single layer) and specifies the GDS datatype to read.
- openTopCell If True, 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.
- setLibName If True, the library name is set to that of the GDS2 library name.
- convertVias If 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.
- importPCells If True, PCell information is imported from GDS2 properties written by exportGds2.
- mapList and refLibList are used by the Import GDS2 dialog (cell name mapping and reference libraries). They cannot be built from Python, so leave them at their defaults.
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.
- libName The name of the library for export.
- viewNameList A space seperated list of view names to export. Only views in the list will be exported; others will be skipped.
- gdsFileName The name of the GDS file to write to.
- outputLayers Specifies an output techfile layer to write. If -1 is specified (the default), then all layers are written.
- outputAllCells If True then all cells in the library are output to the GDS2 file and topCellName is ignored.
- outputAllCells If True, outputs all cells. If False, then topCellName is a space or comma delimited list of cells to output.
- outputChildCells If True, all child cells of the top cell are output, else only the top level cell(s) are output.
- outputNetAttrs If True then net names are output as GDS2 attributes with attribute number given by netAttr.
- outputDevAttrs If True then device names are output as GDS2 attributes with attribute number given by devAttr.
- outputInstAttrs If True then instance names are output as GDS2 attributes with attribute number given by instAttr.
- compressed If True the GDS2 file is written in gzip compressed format according to RFC1951.
- reportCells If 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.
- singleNet If True, then only shapes and vias with net attributes and a net name matching netName will be output.
- exportPCells If True, PCell information is exported as GDS2 properties that can be read by importGds2.
- writeSegsAsPaths If True, HSeg/VSegs will be written as paths, else they will be written as rectangles.
- allowNonOrthoArrays If True, nonorthogonal arrays will be written, else they will be flattenned.
- mapList and refLibList are used by the Export GDS2 dialog (cell name mapping and reference libraries). They cannot be built from Python, so leave them at their defaults.
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.
- libName The library name ot import to. It will be created if it does not already exist.
- lefFileName The name of the LEF file to import.
- compressed If True a gzip compressed format file is expected and will be uncompressed during LEF in.
- 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.
- allShapes If True, then text labels are generated for all pin shapes.
- metLayers If 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="", const char * groundNets="", bool separatePorts=false, bool writeNonDefRules=true, int32_t namesCaseSense=1, const char *busBitChars="[]", const char *dividerChar="/")
Export a LEF file.
- libName The library name to export from.
- lefFileName The name of the LEF file.
- technology If True, the LEF technology section will be included in the LEF file.
- allCells is true, all library cells will be output.
- allCells If True, LEF for all cells is exported. If False, LEF for the cell defined by cellName and viewName is output.
- 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.
- 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.
- seperatePorts If True, net shapes will be written as separate PORTs in the LEF.
- writeNonDefRules If True, any non default rules defined in the library will be written.
- namesCaseSense sets the NAMESCASESENSE value in LEF.
- 0 = no NAMESCASESENSE keyword is written to the LEF.
- 1 = (the default), NAMESCASESENSE keyword in the LEF has the value ON.
- 2 = NAMESCASESENSE keyword in the LEF has the value OFF.
- busBitChars defines the bus bit start/end characters. The default is "[]".
- dividerChar defines the divider character; the default is "/".
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.
- libName The name of a library to import to, which must exist.
- viewName The viewName to use.
- defFileName The name of the DEF file to import. The cellName is determined from the DEF DESIGN keyword
- ecoMode If 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.
- compressed If True a gzip compressed format file is expected and will be uncompressed during DEF in.
- reportMissingPins If True , missing net connections to pins will be reported.
- importSpecial If True then the SPECIALNETS section is imported.
- importRegular If True then the NETS section is imported.
- reportUnplacedComps If True then any components with a placement status of UNPLACED will be reported.
- openTopCell If True , the top cell (the DESIGN in DEF) will be opened.
- viewList is a space delimited string 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.
- generateLabels If True , pin text labels are created for the DEF PINs.
- metLayers If True , the pin labels are created on the same layer as the pin, else the system layer TEXT is used.
- additionalPurpose If 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.
- libName The library name to export from.
- cellName The cell name to export from.
- viewName The view name to export from.
- comps If True, the COMPONENTS section will be output.
- pins If True, the PINS section will be output.
- regular If True, the NETS section will be output;
- special If True, the SPECIALNETS section will be output.
- regularRouting If True, then routing from the NETS section is output, else just the connectivity.
- specialRouting If 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.
- libName The library name to import into.
- verilogFileName The name of the Verilog file to import. Cells with names matching the verilog module names are created with a view type of netlist.
- powerNet Specifies the supply net used to resolve 1'b1 references.
- groundNet Specifies the ground net used to resolve 1'b0 references.
- flatten If 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.
- 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, bool flatMode=true, const char * switchList="", const char * stopList="")
Export a Verilog file. Currently only a flat verilog netlist is output.
- libName is the library name to export from.
- verilogFileName The name of the verilog file to export.
- cellName The cell name to export.
- viewName The view name to export.
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.
- libName The name of the library to import into. The library is created if it does not already exist.
- oasisFileName The name of the Oasis file to import.
- dubiousData If True, dubious constructs in the Oasis data are reported.
- allowNonPrintingChars If True, non-printing characters will be allowed to be read; normally Oasis only permits printable characters in a-string or n-string types.
- reportCells If True, cells are reported in the message window as they are read.
- pathConv controls 2 point path conversion, as for importGds2: 0 = 2 point manhattan paths are converted to rectangles, 1 = they are converted to H/VSegs, 2 = (the default) paths remain as paths.
- openTopCell If 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.
- 0 = duplicate cells replace any existing cell definitions.
- 1 = duplicate cells definitions are ignored.
- 2 = duplicate cell data is merged into existing cells.
- viewName sets the view name of cellViews created during import.
- verbose If True, writes verbose messages.
- layer_names If True, writes layer names to the OASIS file if true.
- annotate_netsIf True, annotates net names to shapes if true.
- net_attr_num The net property number for net annotation.
- annotate_devs If True, annotate device names to shapes if true.
- dev_attr_num The device property number for device annotation.
- annotate_insts If True, annotate instance names to insts if true.
- inst_attr_num The instance property number for inst annotation.
- mapList is used by the Import OASIS dialog for cell name mapping. It cannot be built from Python, so leave it at its default.
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.
- libName The name of the library to export from.
- viewNames All views specified in the space or comma delimited list are output.
- oasisFileName The name of the Oasis file to export.
- outputAllCells If True then all cells in the library are output to the GDS2 file and topCellName is ignored. If False then topCellName is a space or comma delimited list of cells to output.
- strict If True, the OASIS file is written in STRICT mode.
- cblock If True, CBLOCK compression is used which can substantially reduce the output file size.
- cellOfsets If True, 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.
- reportCells If True,, cells are reported in the message window as they are written.
- grid Is used when exporting ellipses and is the snap grid for vertices.
- layer_names If true, write layer names to OASIS file.
- output_layer The layer number to write, or -1 for all layers.
- writeSegsAsPaths If true, Write HSeg/VSeg objects as paths. Else will be paths for > 2 vertices, boxes for 2 vertex segs.
- writeViasAsCells If true, Write vias as cells, else flatten vias to shapes.
- allowNonPrintingChars If true, Allow non-printing chars in output OASIS.
- compression The level of shape compression. 0=no compression, 5=maximum compression (default).
- allowNonOrtho If true, Allow non-orthogonal arrays. If false, these arrays will be flattenned.
- writeImplicitRefs If true, Write implicit refs for TEXTSTRINGS, PROPSTRINGS, PROPVALUES, CELLNAMES.
- write_S_BOUNDING_BOX If true, Write cell bounding box info to the OASIS file.
- mapList is used by the Export OASIS dialog for cell name mapping. It cannot be built from Python, so leave it at its default.
bool ui::importDxf( const char * libName, const char * cellName, const char * dxfFileName, int32_t dbu=10000)
Import a DXF file.
- libName The library to import DXF into. The library is created if it does not already exist.
- cellName The cellName to import into. The viewName is 'layout'
- dxfFileName The name of the DXF file.
- dbu The database units to use.
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.
- libName The library to exort DXF from.
- cellName The cellName to export from. The view name is 'layout'.
- dxfFileName The name of the DXF file.
- outputText If True, then text labels are output.
- allLayers If True, then all layers are output to the DXF file, else only the currently visible layers are output.
- netText If True, net text is written.
- netHeight If specified, the neight of net text is used, else the default 1.0 is used.
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.
- libName The library to import CDL into.
- cdlFileName The CDL filename.
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.
- libName The library to expport from.
- cellName The cellName to export.
- viewName The view name to export.
- ccdlFileName The CDL file name.
- globals is a space delimited list of global net names e.g. "VDD VSS".
- pinOrder is a space delimited list of pin names; if present it will be used as the pin order for the subcircuit.
- annotateXY If True, XY coordinates of instances are written in the CDL file as $X= / $Y= values.
- microns if True, will set the CDL file units to microns, else metres is used.
- rmodel If 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).
- filterCaps If True, and a positive filterCapLimit is specified, any parasitic capacitances below this limit (in Farads) will not be written in the CDL file.
- mergeCaps If True, then parasitic caps between net pairs are lumped all togther and reported only once per net pair.
- trueSpice If True, uses true Spice syntax, else an extended syntax is used.
- 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 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.
- libName The name of the library to export from.
- cellName The cellName to export from.
- viewName The name of the view to export from.
- cdlFileName The name of the CDL file to export.
- switchList is a space delimited list of view names the netlister can switch into e.g. "schmatic symbol".
- stopList is a space delimited list of views the netlist can stop on e.g. "symbol", which should have a NLPDeviceFormat string property to describe the netlist format for that cellView.
- globals is a space delimited list of global net names e.g. "vdd vss".
- addEnd If True, a '.end' line is added to the end of the netlist (for Spice correct syntax of a complete netlist).
- microns If True, sets the netlist units to microns, else metres are used.
- rmodel If 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).
- filterCaps If True, and a positive filterCapLimit is specified, any parasitic capacitances below this limit (in Farads) will not be written in the CDL file.
- mergeCaps If 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.
- writeAsSubckt If True, writes the CDL as a subckt definition rather than a top level netlist.
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.
- libName The library name to import into.
- dspfFileName The name of the DSPF file.
- netsToRead An optional space delimited list of net names to read; if null then all nets are read.
- saveC If True, parasitic capacitors in the DSPF are saved to the db.
- saveR If True, parasitic resistors in the DSPF are saved to the db.
- saveI If True, instances in the DSPF are savved to the db.
- overwrite If True, existing net info is overwitten.
- purpose is the layer purpose that the net shapes in the DSPF are created on.
bool ui::exportDSPF( const char * libName, const char * cellName, const char * viewName, const char * dspfFileName)
Exports a DSPF file.
- libName The library to export from.
- cellName The cell name to export from.
- viewName The view name to export from.
- dspfFileName The name of the DSPF file to export.
bool ui::importEdif( const char * edifFileName, bool useScale)
Imports a EDIF file.
- edifFileName The name of the EDIF file to import.
- useScale If True, 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 ui::exportEdif( const char * libName, const char * cellName, const char * viewName, const char * edifFileName, const char * extLibs)
Exports a EDIF file.
- libName The library to export from.
- cellName The cell name to export from.
- viewName The view name to export from.
- edifFileName The name of the EDIF file to export.
- 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 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.
- libName The name of the library to import the techfile into.
- displayName The display.drf file name.
- skillFileName The Skill techfile name.
- dbu The database units per micron.
- useMapFile If True, the map file mapFile is used to read layer name/purpose to GDS layer/datatype mappings.
- mapFile The name of the GDS map file.
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.
- libName The name of the library to import the techfile into.
- displayName The display.drf file name.
- skillFileName The Skill techfile name.
- dbu The database units per micron.
- useMapFile If True, the map file mapFile is used to read layer name/purpose to GDS layer/datatype mappings.
- mapFile The name of the GDS map file.
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.
- libName The name of the library to import the techfile into.
- displayName The display.drf file name.
- techName The Laker techfile name.
- dbu The database units per micron.
- useMapFile If True, the map file mapFile is used to read layer name/purpose to GDS layer/datatype mappings.
- mapFile The name of the GDS map file.
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.
- fileName The Hercules error marker file.
- libName The library to import error markers into.
- cellName The cell name to import to.
- viewName The view name to import into.
bool ui::importCalibre( const char *fileName, const char *libName, const char *cellName, const char *viewName)
Imports a Calibre error file.
- fileName The Calibre error marker file.
- libName The library to import error markers into.
- cellName The cell name to import to.
- viewName The view name to import into.
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.
- inFile The hierarchical CDL input file.
- outFile The flattenned CDL output file.
- topCellName The name of the top level subcircuit.
- delimiter The hierarchy delimiter character to use.
ui::scaleCells( cellView *cv, db_Float64 scaleFactor, db_Int32 grid, bool allCells)
> Scale cell(s) hierarchically.
- cv The cellView object of the cell to scale.
- scaleFactor The scale factor to apply to the cell(s).
- grid The snap grid for scaled coordinates.
- allCells If True, all cells in the library will be scaled.
ui::scaleCell( cellView *cv, db_Float64 scaleFactor, db_Int32 grid)
> Scale a cell.
- cv The cellView object of the cell to scale.
- scaleFactor The scale factor to apply to the cell.
- grid The snap grid for scaled coordinates.
ui::biasCells( cellView *cv, int16_t layer, int32_t biasFactor, int32_t grid, int32_t allCells)
Bias cell(s).
- cv The cellView object of the cell(s) to bias.
- layer The techfile layer number of the layer to bias.
- biasFactor The bias factor to apply to the cell.
- grid The snap grid for scaled coordinates.
- allCells If True, all cells in the library will be biassed.
ui::biasCell( cellView *cv, int16_t layer, int32_t biasFactor, int32_t grid)
Bias a cell.
- cv The cellView object of the cell to bias.
- layer The techfile layer number of the layer to bias.
- biasFactor The bias factor to apply to the cell.
- grid The snap grid for scaled coordinates.
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.
- cv The current cellview object.
- start The start coord Point
- mode Can be one of the following:
- 1 = Trace the net and highlight the 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, highlight the traced shapes, and save the shapes to the cellView given by libName / cellName / viewName. The shapes are flattened: each is saved where it is placed in cv.
- addConnectivity If True, and a netName is given, all traced shapes are assigned to that net (created if needed).
- netName The net name to assign.
- libName The library name for mode 3.
- cellName The cell name for mode 3.
- viewName The view name for mode 3.
- red, green, blue, alpha The highlight colour.
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.
- libName1 The library name of the first cellView to compare.
- cellName1 The cell name of the first cellView to compare.
- viewName1 The view name of the first cellView to compare.
- libName2 The library name of the second cellView to compare.
- cellName2 The cell name of the second cellView to compare.
- viewName2 The view name of the second cellView to compare.
- compareLayer The techfile layer number to compare, or -1 for all layers.
- hier If True, compare hierarchically.
- countShapes If True, the number of shapes in both cellviews must match, if False, they can be different (but the XOR result must match).
- outputLayer The layer that difference shapes are written on.
- outputCell Which of the two cellViews the difference shapes are written to (1 or 2).
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.
- libName1 The library name of the first cellView to compare.
- cellName1 The cell name of the first cellView to compare.
- viewName1 The view name of the first cellView to compare.
- libName2 The library name of the second cellView to compare.
- cellName2 The cell name of the second cellView to compare.
- viewName2 The view name of the second cellView to compare.
- compareLayer The techfile layer number to compare, or -1 for all layers.
- hier If True, compare hierarchically.
- multithreaded If True, run multithreaded mode.
- maxThreads The maximum nomber of threads to run concurrently.
- tileAuto If True, use an automatic tiling algorithm to determin the number of tiles.
- tileWidth Set the tile width in non-auto mode, in database units.
- tileHeight Set the tile height in non-auto mode, in database units.
- outputLayer Set the output layer for error shapes.
- outputCell Which of the two cellViews the error shapes are written to (1 or 2).
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.
- libName1 The library name of the first cellView to compare.
- cellName1 The cell name of the first cellView to compare.
- viewName1 The view name of the first cellView to compare.
- libName2 The library name of the second cellView to compare.
- cellName2 The cell name of the second cellView to compare.
- viewName2 The view name of the second cellView to compare.
- libName3 The library name of the output cellView.
- cellName3 The cell name of the output cellView.
- viewName3 The view name of the output cellView.
- compareLayer The techfile layer number to compare, or -1 for all layers.
- hier If True, compare hierarchically.
- multithreaded If True, run multithreaded mode.
- maxThreads The maximum nomber of threads to run concurrently.
- tileAuto If True, use an automatic tiling algorithm to determin the number of tiles.
- tileWidth Set the tile width in non-auto mode, in database units.
- tileHeight Set the tile height in non-auto mode, in database units.
- outputLayer Set the output layer for error shapes.
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.
- libName The library name of the cellView to process.
- cellName The cell name of the cellView to process.
- viewName The view name of the cellView to process.
- opType The operation to perform:
- OP_AND - two layer and
- OP_OR2 - two layer or
- OP_OR1 - single layer or
- OP_NOT2 - two layer not
- OP_NOT1 - single layer not
- OP_XOR - two layer xor
- OP_SIZE
- OP_OVERUNDERSIZE
- OP_SELECTTOUCH
- OP_SELECTOVERLAP
- OP_SELECTABUT
- lyr1 The first layer
- lyr2 The second layer
- lyr3 The output layer
- hier If True, performs hierarchically; all input is flattenned before processing.
- outputTraps If True, outputs shapes as trapezoids, else outputs polygons potnetially with holes/cutlines.
- size If True, size output shapes using the sizeBy> value.
- sizeBy Size factor if size> is set, in microns.
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.
- libName1 The library name of the first cellView to process.
- cellName1 The cell name of the first cellView to process.
- viewName1 The view name of the first cellView to process.
- libName2 The library name of the second cellView to process.
- cellName2 The cell name of the second cellView to process.
- viewName2 The view name of the seconf cellView to process.
- libName3 The library name of the output cellView.
- cellName3 The cell name of the output cellView.
- viewName3 The view name of the output cellView.
- opType The operation to perform:
- OP_AND - two layer and
- OP_OR2 - two layer or
- OP_OR1 - single layer or
- OP_NOT2 - two layer not
- OP_NOT1 - single layer not
- OP_XOR - two layer xor
- OP_SIZE
- OP_OVERUNDERSIZE
- OP_SELECTTOUCH
- OP_SELECTOVERLAP
- OP_SELECTABUT
- lyr1 The first layer
- lyr2 The second layer
- lyr3 The output layer
- hier If True, performs hierarchically; all input is flattenned before processing.
- outputTraps If True, outputs shapes as trapezoids, else outputs polygons potnetially with holes/cutlines.
- size If True, size output shapes using the sizeBy> value.
- sizeBy Size factor if size> is set, in microns.
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.
- libName The library name of the cellView to process.
- cellName The cell name of the cellView to process.
- viewName The view name of the cellView to process.
- opType The operation to perform:
- OP_AND - two layer and
- OP_OR2 - two layer or
- OP_OR1 - single layer or
- OP_NOT2 - two layer not
- OP_NOT1 - single layer not
- OP_XOR - two layer xor
- OP_SIZE
- OP_OVERUNDERSIZE
- OP_SELECTTOUCH
- OP_SELECTOVERLAP
- OP_SELECTABUT
- lyr1 The first layer
- lyr2 The second layer
- lyr3 The output layer
- hier If True, performs hierarchically; all input is flattenned before processing.
- outputTraps If True, outputs shapes as trapezoids, else outputs polygons potnetially with holes/cutlines.
- size If True, size output shapes using the sizeBy> value.
- sizeBy Size factor if size> is set, in microns.
- multithreaded If True, run multithreaded mode.
- maxThreads The maximum nomber of threads to run concurrently.
- tileAuto If True, use an automatic tiling algorithm to determin the number of tiles.
- tileWidth Set the tile width in non-auto mode, in database units.
- tileHeight Set the tile height in non-auto mode, in database units.
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.
- libName1 The library name of the first cellView to process.
- cellName1 The cell name of the first cellView to process.
- viewName1 The view name of the first cellView to process.
- libName2 The library name of the second cellView to process.
- cellName2 The cell name of the second cellView to process.
- viewName2 The view name of the seconf cellView to process.
- libName3 The library name of the output cellView.
- cellName3 The cell name of the output cellView.
- viewName3 The view name of the output cellView.
- opType The operation to perform:
- OP_AND - two layer and
- OP_OR2 - two layer or
- OP_OR1 - single layer or
- OP_NOT2 - two layer not
- OP_NOT1 - single layer not
- OP_XOR - two layer xor
- OP_SIZE
- OP_OVERUNDERSIZE
- OP_SELECTTOUCH
- OP_SELECTOVERLAP
- OP_SELECTABUT
- lyr1 The first layer
- lyr2 The second layer
- lyr3 The output layer
- hier If True, performs hierarchically; all input is flattenned before processing.
- outputTraps If True, outputs shapes as trapezoids, else outputs polygons potnetially with holes/cutlines.
- size If True, size output shapes using the sizeBy> value.
- sizeBy Size factor if size> is set, in microns.
- multithreaded If True, run multithreaded mode.
- maxThreads The maximum nomber of threads to run concurrently.
- tileAuto If True, use an automatic tiling algorithm to determin the number of tiles.
- tileWidth Set the tile width in non-auto mode, in database units.
- tileHeight Set the tile height in non-auto mode, in database units.
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.
- libName The library name.
- cellname The cell name.
- viewName The view name.
- netlist> The name of the CDL netlist to compare with the cellView.
- globalNets A string list of global net names e.g. "vdd vss"
- workDir A directory name used for temporary files.
- isHierNetlist If True, the netlist is assumed hierarchical and will be flattenned before comparison.
- delimiter The hierarchy delimier character used if flattening the netlist.
- topCellName The name of the top subcircuit in the netlist if flattening.
- checkDeviceProps If True, device properties e.g. W, L are checked according to Tolerance.
- collapseLikeSized If True, collapse like sized MOS devices.
- noCollapseFingered If True, do not collapse fingered MOS devices.
- noCollapseChains If True, do not collapse chains.
- warnChains If True, warn device chains.
- caseFoldNets If True use case folding on nets.
- noLocalMatching If True, do not use local matching.
- noOptLabelling If True, do not optimise labelling.
- matchProperties If True, match device properties.
- matchPorts If True, match ports (pins)
- warnZeroNets If True, warn nets with no connections.
- verbose If true, use verbose mode.
- errorLimit Set error limit.
- netSizeLimit Set net size limit.
- progressLimit Set progress limit.
- suspectNodeLimit Set suspect node limit.
- Tolerance Set matching tolerance.
- equivInFileName Set equivalent node input file name.
- equivOutFileName Set equivalent node output file name.
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.
- deleteExisting If True, the regular nets' existing routing is deleted first.
- useCurrentGlobalRoute If True, the global route is skipped and the one kept from the last globalRoute of cv in the current window is used; tracksPerGcell and globalIterations are then ignored.
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.