Glade Reference


cellView class

A cellView stores design data. It is a unique combination of a cell and a view. A cellView corresponds to GDS2 STRUCTs, LEF MACROs or a DEF DESIGN. A cellView is stored in a library. The cellView access functions are as follows. Note that all coordinate values are expected in database units. To find the number of database units per micron, use the library dbuPerUU() function.

 

Creating or opening cellViews

A cellView is created using a library object.

cellView * library::dbOpenCellView(char *cellName, char *viewName, char mode)

Create a cellView in an existing library lib with cell cellName and view viewName. The function returns a cellView. mode is a single character denoting the access mode; 'r' signifies readonly access, 'w' signifies write access (the cellview should not already exist and will be created), and 'a' signifies append access (the cellview already exists and is opened for modification). Note that after creating a new cellView and any objects in it, update() must be called to build the data structures before editing/viewing/querying.

 

Creating objects in a cellView

A cellView contains shape and instance/array objects. Shape objects are created on a specified layer number, which is internally represented by a signed 16 bit integer value. To get a layer number given a layer name and purpose, you can use the techfile class functions to get and manipulate layers.


      layer = tech.getLayerNum(layerName, purposeName)
    

 

arc * cellView::dbCreateArc(const Point &origin, int32_t xRadius, int32_t yRadius, float64_t startAngle, float64_t spanAngle, int16_t layer)

Create an arc with the specified origin, X and Y radius. The arc is part of an ellipse with the specified startAngle and spanAngle. Angles are referenced from the 3pm position, with positive angles going anticlockwise.

 

array * ; cellView::dbCreateArray(const char *libName, const char *cellName, const char *viewName, const Point &origin, orient_t orient, float64_t mag, int16_t numRows, int16_t numCols, int32_t rowSpacing, int32_t colSpacing, const char *instName=null)

Create an array in the cellView and returns the array created. The array master cellView is specified by libName, cellName and viewName. The array's origin is given by origin and its orientation by orient. The enumerations R0, R90, R180, R270, MX, MXR90, MY, MYR90 can be used to specify the orientation. Orientations other than variants of 90 degrees are not supported. The magnification is specified by mag. If specified, instName is used to name the instance; else the instance name is autogenerated with the first being I0, then I1, I2 etc. numRows specifies the number of rows and must be greater than 0. numCols specifies the number of columns and must be greater than 0. rowSpacing is the spacing between rows and can be negative or positive, as can colSpacing.

 

array * cellView::dbCreateArray(library *lib, const char *cellName, const char *viewName, const Point &origin, orient_t orient, float64_t mag, int16_t numRows, int16_t numCols, int32_t rowSpacing, int32_t colSpacing, const char *instName=null)

Create an array in the cellView and returns the array created. This is identical to the above but takes a library *, rather than a library name, as argument. The array master cellView is specified by libName, cellName and viewName. The array's origin is given by origin and its orientation by orient. The enumerations R0, R90, R180, R270, MX, MXR90, MY, MYR90 can be used tp specify the orientation. Orientations other than variants of 90 degrees are not supported. The magnification is specified by mag. If specified, instName is used to name the instance; else the instance name is autogenerated with the first being I0, then I1, I2 etc. numRows specifies the number of rows and must be greater than 0. numCols specifies the number of columns and must be greater than 0. rowSpacing is the spacing between rows and can be negative or positive, as can colSpacing.

 

ellipse *e  = cv.dbCreateCircle(const Point & origin, int32_t radius, int16_t layer)

Create a circular ellipse, i.e. one with the same X and Y radius.

 

ellipse * cellView::dbCreateEllipse(const Point & origin, int32_t xRadius, int32_t yRadius, int16_t layer)

Create an ellipse with given origin (the centre of the ellipse), xRadius, yRadius and layer number

 

group * cellView::dbCreateGroup(const char *name, const Point & origin, orient_t orient)

Creates a group with name name, origin at origin, and orientation orient.

 

polygon * cellView::dbCreateHole(int32_t *xpts, int32_t *ypts, uint32_t nPoints, int16_t lyr, shape *obj=nullptr)

Creates a hole in a polygon . The hole to be 'cut' is represented by the polygon defined by xpts, ypts, nPoints. The polygon and hole are on layer lyr. If obj is non-null, it is assumed to be the polygon to cut the hole in; if non-null, the largest polygon that overlaps the hole will be cut. In general, it is better to use the boolean operations to cut holes in polygons as they are more robust.

 

polygon * cellView::dbCreateHole( Point *pts, uint32_t nPoints, int lyr, shape *obj=nullptr)

Similar to above but uses a Point *

 

polygon * cellView::dbCreateHole(shape *shp, shape *obj=nullptr)

Similar to above but uses a shape to cut a hole in this polygon. The shape acts like a 'cookie-cutter' to create the hole.

 

HSeg * cellView::dbCreateHSeg(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int16_t layer, net *n, int32_t width=0, db_PathStyle style=DB_TRUNCATED)

A HSeg is a horizontal track segment. HSegs are a memory efficient way of representing a two point path with a given layer that has a fixed width and style, and as such are used in representing DEF regular net routing. This function creates a HSeg object in the cellView and returns the HSeg created. (x1, y1) is the first point of the HSeg, (x2, y2) is the second point. layer is the layer the HSeg is created on. width is the HSeg width (defaults to 0) and style is the HSeg's path style (defaults to truncated). If the cellView's library does not contain a segparam index for the HSeg with matching layer and width/style, one is created.

 

inst * cellView::dbCreateInst(const char *libName, const char *cellName, const char *viewName, const Point &origin, orient_t orient, float64_t mag=1.0, const char *instName=null)

Create an inst in the cellView and returns the instance created. The instance master cellView is specified by libName/cellName/viewName. The instance's origin is given by origin and its orientation by orient. The enumerations R0, R90, R180, R270, MX, MXR90, MY, MYR90 can be used to specify the orientation. Orientations other than variants of 90 degrees are not currently supported. The magnification is specified by mag. If specified, instName is used to name the instance; else the instance name is autogenerated with the first being I0, then I1, I2 etc.

 

inst * cellView::dbCreateInst(library *lib, char *cellName, char *viewName, const Point &origin, orient_t orient, float64_t mag=1.0, const char *instName=null)

Create an inst in the cellView and returns the instance created. This is identical to the above but takes a library *, rather than a library name, as argument. The instance master cellView is specified bycellName/viewName. The instance's origin is given by origin and its orientation by orient. The enumerations R0, R90, R180, R270, MX, MXR90, MY, MYR90 can be used to specify the orientation. Orientations other than variants of 90 degrees are not currently supported. The magnification is specified by mag. If specified, instName is used to name the instance; else the instance name is autogenerated with the first being I0, then I1, I2 etc.

 

label * cellView::dbCreateLabel(const Point &origin, const char *name, orient_t orient, float64_t height, db_TectAlign presentation, int16_t layer)

Creates a label in the cellView at location origin with text name and returns the label created. The orientation of the label is given by orient and the label height by height. presentation is the alignment of the text label and layer is the label's layer.

 

line * cellView::dbCreateLine(const Point & p1, const Point & p2, int16_t layer)

Creates a wire in the cellView with vertices defined by points p1 and p2 on layer layer and returns the line created.

 

line * cellView::dbCreateLine(int32_t *x, int32_t *y, uint32_t numPoints, int16_t layer)

Creates a wire in the cellView with vertices defined by integer arrays x and y with size numPoints on layer layer and returns the line created.

 

line * cellView::dbCreateLine(<list>, uint32_t numPoints, int16_t layer)

Creates a wire in the cellView with vertices defined by the python list of Point s list. numPoints is the number of points. The line is created on layer layer..

 

lpp * cellView::dbCreateLpp(int16_t layer)

Creates a lpp in the cellView.

 

mpp * cellView::dbCreateMPP(const char *ruleName, int32_t *xpts, int32_t *ypts, uint32_t nPoints)

Creates a MPP (MultiPartPath) in the cellView and returns the mpp created. ruleName is the name of the MPP rule. The array xpts and ypts are the X and Y coordinates of the path. nPoints specifies the number of points.

 

mpp * cellView::dbCreateMPP(const char *ruleName, Point *pts, uint32_t nPoints)

Similar to above but uses a Point *

 

mpp* cellView::dbCreateMPP(const char *ruleName, <list>, uint32_t nPoints)

Creates a MPP (MultiPartPath) in the cellView and returns the mpp created. The python list the coordinates of the path. ruleName is the name of the MPP rule. nPoints specifies the number of points.

 
      myguard = cv.dbCreateMPP('pguard', [[0,0],[1000,0],[1000,1000],[0,1000]], 4)
    

 

mpp * cellView::dbCreateMPP(const char *ruleName, Point *pts, uint32_t nPoints)

Creates a MPP (MultiPartPath) in the cellView using the specified rule ruleName and returns the mpp created. The pts are the coordinates of the path. nPoints specifies the number of points. ruleName is the name of the (existing) mpp rule, as defined in the techfile.

 

mpp * cellView::dbCreateMPP(mppRule *rule, int32_t *xpts, int32_t *ypts, uint32_t nPoints)

Creates a MPP (MultiPartPath) in the cellView using the specified rule and returns the mpp created. The array xpts and ypts are the X and Y coordinates of the path. numPoints specifies the number of points.

 

mpp * cellView::dbCreateMPP(mppRule *rule, Point *pts, uint32_t nPoints)

Creates a MPP (MultiPartPath) in the cellView using the specified rule rule and returns the mpp created. The pts are the coordinates of the path. nPoints specifies the number of points. ruleName is the name of the (existing) mpp rule, as defined in the techfile.

 

mpp * cellView::dbCreateMPP(mppRule *rule, <list>, uint32_t nPoints)

Creates a MPP (MultiPartPath) in the cellView using the specified rule rule and returns the mpp created. The python list the coordinates of the path. nPoints specifies the number of points.

 
      poly = cv.dbCreateMPP(rule, [[0,0],[1000,0],[1000,1000],[0,1000]], 4)
    

path * cellView::dbCreatePath(int32_t *xpts, int32_t *ypts, uint32_t numPoints, int16_t layer, int32_t width, db_PathStyle style, int32_t beginExtent, int32_t endExtent)

Create a path object in the cellView and returns the path created. The array xpts and ypts are the X and Y coordinates of the path. numPoints specifies the number of points and layer the layer the polygon is created on. width is the width of the path and style the path style (0 = TRUNCATE, 1 = ROUND, 2 = EXTEND, 4 = VAREXTEND, 8 = OCTAGONAL). If the path style is type 4, varExtend, then beginExtent and endExtent specify the path extension beyond the beginning and ending points.

 

path * cellView::dbCreatePath(Point *pts, uint32_t numPoints, int16_t layer, int32_t width, db_PathStyle style, int32_t beginExtent, int32_t endExtent)

Similar to above but uses a Point *

 

path * cellView::dbCreatePath(<list>, uint32_t numPoints, int16_t layer, int32_t width, db_PathStyle style, int32_t beginExtent, int32_t endExtent)

Create a path object in the cellView and returns the path created. The python list is a list of points, each of which is a list of x and y coordinates of the point. numPoints specifies the number of points and layer the layer the polygon is created on. width is the width of the path and style the path style (0 = TRUNCATE, 1 = ROUND, 2 = EXTEND, 4 = VAREXTEND, 8 = OCTAGONAL). If the path style is type 4, varExtend, then beginExtent and endExtent specify the path extension beyond the beginning and ending points.

 

polygon * cellView::dbCreatePolygon(int32_t * xpts, int32_t *ypts, int32_r numPoints, int16_t layer, bool use_poly = false)

Create a polygon object in the cellView and returns the polygon created. The array xpts and ypts are the X and Y coordinates of the polygon and should be created in python using the intarray() function. numPoints specifies the number of points and layer the layer the polygon is created on. If use_poly is false (the default), a rectangle will be created instead of a polygon if possible.

For example to create a triangle on layer 3 in python:


        numPoints = 3
        x = intarray(numPoints)
        y = intarray(numPoints)
        x[0] = 0
        y[0] = 0
        x[1] = 2000
        y[1] = 0
        x[2] = 0
        y[2] = 2000
        layer = 3
        poly = cv.dbCreatePolygon(x, y, numPoints, layer)
      

polygon * = cellView::dbCreatePolygon(Point * pts, uint32_t numPoints, int16_t layer, bool use_poly = false)

Similar to above but uses a Point*

 

polygon * cellView::dbCreatePolygon(<list>, uint32_t numPoints, int16_t layer, bool use_poly = false)

Similar to the above, but uses a python list of points, each of which is a list of x and y coordinates of the point.

 
        poly = cv.dbCreatePolygon([[0,0],[1000,0],[1000,1000],[0,1000]], 4, 3)
      

rectangle * cellView::dbCreateRect(const Rect & box, int16_t layer, bool use_rect = false)

Creates a rectangle object in the cellView with bounding box box and on layer layer and returns the created rectangle. If use_rect is false (the default), a square will be created instead of a rectangle if the box width equals the box height.

For example to create a rectangle on layer 3 in python:

      
        box = Rect(0, 0, 1000, 2000)
        layer = 3
        cv.dbCreateRect(box, layer)
      

viaInst * cellView::dbCreateViaInst(const char *name, const Point &origin, orient_t orient = R0)

Creates an viaInst of a via with master name, origin origin and orient orient and returns the viaInst created.

 

VSeg * cellView::dbCreateVSeg(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int16_t layer, net *n, int32_t width=0, db_PathStyle style=DB_TRUNCATED)

A VSeg is a vertical track segment. VSegs are a memory efficient way of representing a two point path with a given layer that has a fixed width and style, and as such are used in representing DEF regular net routing. This function creates a VSeg object in the cellView and returns the VSeg created. (x1, y1) is the first point of the VSeg, (x2, y2) is the second point. layer is the layer the VSeg is created on. width is the VSeg width (defaults to 0) and style is the VSeg's path style (defaults to truncated). If the cellView's library does not contain a segparam entry for the VSeg, one will be created with matching layer and width/style, one is created.

 

group * cellView::dbFindGroupByName(const char* name)

Gets a group with name name if it exists, or nullptr if it is not found.

 

inst * cellView::dbFindInstByName(const char *name)

Finds the instance with name name in the cellView and returns it, or null if not found.

 

inst * cellView::dbFindInstByNameNoCase(const char *name)

Finds the instance with case-insensitive name name in the cellView and returns it, or null if not found.

 

inst * cellView::dbFindInstByRegExp(const char *expr)

Finds the instance with name given by regular expression expr in the cellView and returns it, or null if not found.

 

Creating connectivity in a cellView

A cellView can also contain connectivity, such as nets, pins and ports (physical pin shapes).

 

net * cellView::dbCreateNet(const char *name)

Creates a net in the cellView with name name and returns the net created. If the net already exists in the cellView, the net is not created and the net given by name is returned.

 

net * cellView::dbFindNetByName(const char *name)

Finds the net with name name in the cellView and returns it, or null if not found.

 

pin * cellView::dbCreatePin(const char *name, net *n, db_PinDirection dir)

Creates a logicalpin in the cellView with name name and db_PinDirection dir for the net n and returns the pin created. The net n must exist in the cellView.

 

pin * cellView::dbFindPinByName(const char *name)

Finds the pin with name name in the cellView and returns it, or null if not found.

 

cellView::dbCreatePort(pin *p, shape *s)

Creates a port for pin p . A port is a physical representation of a pin so a valid shape s must be specified.

 

cellView::dbDeleteObj(dbObj *object, bool reallyDelete=true, bool opt=true)

Delete the database object object. If reallyDelete is true, the object is deleted, else it is just removed from the object trees (and hence undoing the delete is possible). If opt is true, the tree is (re)optimised after the delete.

 

cellView::dbDeleteObj(pin *object, bool reallyDelete=true)

Delete the pin object. If reallyDelete is true, the object is deleted, else it is just removed from the object trees (and hence undoing the delete is possible).

 

cellView::dbDeleteObj(net *object, bool reallyDelete=true)

Delete the net object. If reallyDelete is true, the object is deleted, else it is just removed from the object trees (and hence undoing the delete is possible).

 

cellView::dbMergeNet(net * from, net * to)

Merges the net from into net to. All shapes have their connectivity reassigned to the to net; the from net is deleted from the cellView.

 

Creating and updating PCell instances in a cellViewb>

PCell (programmable cell) instances can be created in a cellView. See also loadPCell.

 

inst * cellView::dbCreatePCellInst(const char *libName, const char *cellName, const char *viewName, const Point & origin, orient_t orient=R0, int16_t numRows=1, int16_t numCols=1, int32_t rowSpacing=0, int32_t colSpacing=0)

Create an instance of a PCell in the cellView and returns the instance created. The PCell master must have been previously created e.g. by a call to ui::loadPCell(). libName is the library name containing the pcell, cellName is the cellView name of the PCell and viewName is the view type of the PCell. origin is the instance's origin. If specified, orient is the instance's orientation, otherwise defaulting to R0. If numRows or numCols are not 1, an array is created of PCells.

 

inst * cellView::dbUpdatePCell(inst * originalInst)

Updates a PCell instance after any of its properties have been changed. This is equivalent to querying the PCell instance properties in the GUI and changing them. Note that the originalInst is destroyed, and newInst is created.

If you change your PCell python code and wish to update all existing instances of the PCell in a cellView, you can use this function.

 

cellView::setPCell(bool flag)

Sets this cellView to be a PCell superMaster.

 

bool cellView::isPCell()

returns true if the cellView is a PCell superMaster.

 

cellView::isSubMaster(bool flag)

Sets this cellView to be a PCell subMaster.

 

bool cellView::isSubMaster()

Returns true if the cellView is a PCell subMaster.

 

cellView::setPCellName(const char *name)

Sets the name of the PCell.

 

char * cellView::getPCellName()

Gets the PCell name.

 

cellView::setPCellFile(const char *name)

Sets the PCell filename.

 

char *cellView::getPCellFile()

Gets the PCell filename.

 

Searching for objects in a cellView

dbObjList<dbObj> * cellView::dbGetOverlaps( const Rect &box, int16_t layer, bool allLayers=false, bool instsToo=, bool viaInstsToo=false)

Searches the area given by box for any objects whose bounding boxes overlap the area. If allLayers is 0, then shapes on only the specified layer are returned. If allLayers is 1, shapes on all layers are searched. If instsToo is 1, any instances whose bounding box overlaps the area are returned in addition to any valid shapes, similarly is viaInstsToo is 1 then any via insts that overlap are also checked.

 

int32_t cellView::dbGetOverlaps(dbObjList<dbObj> & list, const Rect & box, int16_t layer, bool allLayers=false, bool instsToo=false, bool viaInstsToo=false)

As dbGetOverlaps, but appends objects found to list. The number of objects found is returned.

 

<list> cellView::dbGetOverlaps(const Rect &box, int layer, bool allLayers=false, bool instsToo=false, bool viaInstsToo=false)

As above, but returns a Python list of dbObj.

 

int32_t cellView::dbGetHierOverlaps(dbObjList< dbHierObj> &list , const Rect &box, int16_t layer, bool allLayers = false, int level = 99)

Searches the are given by box for any objects whose bounding boxes overlap the area. If allLayers is 0, only the shapes on the specified layer are returned. If allLayers is 1, shapes on all layers are searched. The search is carried out hierarchically up to level levels deep. The number of objects found is returned.

 

dbObjList<dbHierObj> * cellView::dbGetHierOverlaps(const Rect &box, int16_t layer, bool allLayers = false, int level = 99)

Searches the are given by box for any objects whose bounding boxes overlap the area. If allLayers is 0, only the shapes on the specified layer are returned. If allLayers is 1, shapes on all layers are searched. The search is carried out hierarchically up to level levels deep.The number of objects found is returned.

A dbHierObj is a simple class containing the object itself, the cellView containing the object and the transform of the object relative to the top level.

 

<list> cellView::getHierOverlaps(const Rect &box, int16_t layer, bool allLayers = false, int level = 99)

As above, but returns a Python list of dbHierObjs.

 

cellView utility functions

UserUnits units = cellView::userUnits()

Returns the user units as inches or microns.

 

cellView::userUnits(UserUnits units)

Sets the user units. units can be either inches or microns.

 

int32_t cellView::dbuPerUU()

Returns the number of database units per user unit. The default number of dbu is 1000 if user units are microns, and 160 if user units are inches.

 

cellView::dbuPerUU(int32_t dbu)

Sets the database units per user unit.

 

cellView::updateBbox()

Updates the cellView's bounding box to enclose all objects it contains. This function is deprecated and update() should be used.

 

cellView::optimiseTrees()

Build the internal data structures for the cellView. This must be called after creating any objects in a new cellView, but before viewing / editing / querying the cellView. This function is deprecated and update() should be used.

 

cellView::setEditable(bool flag)

Sets the cellView editable flag.

 

bool cellView::editable()

Gets the cellView editable flag.

 

cellView::setEdited(bool flag)

Sets the cellView edited flag.

 

bool cellView::isEdited()

Gets the cellView edited flag.

 

cellView::update()

Calls updateBbox(), optimiseTrees(), sets the cellView as edited and sets the modification date. This should be called after a modification, or a set of modifications, to the cellView. For perfomance reasons it is better to call this after a set of operations rather than for each operation.

 

Rect cellView::bBox()

Get the bounding box of the cellView as a Rect.

 

QRect cellView::bBox()

Get the bounding box of the cellView as a QRect.

 

cellView::clearBbox()

Resets the cellView's bounding box to (0,0) (0,0).

 

cellView::bBox(Rect &box)

The existing cellView's bounding box becomes the union of the current bounding box and box.

 

Rect cellView::getBoundary()

Gets the cellView's boundary rectangle, if such a shape exists on the boundary drawing layer.

 

cellView::dbDeleteObj(dbObj *object, bool reallyDelete=true, bool opt=true)

Delete the database object object. If reallyDelete is true, the object is deleted, else it is just removed from the object trees (and hence undoing the delete is possible). If opt is true, the tree is (re)optimised after the delete.

 

int32_t cellView::getNumShapes()

Get the number of shapes in the cellview.

 

int32_t cellView::getNumShapes(int16_t layer)

Gets the number of shapes on a specific layer, where lyr is the layer number.

 

int32_t cellView::getNumInsts()

Get the number of instances in the cellview.

 

int32_t cellView::getNumViaInsts()

Get the number of viaInsts in the cellview

 

int32_t cellView::getNumNets()

Get the number of nets in the cellview.

 

int32_t cellView::getNumPins()

Get the number of pins in the cellview.

 

library * cellView::lib()

Get the cellview's library.

 

cellView::lib(library *lib)

Sets the cellView's library.

 

const char * cellView::cellName()

Get the cellview's name.

 

cellView::cellName(const char *name)

Sets the cellView's cell name.

 

const char * cellView::viewName()

Get the cellview's viewname.

 

cellView::viewName(const char *name)

Sets the cellView's view name.

 

cellView::createDate(uint8_t *c)

Sets the cellView's create date. This is a 6 byte array of the form YY-MM-DD-HH-MM-SS

 

uint8_t * cellView::createDate()

Gets the cellView's create date.

 

cellView::modDate(uint8 *c)

Sets the cellView's modification date. This is a 6 byte array of the form YY-MM-DD-HH-MM-SS

 

uint8_t * cellView::modDate()

Gets the cellView's modification date.

 

cellView::incModCount()

Increment the cellView's edit/modification count.

 

cellView::decModCount()

Decrement the cellView's modification count.

 

int16_t cellView::modCount()

Get the cellView's modification count; if zero the cell has not been edited.

 

int32_t cellView::getNearestEdge(const Point &p, segment &edge, int32_t dist)

Get the nearest segment (object edge) to a point p in the cellview, up to a maximum distance dist.

 

dbObj * cellView::getNearestObj(const Point &p, int32_t dist)

Get the nearest object to a point p in the cellview, up to a maximum distance dist.

 

LppLayerMap & cellView::getLppList()

Get the lpp list for this cellView as a std::map

 

dbLpp * cellView::getLpp(int16_t layer)

Get the layer-purpose pair with layer number layer in this cellview.

 

dbLpp * cellView::getLpp(const char *layerName, const char *purposeName)

Get the layer-purpose pair with layer layerName and purpose purposeName in this cellview.

 

bool cellView::deleteLpp(lpp *lpp)

Delete the layer-purpose pair lpp in this cellview. All objects (shapes, insts and viaInsts) on that lpp will be deleted.

 

<list> cellView::getLpps()

Returns a Python list of all layer-purpose pairs in the cellview. This is a python wrapper created using the SWIG %extend function.

 

int32_t cellView::getNumLpps()

Get the number of lpps in the cellview

 

<list>  cellView::getInsts()

Returns a Python list of all instances in the cellView. This is a python wrapper created using the SWIG %extend function.

 

<list> cellView::getNets()

Returns a Python list of all nets in the cellView. This is a python wrapper created using the SWIG %extend function.

 

<list> cellView::getPins()

Returns a Python list of all pins in the cellView. This is a python wrapper created using the SWIG %extend function.

An example of using the access functions to create text labels on pins follows.

	
      # script to create labels from pins
      #
      # Get the current edit cellView, lib and technology
      cv = getEditCellView()
      lib = cv.lib()
      tech = lib.tech()
      #
      # Get desired pin layer
      lyr = tech.getLayerNum("text", "drawing")
      #
      # Iterate over all top level pins
      #
      pins = cv.getPins()
      for pn in pins :
        name = pn.name()
        # Get the pin shapes and iterate over them
        shapes = pn.getPorts()
        for shp in shapes :
          box = shp.bBox()
          origin = box.centre()
          cv.dbCreateLabel(origin, name, R0, 1.0, centreCentre, lyr)
        # end while
      # end while
      #
      # commit edits
      cv.update()
    

shape *new_shp cellView::roundCorners(shape *shp, int32_t inner_radius, int32_t outer_radius, int32_t segs, float64_t grid)

Rounds the shape shp with the radius given in dbu, using a minimum number of segments segs, and snaps the vertices of the curve to grid in microns. inner_radius is the radius of inner (concave) corners; outer_radius is the radius of outer (convex) corners.

 

Iterators

Instead of using getInsts/getNets/getPins/getLpps it is possible to use iterators in Python:

iter = instIterator(cellView *cv)

Initialises the inst iterator for the cellView. For example:

      # Script to print instance names in a cellview
      #
      from ui import *
      #
      cv = getEditCellView()
      iter = instIterator(cv)
      while not iter.end() :
        inst = iter.value()
        name = inst.instName()
        print "inst name = ", name
        iter.next()
      #
    

iter.next()

Advances the iterator to the next instance.

 

bool iter.end()

Returns false if there are more instances, else returns true if there are no more.

 

inst = iter.value()

Returns the current instance.

 

iter = netIterator(cellView *cv)

Initialises the net iterator for the cellView. The iterator has similar next(), end();and value() functions as above.

 

iter = pinIterator(cellView *cv)

Initialises the pin iterator for the cellView. The iterator has similar next(), end() and value() functions as above.

 

iter = lppIterator(cellView *cv)

Initialises the dbLpp iterator for the cellView. The iterator has similar next(), end() and value() functions as above.

 

iter = dbObjIterator(dbObjList *list)

Initialises the dbObj iterator for a dbObjList. The iterator has similar next(), end() and value() functions as above.

 

iter = shapeIterator(shape *list)

Initialises the shape iterator for a shape. The iterator has similar next(), end() and value() functions as above.

 

Hashtable access

Provided for documentation of the C++ API only.

 

InstHashTable * cellView::getInstHashTable()

Gets the hash table of instances.

 

NetHashTable *cellView::getNetHashTable()

Gets the hash table of nets.

 

PinHashTable *cellView::getPinHashTable()

Gets the hash table of pins.

 

 

Contents|Index

Copyright © Peardrop Design 2024.