You are on page 1of 66

Database Access with DBTCL (dbGet,

dbSet, dbSchema, dbTransform,


dbQuery)

Rapid Adoption Kit (RAK)

Product Version: Innovus 19.1


August 2019

Note: RAK testcase database can be downloaded from the 'Attachments' section at the bottom
of this PDF. This RAK can also be searched on Cadence Support Portal,
https://support.cadence.com, using the ‘title’ of the RAK.

1
Copyright Statement

© 2019 Cadence Design Systems, Inc. All rights reserved worldwide. Cadence and the Cadence logo are
registered trademarks of Cadence Design Systems, Inc. All others are the property of their respective
holders.

2
Table of Contents
Database Access with DBTCL

Table of Contents

Module 1: dbGet basics: ................................................................................................................. 5

Lab 1-1 Using dbGet to query a selected object or objects ........................................................ 6

Lab 1-2 Using the “.” to traverse to child objects using dbGet ................................................ 13

Lab 1-3 Using the DB Browser to traverse to child objects ..................................................... 16

Module 2: Advanced dbGet.......................................................................................................... 20

Lab 2-1 Other starting objects for dbGet traversal ................................................................... 21

Lab 2-2 Using pattern matching to filter dbGet attribute searches ........................................... 24

Lab 2-3 Using <TAB> completion to find attribute names ..................................................... 25

Lab 2-4 Using pattern matching to filter dbGet return results.................................................. 27

Lab 2-5 Using expressions to filter dbGet return results .......................................................... 32

Module 3: Using dbGet.?h and dbSchema ................................................................................ 38

Lab 3-1 Finding out more descriptive information about an attribute ...................................... 39

Module 4: Modifying object ......................................................................................................... 45

Lab 4-1 Using dbSet to change attributes values ..................................................................... 46

Module 5: Using dbTransform to .................................................................................................. 49

Lab 5-1 Converting coordinates from local to global using dbTransform ............................... 50

Module 6: How to query objects ................................................................................................... 52

Lab 6-1 Find objects in an area using dbQuery........................................................................ 53

Module 7: Using dbShape to ........................................................................................................ 57

Lab 7-1 dbShape basics............................................................................................................ 58

3
Module 8: Using dbGet to ............................................................................................................ 61

Lab 8-1 dbGet sites basics........................................................................................................ 62

Module 9: Extra Credit - Working ................................................................................................ 64

Lab 9-1 Extra Credit ................................................................................................................ 65

4
Module 1: dbGet basics:
interactive queries and
introduction to
database traversal

5
Lab 1-1 Using dbGet to query a selected object or objects

Objective: To introduce features of dbGet using the selected objects as a


starting point

This section will familiarize you with the basics of dbGet for interactive queries of the attributes of
the selected object. The labs have been tested with Innovus 19.1.

Lab setup: starting the software and loading a design

1. Load the design (all labs have the same starting steps, or you can just work from the
design in the same session for each lab).
In a new xterm window, enter the following command:

UNIX> cd DBTCL/work
UNIX> innovus -init ../DATA/DTMF_CHIP.inv

2. Bring up the Innovus GUI.

innovus> win
The design should look like this:

6
3. Select the hard macro in the lower-left corner of the design.

4. With the cursor in the graphic window, use “q” to bring up the Attribute Editor form
and view the attributes for the selected object.
The Attribute Editor form should look like this:

The dbGet command allows similar information to be accessed from the Tcl prompt.
This can be useful for both interactive queries and more complex programming in
Tcl.

5. Use dbGet to access the object pointer for the selected object:

innovus> dbGet selected


0x2aaac8e50620
The 0x* value is the object pointer value and is valid for the current Innovus session.
Be careful when caching the value because the value may become invalid if the
object is deleted. The value, 0x2aaac8e50620, will likely not be the value you see
because each session can be different.

If nothing is selected, 0x0 is returned. This indicates a null pointer value.

7
Using .? of dbGet to access attributes from a single object

6. Use dbGet to find the list of attributes available from the selected object.
Innovus’ dbGet command uses an access style like the Cadence SKILL™ language. The use
of “.?” lists the attributes similar to “~>?” in SKILL™.

innovus> dbGet selected.?


inst: area box box_area box_ll box_llx box_lly box_size box_sizex
box_sizey box_ur box_urx box_ury boxes cell defName dontMergeMultibit
dontSplitMultibit dontTouch dontTouchEffective dontTouchSources group
hInst instTerms isAlwaysOn isAlwaysOnBuffer isHaloBlock isIsolation
isJtagElem isLevelShifter isPhysOnly isSpareGate lithoHalo maskShift
name objType orient pHaloBot pHaloBox pHaloBox_area pHaloBox_ll
pHaloBox_llx pHaloBox_lly pHaloBox_size pHaloBox_sizex pHaloBox_sizey
pHaloBox_ur pHaloBox_urx pHaloBox_ury pHaloLeft pHaloRight pHaloTop
pStatus pStatusCTS pStatusEffective pd pgInstTerms props pt pt_x pt_y
rHaloBotLayer rHaloSideSize rHaloTopLayer sdp useCells

The format is “object type:” (inst: for this example) followed by the list of
“attributes” for that object and is useful for learning what is available from the current
object or as a reminder of the spelling of an attribute name.

If multiple different types of objects were selected, one list would be


shown for each of the different types of object in the selected set.

Using .?? of dbGet to access attributes and their values from a single object

7. Use dbGet to find the list of attributes available and their values from the selected
object.
The use of “.??” lists the attributes and their values similar to “~>??” in SKILL™.

innovus> dbGet selected.??


area: 84000.0
box: {355.28 355.44 655.28 635.44}
box_llx: 355.28
box_lly: 355.44
box_urx: 655.28
box_ury: 635.44
box_sizex: 300.0
box_sizey: 280.0
box_ll: {355.28 355.44}
box_ur: {655.28 635.44}
box_size: {300.0 280.0}
box_area: 84000.0
boxes: {{355.28 355.44 655.28 635.44}}

8
cell: 0x2aaac76a5c50
defname: DTMF_INST/PLLCLK_INST
dontMergeMultibit: 0
dontSplitMultibit: 0
dontTouch: none
dontTouchEffective: true
dontTouchSources: {user none} {lib true} {parent false} {scan false}
group: 0x0
hInst: 0x2aaac8d60110
instTerms: 0x2aaac9198620 0x2aaac9198658 0x2aaac9198690
0x2aaac91986c8 0x2aaac9198700 0x2aaac9198738 0x2aaac9198770
isAlwaysOn: 0
isAlwaysOnBuffer: 0
isHaloBlock: 1
isIsolation: 0
isJtagElem: 0
isLevelShifter: 0
isPhysOnly: 0
isSpareGate: 0
lithoHalo: 0
maskShift: 0
name: DTMF_INST/PLLCLK_INST
objType: inst
orient: R0
pHaloBot: 20.0
pHaloBox: {335.28 335.44 675.28 655.44}
pHaloBox_llx: 335.28
pHaloBox_lly: 335.44
pHaloBox_urx: 675.28
pHaloBox_ury: 655.44
pHaloBox_sizex: 340.0
pHaloBox_sizey: 320.0
pHaloBox_ll: {335.28 335.44}
pHaloBox_ur: {675.28 655.44}
pHaloBox_size: {340.0 320.0}
pHaloBox_area: 108800.0
pHaloLeft: 20.0
pHaloRight: 20.0
pHaloTop: 20.0
pStatus: fixed
pStatusCTS: unset
pStatusEffective: fixed
pd: 0x0
pgInstTerms: 0x2aaad4aa6100 0x2aaad4aa6108
props: 0x2aaad4ddce20 0x2aaad4ddcde8 0x2aaac97e9be8
pt: {355.28 355.44}

9
pt_x: 355.28
pt_y: 355.44
rHaloBotLayer: 0x0
rHaloSideSize: 0.0
rHaloTopLayer: 0x0
sdp: 0x0
useCells:

This is more like the Attribute Editor and is useful in scanning for the values of
specific attributes. The Attribute Editor displays attributes using labels that are
“words”, while the dbGet attributes are terser. Example: “Location” in the Attribute
Editor is equivalent to the .pt attribute of the inst object. Using .?? of dbGet makes it
easy to find equivalent attribute names by looking at the matching values to those in
the Attribute Editor form.

For long lists of objects, the display is limited to the first 10 objects by
default. Refer to the setDbGetMode options to increase the -displayLimit. You
can also change the formatting of the attr/value information into a tabular report
style using “setDbGetMode -displayFormat table”.

Using .? and .?? of dbGet with multiple objects selected

8. Use selectNet to select many net objects.

innovus> selectNet *clk


innovus> dbGet selected
0x2b43ec703958 0x2b43ec703850 0x2b43ec7037f8 0x2b43ec703748 0x2b43ec7033d8
0x2b43ec702da8 0x2b43ec702d50 0x2b43ec702cf8 0x2b43ec702c48 0x2b43ec702bf0
0x2b43ec6fd290 0x2b43ec6fcfd0 0x2b43ec5b8bd0
There are 13 objects selected in this case.

Using .? of dbGet to access attributes from multiple objects

9. Use dbGet to find the list of attributes available from a set of selected objects.

innovus> dbGet selected.?


net: allTerms area avoidDetour botMaskLayerNum
botOneSideSpacingLayerNum bottomPreferredLayer box box_area box_ll
box_llx box_lly box_size box_sizex box_sizey box_ur box_urx box_ury
bus defName dontTouch hNets instTerms isAnalog isCTSClock isClock
isEarlyGlobalRouted isEdit isExternal isFixedBump isGnd isIlmNet
isMixedSignal isPatternTrunk isPhysOnly isPwr isPwrOrGnd isScanNet
mask maxVoltage minVoltage name numInputTerms numOutputTerms numTerms
objType pWires preferredExtraSpace props rule sVias sWires shieldNets
siPostRouteRepair skipAntennaRepair skipRouting terms topMaskLayerNum
topOneSideSpacingLayerNum topPreferredLayer vWires vias weight wires
inst: area box box_area box_ll box_llx box_lly box_size box_sizex

10
box_sizey box_ur box_urx box_ury boxes cell defName dontMergeMultibit
dontSplitMultibit dontTouch dontTouchEffective dontTouchSources group
hInst instTerms isAlwaysOn isAlwaysOnBuffer isHaloBlock isIsolation
isJtagElem isLevelShifter isPhysOnly isSpareGate lithoHalo maskShift
name objType orient pHaloBot pHaloBox pHaloBox_area pHaloBox_ll
pHaloBox_llx pHaloBox_lly pHaloBox_size pHaloBox_sizex pHaloBox_sizey
pHaloBox_ur pHaloBox_urx pHaloBox_ury pHaloLeft pHaloRight pHaloTop
pStatus pStatusCTS pStatusEffective pd pgInstTerms props pt pt_x pt_y
rHaloBotLayer rHaloSideSize rHaloTopLayer sdp useCells
Note that both “net” and “inst” attribute lists are displayed. This indicates that at least
one of each of those types of objects is included in the selected set. Even though there
were 13 objects selected, only two different types were selected (net, inst).

Using .?? of dbGet to access attributes and values from multiple objects

10. Use dbGet to find the list of attributes available from a set of selected objects.

innovus> dbGet selected.??


allTerms: 0x2b43ecb0c060 0x2b43ec9d6460
area: 37.884
avoidDetour: 0
botMaskLayerNum: 0
botOneSideSpacingLayerNum: 0
bottomPreferredLayer: 0x0
box: {1134.87 629.72 1141.47 635.46}
box_llx: 1134.87
box_lly: 629.72
box_urx: 1141.47
box_ury: 635.46
box_sizex: 6.6
box_sizey: 5.74
box_ll: {1134.87 629.72}
box_ur: {1141.47 635.46}
box_size: {6.6 5.74}
box_area: 37.884
bus: 0x0
defname: DTMF_INST/m_digit_clk
dontTouch: false
hNets: 0x2b43ec9a9598 0x2b43ec9212c0
instTerms: 0x2b43ecb0c060 0x2b43ec9d6460
...
...
vias: 0x2b43f6e9cc28 0x2b43f6e9cc60 0x2b43f6e9cd08 0x2b43f6e9cd78
0x2b43f6e9cde8 0x2b43f6e9ce20 0x2b43f6e9cf00 0x2b43f6e9cf38
0x2b43f6e9d018 0x2b43f6e9d050 ... (total length 15)
weight: 2
wires: 0x2b43f6e9cbf0 0x2b43f6e9cc98 0x2b43f6e9cd40 0x2b43f6e9cdb0
0x2b43f6e9ce58 0x2b43f6e9ce90 0x2b43f6e9cf70 0x2b43f6e9cfe0
0x2b43f6e9d088 0x2b43f6e9d0f8 ... (total length 14)

**INFO: (IMPDBTCL-614): Number of objects exceeds limit. Use


setDbGetMode -displayLimit to control the number of objects evaluated by
11
'dbGet <object>.??' query.

Note that the display was limited to the first ten objects and their values. Unlike .?
where the attribute names are only shown once for each different type of object, .??
shows the attribute and value for each object (up to the maximum of objects defined
in -displayLimit).

12
Lab 1-2 Using “.” to traverse to child objects using dbGet

Objective: Introduce dbGet feature to traverse from one object to another

In this section, you will learn how to use dbGet to walk through the database.

Introduction to the “.” operator to traverse to child objects or access specific


attributes

For this section, you are going to start with a single selected object again.

1. Select the hard macro in the lower-left corner of the design (confirm that only
one object is selected).

2. Use dbGet to find the list of available attributes and their values from the
selected object.

innovus> dbGet selected.??


area: 84000.0
box: {355.28 355.44 655.28 635.44}
box_llx: 355.28
box_lly: 355.44
box_urx: 655.28
box_ury: 635.44
box_sizex: 300.0
box_sizey: 280.0
box_ll: {355.28 355.44}
box_ur: {655.28 635.44}
box_size: {300.0 280.0}
box_area: 84000.0
boxes: {{355.28 355.44 655.28 635.44}}
cell: 0x2aaac76a5c50
defname: DTMF_INST/PLLCLK_INST
dontMergeMultibit: 0
dontSplitMultibit: 0
dontTouch: none
dontTouchEffective: true
dontTouchSources: {user none} {lib true} {parent false} {scan false}
group: 0x0
hInst: 0x2aaac8d60110
instTerms: 0x2aaac9198620 0x2aaac9198658 0x2aaac9198690 0x2aaac91986c8
0x2aaac9198700 0x2aaac9198738 0x2aaac9198770
isAlwaysOn: 0
isAlwaysOnBuffer: 0
isHaloBlock: 1
isIsolation: 0
isJtagElem: 0
isLevelShifter: 0

13
isPhysOnly: 0
isSpareGate: 0
lithoHalo: 0
maskShift: 0
name: DTMF_INST/PLLCLK_INST
objType: inst
orient: R0
pHaloBot: 20.0
pHaloBox: {335.28 335.44 675.28 655.44}
pHaloBox_llx: 335.28
pHaloBox_lly: 335.44
pHaloBox_urx: 675.28
pHaloBox_ury: 655.44
pHaloBox_sizex: 340.0
pHaloBox_sizey: 320.0
pHaloBox_ll: {335.28 335.44}
pHaloBox_ur: {675.28 655.44}
pHaloBox_size: {340.0 320.0}
pHaloBox_area: 108800.0
pHaloLeft: 20.0
pHaloRight: 20.0
pHaloTop: 20.0
pStatus: fixed
pStatusCTS: unset
pStatusEffective: fixed
pd: 0x0
pgInstTerms: 0x2aaad4aa6100 0x2aaad4aa6108
props: 0x2aaad4ddce20 0x2aaad4ddcde8 0x2aaac97e9be8
pt: {355.28 355.44}
pt_x: 355.28
pt_y: 355.44
rHaloBotLayer: 0x0
rHaloSideSize: 0.0
rHaloTopLayer: 0x0
sdp: 0x0
useCells:

Notice that the name of the instance is available as a string attribute value
(“DTMF_INST/PLLCLK_INST”) but the name of the cell master is not directly
exposed. Sometimes, you need to walk from the current object to another object
where the information you want is stored. In this case, you can walk from
the “inst” to the “cell” to find the name of the cell master for the inst. In this case, “.”
is used in a way that is similar to the “~>” operator in the SKILL™ language.

3. Use dbGet to find the list of attributes available from the cell object by traversing to
the cell object using “.”.

innovus> dbGet selected.cell.?


libCell: abstractLib abstractView allObstructions baseClass
bottomEdgeName bottomPadding cellDensities defName dontTouch
14
dontUse eeqCells foreigns isAbstractDefined isAlwaysOn isBuffer
isInverter isIsolationCell isLevelShifter isPowerSwitch
isRetention isSequential isTimeDefined isVDDOnBottom
layerShapeObstructions layoutLib layoutView lefFileName
leftEdgeName leftPadding name numBidirs numInputs numOutputs
numPGTerms numPhysTerms numRefs numTerms objType pgTerms
physTerms props rightEdgeName rightPadding shapeViaObstructions
site size size_x size_y subClass symmetryR90 symmetryX symmetryY
terms topEdgeName topPadding
You can see the list of attributes that area available from the object of the cell pointer
(in this case, the .cell pointed to a libCell object, indicating leaf cell from a LEF
MACRO or an OpenAccess abstract view).

4. You might have also used “.??” to query the attributes and their values at this point,
but you only want the name of cell master, so you will replace “.?” with the specific
attribute you are interested in.

innovus> dbGet selected.cell.name


pllclk
Using “.?”, “.??”, and “.”, you will learn which objects have the attributes you are
looking for.

5. The traversal also works when you have multiple objects selected.

innovus> selectNet *clk


innovus> dbGet selected.name
DTMF_INST/m_digit_clk DTMF_INST/digit_clk DTMF_INST/m_rcc_clk
DTMF_INST/rcc_clk DTMF_INST/m_dsram_clk DTMF_INST/m_clk
DTMF_INST/m_spi_clk DTMF_INST/m_ram_clk DTMF_INST/clk DTMF_INST/spi_clk
refclk scan_clk DTMF_INST/PLLCLK_INST

In this case, it worked fine because both types of objects in the selected set (inst, net) had
the .name attribute. There would have been an error if you tried to access the .orient object
that existed on the inst object, but not on the net object. For a heterogeneous list, the child
attribute may not be available for all objects. For those that do not have the attribute,
warnings will be displayed and 0x0 returned for each of those.

15
Lab 1-3 Using the DB Browser to traverse to child objects

Objective: To introduce dbGet-based DB Browser feature to traverse from one


object to another

In this section, you will learn how to use dbGet to walk through the database via the DB Browser.

Introduction to the DB Browser to traverse to child objects or access specific


attributes

For this section, you are going to start with a single selected object again.

1. Select the hard macro in the lower-left corner of the design (confirm that only
one object is selected)

2. With the cursor in the graphic window, use “q” to bring up the Attribute Editor form
and view the attributes for the selected object.
The Attribute Editor form should look like this:

16
The dbGet command allows similar information to be accessed from the Tcl prompt.
This can be useful for both interactive queries and more complex programming in
Tcl.

3. With the cursor in the graphic window, use “v” to bring up the DB Browser form and
view the attributes for the selected object.
The DB Browser form should look like this:

The DB Browser is built on top of dbGet functionality, and the command allows the
same information that can be obtained via dbGet to be traversed in a more graphical
way. This can be useful for both interactive queries and more complex programming
in Tcl.

4. Use dbGet to find the list of available attributes and their values from the selected
object.
The use of “.??” lists the attributes and their values similar to “~>??” in SKILL™.

innovus> dbGet selected.??


area: 84000.0
box: {355.28 355.44 655.28 635.44}
box_llx: 355.28
box_lly: 355.44

17
box_urx: 655.28
box_ury: 635.44
box_sizex: 300.0
box_sizey: 280.0
box_ll: {355.28 355.44}
box_ur: {655.28 635.44}
box_size: {300.0 280.0}
box_area: 84000.0
boxes: {{355.28 355.44 655.28 635.44}}
cell: 0x2aaac76a5c50
defname: DTMF_INST/PLLCLK_INST
dontMergeMultibit: 0
dontSplitMultibit: 0
dontTouch: none
dontTouchEffective: true
dontTouchSources: {user none} {lib true} {parent false} {scan false}
group: 0x0
hInst: 0x2aaac8d60110
instTerms: 0x2aaac9198620 0x2aaac9198658 0x2aaac9198690 0x2aaac91986c8
0x2aaac9198700 0x2aaac9198738 0x2aaac9198770
isAlwaysOn: 0
isAlwaysOnBuffer: 0
isHaloBlock: 1
isIsolation: 0
isJtagElem: 0
isLevelShifter: 0
isPhysOnly: 0
isSpareGate: 0
lithoHalo: 0
maskShift: 0
name: DTMF_INST/PLLCLK_INST
objType: inst
orient: R0
pHaloBot: 20.0
pHaloBox: {335.28 335.44 675.28 655.44}
pHaloBox_llx: 335.28
pHaloBox_lly: 335.44
pHaloBox_urx: 675.28
pHaloBox_ury: 655.44
pHaloBox_sizex: 340.0
pHaloBox_sizey: 320.0
pHaloBox_ll: {335.28 335.44}
pHaloBox_ur: {675.28 655.44}
pHaloBox_size: {340.0 320.0}
pHaloBox_area: 108800.0
pHaloLeft: 20.0
pHaloRight: 20.0
pHaloTop: 20.0
pStatus: fixed
pStatusCTS: unset
pStatusEffective: fixed
pd: 0x0
pgInstTerms: 0x2aaad4aa6100 0x2aaad4aa6108
props: 0x2aaad4ddce20 0x2aaad4ddcde8 0x2aaac97e9be8
pt: {355.28 355.44}
pt_x: 355.28
pt_y: 355.44
rHaloBotLayer: 0x0
rHaloSideSize: 0.0
rHaloTopLayer: 0x0
18
sdp: 0x0
useCells:
Compare the results for the .?? query to the contents of the DB Browser form. Object
attributes that have a .name attribute will be shown as their name. For example, the
cell indicates PLLCLK not the pointer value. All object and objectList type
attributes are shown as buttons for traversal purposes.

5. Use the DB Browser to push and pop through the objects starting with the
selected object.
Click on the button named pllclk (next to the cell attribute label). The DB
Browser form should now look like this:

The displayed information is equivalent to "dbGet selected.cell.??" because you


pushed into the cell object from the selected inst object.
The buttons at the top of the form are "Back" (to pop/return back the previous level),
"Previous", and "Next" where there is more than one object. To see an example, go
"Back" to the selected instance and then click on the button next to the instTerms
label. The push would now be displaying the first of seven objects of type instance
terminals.

19
Module 2: Advanced dbGet
techniques for
programming using
pattern matching to
filter lists of pointers

20
Lab 2-1 Other starting objects for dbGet traversal

Objective: To introduce additional starting points of dbGet

In this section, you will learn how to start a dbGet traversal from other objects (top, head, and user-
specified objects).

Introduction to the additional starting points of dbGet for traversals

For this section, you are going to use the same database as in the earlier lab sections.

1. Use the -help option to find the starting points for dbGet traversal.

innovus> dbGet -help

Usage: dbGet [-help] [-d] [-u] [-v] [-e] [-i <num>] [-regexp] [-p[<num>]]
{<obj>|<objList>|head|top|selected}[.<objType>]...[[.<attrName>|.?|.??|.?h]
[<pattern> | [expression]]

-help # Prints out the command usage


-d # User specified values and return values are in database units.
# Default: All values are in user units, in microns. (bool, optional)
-u # Removes duplicate objects from the query results so that the
# results list contains only unique entries. (bool, optional)
-v # Return values will be items that do not match the specified
# <pattern> or <expression> (bool, optional)
# Example: dbGet -v -p2 top.nets.sWires.layer.name M4
# returns list of pointers to sWire objects on layers other than M4
-e # For avoiding NULL (0x0) pointers and results from being printed. (bool,
# optional)
# This would affect all kinds of outputs. In cases of nested dbGet statements
# -e option should not be used in the inner dbGet statement. This is an incorrect
# usage
# Example : CORRECT USAGE :
# dbGet -e [dbGet -p2 [dbGet -p top.insts.pStatus fixed].cell.name INV1]
# If none of the instances have 'fixed' placement status, the outer dbGet
# will not return a 0x0 but an empty list which TCL would not consider as a list
# element
# INCORRECT USAGE :
# dbGet [dbGet -p2 [dbGet -p -e top.insts.pStatus fixed].cell.name INV1]
-i <num> # For selecting a specific element from the list being returned as output
# -i <num> would select the <num>th element starting from 0
# -i <num> option would also reduce a starting '{' and ending '}' for box and pt
# type attributes
# Example : dbGet top.nets.name sum* -p -i 0
# would return 1st pointer in the list of the nets whose name matches the pattern
# sum*
-regexp # Uses regular expression <pattern> matching (equivalent to Tcl regexp
# command) for string/enum attributes. The option does not apply to
# filtering done using the <expression> method, where the Tcl regexp
# command can be used directly.
# Default: Uses simple wild card pattern matching (bool, optional)
# Example: dbGet -regexp -p top.insts.name M.*
# returns list of pointers to instances whose name starts with M

21
-p[<num>] # Specifies the number of levels to traverse back through the
# specified objects for the query. (-p = 1 level, num indicates 1
# or more) (bool, optional) The -p option is used only with either a
# <pattern> or an <expression> to filter out objects.
# Example: dbGet -p2 top.nets.sWires.layer.name M4
# returns list of pointers to sWire objects on layer M4
{<obj>|<objList>|head|top|selected}[.<objType>]...[.<attrName>|.?|.??|.?h]
# DB object-hierarchy-string. {<obj>|<objList>|head|top|selected}:
# Specifies the starting point for the query; .<objType>: Specifies
# the object type to query. You can specify more than one object in
# the query; .<attrName>|.?|.??|.?h: Specifies the type of
# information to return. (string, required)
<pattern> # Specifies a string expression, numeric value, or boolean to use to
# match object or attribute names or attribute values (string, optional)
# Example: dbGet top.nets.name *clk*
# returns list of pointers to net names that match the *clk* pattern
<expression> # Specifies a tcl expression, using dbtcl attributes and objects,
# to use to match objects which satisfy the tcl expression after replacing
# the dbtcl attributes and objects values at runtime. (string, optional)
# Example: dbGet top.nets {.numTerms > 4}
# returns list of pointers to net objects with greater than 4 connections.

Earlier labs used the selected set as a starting point by specifying the “selected”
keyword. In addition, the dbGet command can start from “top” (the top- cell object),
“head” (root of the database, where technology info is stored), as well as a user-
specified object (either a $variable or a specific 0x… value) or object list (either a
homogeneous or heterogeneous list of objects). The “selected” keyword is
commonly used for interactive queries, while the other starting points can be
equally useful in interactive and programmatic access.

2. Example of using the “top” as a starting point and finding the list of
available attributes:

innovus> dbGet top.?


topCell: bumps fPlan hInst insts markers name nets numBidirs numInputs
numInsts numNets numPGTerms numPhysInsts numPhysNets numPhysTerms
numTerms objType pgTerms physInsts physNets physTerms pinToCornerDist
props statusClockSynthesized statusGRouted statusIoPlaced statusPlaced
statusPowerAnalyzed statusRCExtracted statusRouted statusScanOpted
symmetryR90 symmetryX symmetryY terms texts

3. Example of using the “top” as a starting point:

innovus> dbGet top.terms.name


{tdigit[7]} {tdigit[6]} {tdigit[5]} {tdigit[4]} {tdigit[3]} {tdigit[2]}
{tdigit[1]} {tdigit[0]} tdigit_flag reset int {port_pad_data_out[15]}
{port_pad_data_out[14]} {port_pad_data_out[13]} {port_pad_data_out[12]}
{port_pad_data_out[11]} {port_pad_data_out[10]} {port_pad_data_out[9]}
{port_pad_data_out[8]} {port_pad_data_out[7]} {port_pad_data_out[6]}
{port_pad_data_out[5]} {port_pad_data_out[4]} {port_pad_data_out[3]}
{port_pad_data_out[2]} {port_pad_data_out[1]} {port_pad_data_out[0]}
{port_pad_data_in[15]} {port_pad_data_in[14]} {port_pad_data_in[13]}
{port_pad_data_in[12]} {port_pad_data_in[11]} {port_pad_data_in[10]}
{port_pad_data_in[9]} {port_pad_data_in[8]} {port_pad_data_in[7]}
{port_pad_data_in[6]} {port_pad_data_in[5]} {port_pad_data_in[4]}
{port_pad_data_in[3]} {port_pad_data_in[2]} {port_pad_data_in[1]}
{port_pad_data_in[0]} scan_en scan_clk scan_in_1 scan_in_2 scan_out_1

22
scan_out_2 test_mode spi_data spi_fs refclk vcop vcom pllrst ibias

The list of names can be quite long, especially for child objects like “insts” and “nets,”
which might be in millions. So, interactive queries like “dbGet top.nets.name” are not
recommended without filtering the results (covered later).
Using “head” or user-specified starting points would be similar (dbGet $myObject.?,
where $myObject is a pointer to a database object that you want to find the attributes
for).

23
Lab 2-2 Using pattern matching to filter dbGet attribute searches

Objective: To introduce dbGet feature to filter results

In this section, you will learn how the pattern matching can also be used to reduce the number of
attributes and values displayed by the .? and .?? operators.

Using name-based filtering with .? and .?? to limit attributes displayed

For this section, you are going to use the same database as in the earlier lab sections.

For interactive queries, .? and .?? will sometimes have long lists of attributes and filtering can be
used to reduce the information displayed if you already know the exact attribute name or part of the
attribute name.

1. Display all attributes from the topCell object.

innovus> dbGet top.?


topCell: bumps fPlan hInst insts markers name nets numBidirs numInputs
numInsts numNets numPGTerms numPhysInsts numPhysNets numPhysTerms
numTerms objType pgTerms physInsts physNets physTerms pinToCornerDist
props statusClockSynthesized statusGRouted statusIoPlaced statusPlaced
statusPowerAnalyzed statusRCExtracted statusRouted statusScanOpted
symmetryR90 symmetryX symmetryY terms texts

2. Display only the attributes matching the *net* pattern.

innovus> dbGet top.? *net*


topCell: nets numNets numPhysNets pgNets physNets

The displayed attributes are now limited to those that matched the *net* pattern.

Pattern matching is case-insensitive for attribute names.

24
Lab 2-3 Using <TAB> completion to find attribute names

Objective: To introduce dbGet feature to filter results

In this section, you will learn how to use <TAB> completion for finding the available attributes to
more quickly identify available attributes. Functionality is the same as with .? but does not require
you to go back to a previous line and copy/paste the attribute names. The .? usage is more flexible
as complete patterns can be specified, while <TAB> completion is only for finding attributes
starting with a fixed prefix (or no pattern).

Using <TAB> completion to match attribute names more quickly

For this section, you will use the same database as in the earlier lab sections.

For interactive queries, <TAB> and .? return the list of available attributes from the current object.

1. Display all attributes from the topCell object.

innovus> dbGet top.<TAB>


bumps designLib designView
fPlan hInst insts
isProtoModelCommitted isProtoModelSpecified isVDDOnBottom
markers name nets
numBidirs numInputs numInsts
numNets numPGTerms numPhysInsts
numPhysNets numPhysTerms numTerms
objType pds pgNets
pgTerms physInsts physNets
physTerms pinToCornerDist pkgComponents
pkgObjects props ptns
readOnly statusClockSynthesized statusDetailRouted
statusGRouted statusIoPlaced statusPlaced
statusPowerAnalyzed statusRCExtracted statusRouted
statusScanOpted symmetryR90 symmetryX
symmetryY terms texts
innovus> dbGet top.
Notice that by using <TAB>, the active line is maintained so the line is ready to
have more characters typed or copy-pasted without needing to use the up arrow to
move back to the previous line as in the .? usage.

2. Display attributes starting with t.

innovus> dbGet top.t<TAB>


terms texts
innovus> dbGet top.te

25
Notice that in this case, the .t<TAB> was matched to the next common partial match,
so the active line is updated to top.te.

3. Display only the attributes start with ter.

innovus> dbGet top.ter<TAB>


innovus> dbGet top.terms.

Notice that when a single object attribute is matched using <TAB>, the attribute name
is completely expanded and a "." is appended. The usage assumes that an additional
traversal is desired for obj/objList type attributes.

4. Display only the attributes starting with na from the top.terms starting point.

innovus> dbGet top.terms.na<TAB>


innovus> dbGet top.terms.name

Notice that when a single non-object attribute is matched using <TAB>, the attribute
name is completely expanded, and a space is appended. Unlike the case when the
attribute is an obj or objList, simple attributes are always the last step of a traversal
and therefore do not have the "." appended.
Adding a <CR> at the end will now return all term (top-level terminal) names in the
design.

Pattern matching is case-insensitive for the attribute name when using


<TAB> completion just like in .?.

26
Lab 2-4 Using pattern matching to filter dbGet return results

Objective: To introduce dbGet feature to filter results

In this section, you will learn how to filter results from the dbGet queries.

Introduction to filtering values returned by dbGet

For this section, you will use the same database as in the earlier lab sections.

1. Example of using dbGet without filtering the result:

innovus> dbGet top.terms.name


{tdigit[7]} {tdigit[6]} {tdigit[5]} {tdigit[4]} {tdigit[3]} {tdigit[2]}
{tdigit[1]} {tdigit[0]} tdigit_flag reset int {port_pad_data_out[15]}
{port_pad_data_out[14]} {port_pad_data_out[13]} {port_pad_data_out[12]}
{port_pad_data_out[11]} {port_pad_data_out[10]} {port_pad_data_out[9]}
{port_pad_data_out[8]} {port_pad_data_out[7]} {port_pad_data_out[6]}
{port_pad_data_out[5]} {port_pad_data_out[4]} {port_pad_data_out[3]}
{port_pad_data_out[2]} {port_pad_data_out[1]} {port_pad_data_out[0]}
{port_pad_data_in[15]} {port_pad_data_in[14]} {port_pad_data_in[13]}
{port_pad_data_in[12]} {port_pad_data_in[11]} {port_pad_data_in[10]}
{port_pad_data_in[9]} {port_pad_data_in[8]} {port_pad_data_in[7]}
{port_pad_data_in[6]} {port_pad_data_in[5]} {port_pad_data_in[4]}
{port_pad_data_in[3]} {port_pad_data_in[2]} {port_pad_data_in[1]}
{port_pad_data_in[0]} scan_en scan_clk scan_in_1 scan_in_2 scan_out_1
scan_out_2 test_mode spi_data spi_fs refclk vcop vcom pllrst ibias

The return information shows all terminal names in the top cell.

2. Example of using dbGet with filtering to limit the information returned only what
matches a specified pattern:

innovus> dbGet top.terms.name sc*


scan_en scan_clk scan_in_1 scan_in_2 scan_out_1 scan_out_2

Now, the return information contains only the terminal names that matched the sc*
pattern.

Pattern matching is case-sensitive for string and enum type attributes.

27
Using name-based filtering and returning object pointers using -p option of dbGet

For interactive queries, filtering names is very useful to help find objects by name, but for
programming, the goal is often to get the pointer of the object instead of its name and then, use that
pointer at another level of database access.

3. Example of using dbGet with filtering to limit the information returned only what
matches a specified pattern, but returning the parent object instead of the attribute
value:

innovus> dbGet -p top.terms.name sc*


0x2aaac8976f68 0x2aaac8976fc0 0x2aaac8977018 0x2aaac8977070
0x2aaac89770c8 0x2aaac8977120
The -p option returns the previous pointer after filtering based on the attribute value object.
The effect is to back up one “.” and return the object pointer each time the attribute value
matches the specified pattern. The object pointer list return value can be used to pass to
another dbGet command as a starting point.

4. Example of using dbGet with filtering to instances that have a cell master called
pllclk:

innovus> dbGet top.insts.cell.name pllclk


pllclk
This indicates that the pllclk cell is instantiated only once in the design.

5. Example of using dbGet with filtering to instances that have a cell master called
pllclk and returning the cell pointers (-p):

innovus> dbGet -p top.insts.cell.name pllclk


0x2aaac76a5c50
Note that for each instance, the “cell master” pointer is being returned. If
the design had two instances of the cell pllclk, you will get twice the
same pointer. To return the instance pointers instead of the cell
pointers, you need to use -p2 to back up two steps.

6. Example of using dbGet with filtering to instances that have a cell master called
pllclk and returning the instance pointers (-p2):

innovus> dbGet -p2 top.insts.cell.name pllclk


0x2aaac8e50620

7. Example of using dbGet with filtering to instances that have a cell master called
pllclk and returning the instance pointers (-p2), but using the result to obtain
the instance names:

innovus> set instPtrs [dbGet -p2 top.insts.cell.name pllclk]

28
0x2aaac8e50620

innovus> dbGet $instPtrs.name


DTMF_INST/PLLCLK_INST
Now, you have a list of instance names.

8. Repeat example using nested return values in another dbGet call.

innovus> dbGet [dbGet -p2 top.insts.cell.name pllclk].name


DTMF_INST/PLLCLK_INST

You were able to achieve the same result without creating an intermediate variable to
hold the list of pointers. The nesting or chaining of calls is done using the return values
of the inner dbGet calls as the starting point for the next dbGet call. The example shows
two dbGet calls, but there is no theoretical limit to the depth that can be done. While
using deeper calls is legal, it may be easier to debug a script/proc that uses the
temporary Tcl variable method. So, in some cases, the script writer will need to choose
between readability and compactness.
In this case, the same query can be done using the “dbFindInstsByCell” Tcl command
or via the “View > Find/Select Object” functionality:

29
These other mechanisms have a limited set of attributes they expose. They are
only for the most common database objects. The dbGet method supports a
broader set of object types and attributes by using a generalized method of
pattern matching and object pointer retrieval instead of having different
commands for each task.

Examples of different styles of dbGet -p usage with and without using Tcl foreach

The following examples show how the same queries can be completed with varying levels of
readability and compactness.

For a challenge, before reviewing the examples, try and write a script to search the database for
instances that have “fixed” placement status whose cell masters are “pllclk”.

9. Example 1: Search the database for instances that have “fixed” placement
status whose cell master is “pllclk”.

innovus> foreach inst [dbGet top.insts] {


if {[dbGet $inst.cell.name] == "pllclk"} {
if {[dbGet $inst.pStatus] == "fixed"} {
puts "[dbGet $inst.name]"
}}} innovus>
The above is using foreach to walk through all instances in the design and then
using a series of “if” statements to filter the results.

10. Example 2: Search the database for instances that have “fixed” placement
status whose cell master is “pllclk”.

innovus> foreach mem_inst [dbGet -p2 top.insts.cell.name pllclk] {


if {[dbGet $mem_inst.pStatus] ==
"fixed"} { puts "[dbGet $mem_inst.name]"
}}
innovus>
The above is using the dbGet to prefilter the list of instances passed to foreach.

11. Example 3: Search the database for instances that have “fixed” placement
status whose cell master is “pllclk”.

innovus> set mem_inst_list [dbGet -p2 top.insts.cell.name pllclk]


innovus> puts "[dbGet [dbGet -p $mem_inst_list.pStatus fixed].name]"
The above is not using the Tcl foreach at all, but instead using only the ability to
pass a list of pointers to another dbGet command via a Tcl variable.

12. Example 4: Search the database for instances that have “fixed” placement
status whose cell master is “pllclk”.

30
innovus> puts "[dbGet [dbGet -p [dbGet -p2 top.insts.cell.name
pllclk].pStatus fixed].name]"
The above is a very compact method using a single-nested set of dbGet calls, but do
you think it is still readable?

The examples demonstrate some different “styles” of coding. The first method
returns a complete list of instances, so it is the least efficient even though it is the
most readable one.

Handling name-based filtering where nothing is found

For programmatic queries, sometimes, looking at the length of the list returned can be useful.
The dbGet return value when nothing is found is 0x0, which allows the return value to be
padded to another dbGet call but makes the length of the list returned 1 instead of 0.

13. Example of using what is returned when the filtering fails to find a match (in this
case, due to a typo in the cell name pllcll should have been pllclk):

innovus> dbGet -p2 top.insts.cell.name pllcll


0x0
innovus> dbGet [dbGet -p2 top.insts.cell.name pllcll].name
0x0

The inner dbGet returns 0x0, and the outer returns 0x0 as well instead of an
ERROR. The goal was to make the scripts tolerant of the empty return case.

14. Use llength to observe the length of the returned list.

innovus> llength [dbGet [dbGet -p2 top.insts.cell.name


pllcll].name]
1
Returning 0x0 causes the length of the list to be 1 even where nothing is being
returned.

15. Use llength to observe the length of the returned list but use dbGet with the -e
option to return "" instead of 0x0 in the outer dbGet call.

innovus> llength [dbGet -e [dbGet -p2 top.insts.cell.name


pllcll].name]
0
Returning "" (empty string/list) makes it a little easier to use the return value in a
program instead of needing to test for the 0x0 case, especially where a count is
desired. Without the -e option, the count would appear as 1 when you will expect
0.

31
Lab 2-5 Using expressions to filter dbGet return results

Objective: To introduce dbGet feature to filter results using Tcl expressions

In this section, you will learn how to use Tcl expressions to filter the objects returned by dbGet.

Using expression-based filtering of objects

For this section, you are going to use the same database as in the earlier lab sections.

The dbGet functionality supports two types of filtering: pattern-based (exact match, simple
wildcards), which is useful for string and enum attributes; Tcl expression style (allows use for
all attribute types), which is more powerful but more complicated to use.

As the pattern matching style does not work well for numeric attributes or when dealing with
lists, the expression style is the method to use for filtering based on numeric attributes.

In the expression style, standard Tcl expressions are used (==, <, >, etc.) to test for “true”
evaluations and the objects that result in a “true” expression evaluation are kept. While the
expression is evaluated, the .attribute is substituted with its value.

Example: An object with an attribute called .numInputs is replaced by the value of the
.numInputs attribute. Assume a .numInputs value of 5. The expression {.numInputs > 10}
would become {5 > 10} and evaluate to “false”, and the object would not be retained during
filtering.

Compound expressions can be created with Logical AND (&&) and OR (||) operators.

Only attributes at the current object level may be used, additional levels of traversal are not
allowed (from an inst object, using {.cell.name ….} is not allowed. Also, dbGet cannot use
recursive calls, so a dbGet cannot be used inside {} of the expression (using “” to enclose the
expression is OK as the dbGet call inside of the “” is evaluated before the attribute substitution
is done).

1. Use Tcl expressions to find all library cells that have more than 10 inputs.

innovus> set lib_cell_list [dbGet -p head.allCells.objType


libCell] innovus> dbGet [dbGet $lib_cell_list {.numInputs >
10}].name
ram_128x16A ram_256x16A rom_512x16A

32
2. Use homogeneous list method (head.libCells) to obtain the list of library cells
instead of using "dbGet -p head.allCells.objType libCell".

innovus> set lib_cell_list [dbGet head.libCells]


innovus> dbGet [dbGet $lib_cell_list {.numInputs > 10}].name
ram_128x16A ram_256x16A rom_512x16A

3. Use Tcl expressions to find all library cells that have more than 10 inputs and
whose name matches the ra* pattern (two step).

innovus> dbGet [dbGet [dbGet -p head.libCells.name ra*] {.numInputs


> 10}].name
ram_128x16A ram_256x16A
Using the regular pattern matching is one way to filter the list of instance
pointers before using the expression style.

4. Use Tcl expressions to find all library cells that have more than 10 inputs and
whose name matches the ra* pattern (complex expression method).

innovus> dbGet [dbGet [dbGet head.libCells] {.numInputs > 10 &&


[string match ra* .name]}].name
ram_128x16A ram_256x16A

Unlike the pattern matching method, the expression filtering method does not
require -p to access the list of filtered objects. This is because the last element in the
traversal list is already an object, unlike the pattern matching method where the last
element in the traversal is an attribute.

33
Lab 2-6 Accessing geometric information using dbGet

Objective: To introduce dbGet feature to access geometric information

In this section, you will learn how to access geometric information (halos, pin location, etc.)
using dbGet.

Working with geometric attributes like points (pt), rectangles (rect)

For this section, you are going to use the same database as in the earlier lab sections.

The following is a list of types of geometric attributes available:

coord (coordinate) = Single value; either int (dbGet -d), or float (user
units). pt (point) = {coord coord}
ptList (list of points) = {pt pt ...} or {{coord coord} {coord coord}
…} rect (rectangle) = {coord coord coord coord}

Select the block in the lower-left corner of the core.

1. Access values for all attributes of the selected instance.

innovus> dbGet selected.??


area: 84000.0
box: {355.28 355.44 655.28 635.44}
box_llx: 355.28
box_lly: 355.44
box_urx: 655.28
box_ury: 635.44
box_sizex: 300.0
box_sizey: 280.0
box_ll: {355.28 355.44}
box_ur: {655.28 635.44}
box_size: {300.0 280.0}
box_area: 84000.0
boxes: {{355.28 355.44 655.28 635.44}}
cell: 0x2aaac76a5c50
defname: DTMF_INST/PLLCLK_INST
dontMergeMultibit: 0
dontSplitMultibit: 0
dontTouch: none
dontTouchEffective: true
dontTouchSources: {user none} {lib true} {parent false} {scan
false}
group: 0x0
hInst: 0x2aaac8d60110
34
instTerms: 0x2aaac9198620 0x2aaac9198658 0x2aaac9198690
0x2aaac91986c8 0x2aaac9198700 0x2aaac9198738 0x2aaac9198770
isAlwaysOn: 0
isAlwaysOnBuffer: 0
isHaloBlock: 1
isIsolation: 0
isJtagElem: 0
isLevelShifter: 0
isPhysOnly: 0
isSpareGate: 0
lithoHalo: 0
maskShift: 0
name: DTMF_INST/PLLCLK_INST
objType: inst
orient: R0
pHaloBot: 20.0
pHaloBox: {335.28 335.44 675.28 655.44}
pHaloBox_llx: 335.28
pHaloBox_lly: 335.44
pHaloBox_urx: 675.28
pHaloBox_ury: 655.44
pHaloBox_sizex: 340.0
pHaloBox_sizey: 320.0
pHaloBox_ll: {335.28 335.44}
pHaloBox_ur: {675.28 655.44}
pHaloBox_size: {340.0 320.0}
pHaloBox_area: 108800.0
pHaloLeft: 20.0
pHaloRight: 20.0
pHaloTop: 20.0
pStatus: fixed
pStatusCTS: unset
pStatusEffective: fixed
pd: 0x0
pgInstTerms: 0x2aaad4aa6100 0x2aaad4aa6108
props: 0x2aaad4ddce20 0x2aaad4ddcde8 0x2aaac97e9be8
pt: {355.28 355.44}
pt_x: 355.28
pt_y: 355.44
rHaloBotLayer: 0x0
rHaloSideSize: 0.0
rHaloTopLayer: 0x0
sdp: 0x0
useCells:
In the attributes for the selected instance, there are many geometric pieces of
information, the “box” (bounding box of the instance), “boxes” (list of boxes for

35
instances that are rectilinear, pHalo* (placement halo distances), and rHalo*
(routing halo information).
2. Access values for placement halo (pHaloBox) of the selected instance:

innovus> dbGet selected.pHaloBox


{335.28 335.44 675.28 655.44}

The bounding box of the placement halo for the selected instance is {335.28 335.44
675.28 655.44}. Notice that it is slightly larger than .box information for the
instance which is {355.28 355.44 655.28 635.44}.

Information returned for rectangles (rect), pts (pt), etc. is in a list-of-lists form,
so although the return value appears visually to be {335.28 335.44 675.28 655.44},
it is actually “{335.28 335.44 675.28 655.44}”.So, be aware that you will need to
use "lindex" or "dbGet -i 0 ..." to access box information for programming purposes.
For commands that do not accept a list of coordinates form and instead require llx,
lly, urx, and ury as separate values, you will need to break rectangle information
down into individual coordinates using lindex as well.

3. Use db_rect to access individual point or coordinate values for placement


halo (pHaloBox) of the selected instance.

innovus> db_rect -help


Usage: db_rect [-help] <rect> { -ll | -ur | -llx | -lly | -urx | -
ury | -size | -sizex | -sizey | -width | -length | -center |
-area }

-help # Prints out the command usage


<rect> # Specified rectangle to access values from (box, required)
-area # Returns the area of the rectangle
# Example : db_rect -area {8.1 9.2 10.3 11.4}
# returns 4.84 (bool, optional)
-center # Returns the center of the rectangle
# Example : db_rect -center {8.1 9.2 10.3 11.4}
# returns 9.2 10.3 (bool, optional)
-length # Returns the larger of the -sizex and -sizey values
# Example : db_rect -length {8.1 9.2 10.3 11.4}
# returns 2.2 (bool, optional)
-ll # Returns the lower left point of the rectangle
# Example : db_rect -ll {8.1 9.2 10.3 11.4}
# returns 8.1 9.2 (bool, optional)
-llx # Returns the lower left x coordinate of the rectangle
# Example : db_rect -llx {8.1 9.2 10.3 11.4}
# returns 8.1 (bool, optional)
-lly # Returns the lower left y coordinate of the rectangle
# Example : db_rect -lly {8.1 9.2 10.3 11.4}
# returns 9.2 (bool, optional)
-size # Returns the size of the rectangle from lower left to upper
# right
# Example : db_rect -size {8.1 9.2 10.3 11.4}
# returns 2.2 2.2 (bool, optional)
-sizex # Returns the x difference between the larger and smaller x
# values of the rectangle
# Example : db_rect -sizex {8.1 9.2 10.3 11.4}
36
# returns 2.2 (bool, optional)
-sizey # Returns the y difference between the larger and smaller y
# values of the rectangle
# Example : db_rect -sizey {8.1 9.2 10.3 11.4}
# returns 2.2 (bool, optional)
-ur # Returns the upper right point of the rectangle
# Example : db_rect -ur {8.1 9.2 10.3 11.4}
# returns 10.3 11.4 (bool, optional)
-urx # Returns the upper right x coordinate of the rectangle
# Example : db_rect -urx {8.1 9.2 10.3 11.4}
# returns 10.3 (bool, optional)
-ury # Returns the upper right y coordinate of the rectangle
# Example : db_rect -ury {8.1 9.2 10.3 11.4}
# returns 11.4 (bool, optional)
-width # Returns the smaller of the -sizex and -sizey values
# Example : db_rect -width {8.1 9.2 10.3 11.4}
# returns 2.2 (bool, optional)
innovus> db_rect -ll [dbGet selected.pHaloBox]
335.28 335.44
innovus> db_rect -size [dbGet selected.pHaloBox]
340.0 320.0

37
Module 3: Using dbGet.?h and
dbSchema to learn
more about database
objects and their
attributes

38
Lab 3-1 Finding out more descriptive information about an attribute

Objective: To introduce .?h and dbSchema command of dbGet to get


more information about attributes

In this section, you will learn how to use the .?h operator and the dbSchema command dbGet to
find out more detailed information about attributes of an object.

What to do when you know an attribute name, but do not know exactly what it is
used for

For this section, you are going to use the same database as in the earlier lab sections.

The names of attributes are fairly short and while in many cases, the name is pretty clear on what it
is used for, there are cases where the name alone is not enough. Along with .? and .?? operators of
dbGet for interactive query about what attributes are available, there is also a .?h operator that
provides “help” on the attribute with information like attribute type (string, int, enum, etc.), legal
enum values for enum type attributes, whether the attribute is allowed to be modified or not, and a
short description about the purpose of the attribute. The dbSchema command provides the same
information without having to use database traversal methods in dbGet.

Select the block in the lower-left corner of the core.

1. Access values for all attributes of the selected instance.

innovus> dbGet selected.?


inst: area box box_area box_ll box_llx box_lly box_size box_sizex
box_sizey box_ur box_urx box_ury boxes cell defName
dontMergeMultibit dontSplitMultibit dontTouch dontTouchEffective
dontTouchSources group hInst instTerms isAlwaysOn isAlwaysOnBuffer
isHaloBlock isIsolation isJtagElem isLevelShifter isPhysOnly
isSpareGate lithoHalo maskShift name objType orient pHaloBot
pHaloBox pHaloBox_area pHaloBox_ll pHaloBox_llx pHaloBox_lly
pHaloBox_size pHaloBox_sizex pHaloBox_sizey pHaloBox_ur
pHaloBox_urx pHaloBox_ury pHaloLeft pHaloRight pHaloTop pStatus
pStatusCTS pStatusEffective pd pgInstTerms props pt pt_x pt_y
rHaloBotLayer rHaloSideSize rHaloTopLayer sdp useCells
From the information displayed, you know that the selected object is an “inst” and
has many attributes. But, the information is just a simple list of names without
descriptions.

2. Which attribute is used for the instance’s placement status? The pStatus looks like
the correct one, but find out more so you can be sure,

innovus> dbGet selected.?h pStatus


pStatus(settable): enum(cover fixed placed softFixed unplaced), This
attribute is the placement status of an instance during placement
and optimization. The placer will look at both place_status and
place_status_cts and use the more restrictive value.
Now, you know that the pStatus attribute is indeed the “Instance placement status”,
that it can be modified (setup) and that it is an enum type of attribute with legal

39
values “cover fixed placed unplaced”. If you were scripting and needed to make
decisions based on the placement status, you now know what enum values to look
for.
Had you not supplied the pStatus as a filter, all attributes and their descriptions would
have been returned as follows:
=======================================================================
inst: Instance - canonical (flat), equivalent to DEF COMPONENT. Points
to a libCell or ptnCell.
-----------------------------------------------------------------------

box: rect, Bounding box of the instance


boxes: list(rect), List of rectangles that define the shape of instance
cell: obj(libCell ptnCell), Pointer to child cell master or ptnCell
instTerms: objList(instTerm), List of pointers to instance terminals

orient(settable): enum(MX MX90 MY MY90 R0 R180 R270 R90), Instance
placement orientation

pStatus(settable): enum(cover fixed placed unplaced), Instance
placement status
pgCellTerms: objList(term), List of pointers to the instance's power
terminals
pgTermNets: objList(net), List of pointers to nets attached to P/G
terminals

3. Using database traversal and .?h work together as well. I want to find out more info
about what nets are connected to the instance.

innovus> dbGet selected.instTerms.net.?


net: allTerms area avoidDetour bottomPreferredLayer box hNets isAnalog
isCTSClock isClock isDontTouch isExternal isFixedBump isGnd
isPatternTrunk isPhysOnly isPwr isPwrOrGnd isScanNet name numInputTerms
numOutputTerms numTerms objType preferredExtraSpace props rule sVias
sWires shieldNets siPostRouteRepair skipAntennaRepair skipRouting
topPreferredLayer vias weight wires
There are two different clock related clock attributes on the net object, which is the
one that corresponds to DEF + USE CLOCK.

4. Use the .?h and filter to find out more about the clock-related attributes of the net
object.

innovus> dbGet selected.instTerms.net.?h *clock*


isCTSClock(settable): bool, Indicates that net is a cts clock net
(equivalent to 'USE CLOCK' property in DEF)
isClock: bool, Indicates that net is a clock according to timing
constraints and tracing
The isCTSClock attribute is the one that aligns to DEF + USE CLOCK and that
the value of the attribute can be modified (using dbSet). Remember that the pattern
matching for attribute names is case-insensitive.

40
How do I use dbSchema instead of .?h operator of dbGet to find out attribute details?

As you get more familiar with object and attribute names, you might want to access the descriptive
information without needing to select an object or traverse from one object down to the one you are
interested in. The dbSchema command provides more direct access to the descriptions than .?h of
dbGet, but information is displayed in the same format.

5. What are the different types of objects available in the Innovus database?

innovus> dbSchema -help

Usage: dbSchema [-help] [[<objNamePattern> [<objAttrNamePattern>]] |


[-parent <objNamePatternForParent> [-list ]]]

-help # Prints out the command usage


<objNamePattern> # Object Name or Pattern(string, optional)
<objAttrNamePattern> # Object Attribute Name or Pattern
# (string, optional)
-list # To print as a list of parent objects
# (bool, optional)
-parent <objNamePatternForParent> # Type of Object/Attribute for
# which parent needs to be found
# (string, optional)

innovus> dbSchema
antennaData antennaModel bndry bump bus busGuide cellDensity densityShape
fPlan foreign gCellGridDef group hInst hInstTerm hNet hTerm head inst
instTerm io layer layerRule layerShape libCell marker net netGroup pBlkg
pd pin pinGroup pinGuide prop ptn ptnCell rBlkg resizeBlkg row rule
sViaInst sWire sdp shape shapeVia site term text topCell trackDef vCell
via viaInst wire
You can use dbSchema to find out more about any object as to whether it is currently
used in the database or not. You can also use dbSchema if no database is loaded in
memory.

6. How would I use dbSchema to find out more about clock attributes of the net
object, which I had used dbGet with .?h earlier.

innovus> dbSchema net *clock*


=======================================================================
net: Canonical (flat) net (equivalent to connectivity in DEF NETS and
SPECIALNETS)
-----------------------------------------------------------------------
isCTSClock(settable): bool, Indicates that net is a cts clock net
(equivalent to 'USE CLOCK' property in DEF)
isClock: bool, Indicates that net is a clock according to timing
constraints and tracing

7. How to use dbSchema to find objects that have attributes with via in their name?

41
innovus> dbSchema * *via*
===============================
head: Root/Head of the database
-------------------------------
vias: objList(via), List of pointers to via master
=======================================================================
net: Canonical (flat) net (equivalent to connectivity in DEF NETS and
SPECIALNETS)
-----------------------------------------------------------------------
sVias: objList(sViaInst), List of pointers to sViasInsts (DEF
SPECIALNETS equivalent)
vias: objList(viaInst), List of pointers to viaInsts (DEF NETS
equivalent)
=============================================================
rule: Rule information (equivalent to LEF/DEF NONDEFAULTRULE)
-------------------------------------------------------------
vias: objList(via), List of pointers to via, default or USEVIA or
derived from mincut
===================================================================
sViaInst: Special Via (equivalent to DEF SPECIALNETS via instances)
-------------------------------------------------------------------
via: obj(via), Pointer to via master
=========================
shapeVia: layer Shape via
-------------------------
via: obj(via), Pointer to via master
=======================================================
viaInst: viaInst (equivalent to via in DEF NETS wiring)
-------------------------------------------------------
via: obj(via), Pointer to via cell

From the list above, the following objects have attributes that match the *via* pattern:
head, net, rule, sViaInst, via, viaInst.

The dbSchema pattern matching is name-based, not object-type-based. If an


attribute is called list1 and its type of obj is via, it will not be found since the
pattern matching is only using the name of the attribute and not its type. Use the -
parent option for type-based matching of the child object.

42
How do I use dbSchema to find out what the possible parent objects are from an
object type?

In many cases, the object attributes are very similar to the child object type. Example: inst.nets refers
to a list of net pointers from an instance object, but in some cases like group.members, the attribute
is an objList that can contain a heterogeneous list of objects and the dbSchema * *<pattern>* does
not work as well. Using the dbSchema -parent feature is especially useful for finding the objects
that have the inst object as one of their child attributes.
8. How can I use dbSchema -parent to find out which objects have the inst object as
one of their child attributes?

innovus> dbSchema -parent inst


========================================
group: Group of hInsts, insts, or groups
----------------------------------------
members: objList(group hInst inst), List of pointers to group's members
===================================================
hInst: Hierarchical instance (derived from netlist)
---------------------------------------------------
allInsts: objList(hInst inst), List of pointers to all instances and
hierarchical instances in the level referred to by the hInst
allTreeInsts: objList(hInst inst), List of pointers to all instances
and hierarchical instances in the hInst
insts: objList(inst), List of pointers to all instances in the level
referred to by the hInst
treeInsts: objList(inst), List of pointers to all instances in the
hInst
============================================================
instTerm: Instance terminal (used in flattened connectivity)
------------------------------------------------------------
inst: obj(inst), Pointer to Instance containing the instTerm
================================================================
io: IO object for block (term) or chip design (inst) constraints
----------------------------------------------------------------
inst: obj(inst), Pointer to IO instance (null/0x0 for block design
case)
===============================================
pBlkg: Placement blockage (hard, soft, partial)
-----------------------------------------------
inst: obj(inst), Pointer to the instance that the placement blockage is
associated with (equivalent to DEF BLOCKAGES + COMPONENT)
=====================
ptn: Partition Object
---------------------
cloneInsts: objList(inst), List of pointers to the clone instances if
the partition is committed or a blackbox, otherwise 0x0 will be
returned.
clones: objList(hInst inst), List of pointers to the clone inst/hInsts.
The objTypes returned will be inst if the partition is committed or a
blackbox, otherwise the objType will be hInst.

43
master: obj(hInst inst), Pointer to the master inst/hInst. The objType
returned will be inst if the partition is committed or a blackbox,
otherwise the objType will be hInst.
masterInst: obj(inst), Pointer to the master instance if the partition
is committed or a blackbox, otherwise 0x0 will be returned.
=======================
rBlkg: Routing blockage
-----------------------
inst: obj(inst), Pointer to the instance that the routing blockage is
associated with (equivalent to DEF BLOCKAGES + COMPONENT)
==============
sdp: Data Path
--------------
inst: objList(inst), Pointer to instance (only for type = inst)
=======================================================
topCell: Top cell, container for flattened connectivity
-------------------------------------------------------
insts: objList(inst), List of pointers to instances in the cell
physInsts: objList(inst), List of pointers to physical instances in the
cell

9. How can I use dbSchema to find out which objects have the inst object as one of their
child attributes without the details?

innovus> dbSchema -parent inst -list


group hInst instTerm io pBlkg pgInstTerm ptn rBlkg sdp topCell

44
Module 4: Modifying object
attributes using dbSet

45
Lab 4-1 Using dbSet to change attribute values

Objective: To introduce the dbSet command and how to use it to change attribute
values

In this section, you will learn how to use dbSet to change an attribute value of an object or set of
objects.

How can I change an attribute value on a selected object or set of selected objects?

For this section, you are going to use the same database as in the earlier lab sections.

Using .?h and dbSchema of dbGet, you can determine which attributes are allowed to be modified.
So, dbSet can be used to change the attribute values just like it can be done using the Attribute
Editor GUI.

Select the block in the lower-left corner of the core and zoom in around that instance.

1. Access values for the pHalo* attributes of the selected instance.

innovus> dbGet selected.?? pHalo*

pHaloBot: 20.0

pHaloBox: {335.28 335.44 675.28 655.44}

pHaloBox_llx: 335.28

pHaloBox_lly: 335.44

pHaloBox_urx: 675.28

pHaloBox_ury: 655.44

pHaloBox_sizex: 340.0

pHaloBox_sizey: 320.0

pHaloBox_ll: {335.28 335.44}

pHaloBox_ur: {675.28 655.44}

pHaloBox_size: {340.0 320.0}

pHaloBox_area: 108800.0

pHaloLeft: 20.0

pHaloRight: 20.0

pHaloTop: 20.0

From the information displayed, you can see that the halo bounding box is {335.28 335.44} and
that the halo offsets are 20u per side.

46
2. Confirm which attributes are allowed to be modified.

innovus> dbGet selected.?h pHalo*

pHaloBot(settable): coord, Specifies extra spacing around the inst that


should not be used for placement
pHaloBox: rect, Bounding box of the inst placement halo
pHaloBox_area: area, Area of bounding box of the inst placement halo
pHaloBox_ll: pt, Lower left (ll) of bounding box of the inst placement
halo
pHaloBox_llx: coord, Lower left X (llx) of bounding box of the inst
placement halo
pHaloBox_lly: coord, Lower left Y (lly) of bounding box of the inst
placement halo
pHaloBox_size: pt, Size of bounding box of the inst placement halo
pHaloBox_sizex: coord, Size X of bounding box of the inst placement halo
pHaloBox_sizey: coord, Size Y of bounding box of the inst placement halo
pHaloBox_ur: pt, Upper right (ur) of bounding box of the inst placement
halo
pHaloBox_urx: coord, Upper Right X (urx) of bounding box of the inst
placement halo
pHaloBox_ury: coord, Upper Right Y (ury) of bounding box of the inst
placement halo
pHaloLeft(settable): coord, Specifies extra spacing around the inst that
should not be used for placement
pHaloRight(settable): coord, Specifies extra spacing around the inst that
should not be used for placement
pHaloTop(settable): coord, Specifies extra spacing around the inst that
should not be used for placement

You can see that all attributes can be modified, except that the pHaloBox is read-only (it is
created from the instance size and other pHalo* attribute values). The type of all attributes
is “coord” (the coord attribute is accessed/set as a floating- point value in user-units, unless
the -d option is specified, in which case, it would be accessed/set as an integer value in
database units).

3. Use dbSet to change the value of the halo on the right side of the instance
(pHaloRight attribute) from 25 to 30.

innovus> dbSet selected.pHaloRight 30


Use redraw to see the changes visually.

4. Access values for the pHalo* attributes of the selected


instance again to see the changes.
innovus> dbGet selected.?? pHaloRight
pHaloRight: 30
Note the value of pHaloRight has been changed to 30.

47
How can I change an attribute value on multiple objects at the same time?

The dbSet commands takes an object or list of objects as a starting point, so you can use the objects
returned from a dbGet query as the list of objects to start from.

5. Use dbGet to find all instances that have pllclk as their cell master name.

innovus> dbGet [dbGet -p2 top.insts.cell.name pllclk].name


DTMF_INST/PLLCLK_INST

In the example, you have just one instance that has pllclk as its cell master. For dbSet, you
want to get the instance pointers instead of instance names.

6. Use dbGet to find all instance pointers that have pllclk as their cell master name.

innovus> dbGet -p2 top.insts.cell.name pllclk


0x2aaac8e50620
As a reminder, -p2 is indicated to access the pointer two steps back from the .name
attribute. Had you used -p instead of -p2, you would have a list of libCell pointers
instead of the desired instance pointers.

7. Use dbGet to query the placement status of those instances.

innovus> dbGet [dbGet -p2 top.insts.cell.name pllclk].pStatus


fixed
The instance currently has “fixed” placement status.

8. Use dbSet to change the placement status of all instances to “cover”.

innovus> dbSet [dbGet -p2 top.insts.cell.name pllclk].pStatus cover

The object list could have been passed to dbGet as a variable or as done in this case,
using the dbGet return list directly.

9. Use dbGet to confirm that the placement status of those instances has been changed.

innovus> dbGet [dbGet -p2 top.insts.cell.name pllclk].pStatus


cover
Now, the instances have the “cover” placement status.

48
Module 5: Using dbTransform to
convert coordinates
from local to global

49
Lab 5-1 Converting coordinates from local to global using
dbTransform

Objective: To introduce the dbTransform command and how to use it

In this section, you will learn how to use dbTransform to convert from coordinates inside of cells
(local) to those in the top-level design (global).

How can I convert coordinates from ones local to a cell to those in the design?

For this section, you are going to use the same database as in the earlier lab sections.

Objects like libCell (created from LEF MACROs or OpenAccess abstract views) have a coordinate
system that is local to the cell. For example, coordinate transformation is required to take a set of pin
shapes for a cell master and convert the coordinates of those shapes into values that are in the design
context instead of the cell context.

Select the block in the lower-left corner of the core and zoom in around that instance.

1. Use dbGet to find the coordinates of the reset pin shapes for the selected instance (using
.? and ?h, you can find the attribute names to use for the traversal).

innovus> dbGet [dbGet -p selected.cell.terms.name


reset].pins.allShapes.shapes.rect
{0.0 25.0 0.3 26.0}
Those coordinates are for a rectangle that make up the reset pin, but they are local to the
cell master of the instance and not relative to the design.

2. Use the coordinates and selected instance pointer to convert the list of rectangles
into a list of rectangles in the design context.

innovus> set local_pin_rects [dbGet [dbGet -p


selected.cell.terms.name reset].pins.allShapes.shapes.rect]
{0.0 25.0 0.3 26.0}
innovus> dbTransform -inst [dbGet selected] -localPt $local_pin_rects
{355.28 380.44 355.58 381.44}
Now, the rectangle is in design coordinates instead of the coordinate system of the
cell master. The location, orientation, and size of the instance are taken into
account during conversion. For instances with an R0 orientation, the coordinate
transformation is pretty simple.

50
For “What If” experiments, you can manually specify a cell, orientation, and
location using -cell, -orient, and -pt instead of -inst, which uses an existing placed
instance in the design.

3. If you do not need to real pin shapes, but just a derived pin location for the
instance terminals, you can access that directly without using dbTransform.

innovus> dbGet [dbGet -p selected.instTerms.name *reset].pt


{355.43 380.94}
The instTerm location is a derived single value for reference and may be all that you
need. If you need the real shapes of a LEF PIN or LEF OBS, dbTransform is the
solution.

51
Module 6: How to query objects
within an area using
dbQuery

52
Lab 6-1 Find objects in an area using dbQuery

Objective: To introduce the dbQuery command and how to use it to create a


list of objects in a specified area

In this section, you will learn how to use dbQuery to obtain a list of objects in a specified area.

How to find objects by area instead of by selection or by attribute-based queries

For this section, you are going to use the same database as in the earlier lab sections.

As shown in earlier labs, dbGet can take an object or list of objects as the starting point for traversal
from several methods: keyword-based starting points like “top”, “head”, and “selected”; single or
multiple objects returned from another dbGet call; and other methods. The dbQuery command
provides an area-lookup-based method to get a list of object pointers.

The dbQuery command works like graphical selection without needing to maintain and highlight
the selected set of objects.

innovus> dbquery -help

Usage: dbQuery [-help] -area {llx lly urx ury} [-d]


[-objType {bump busGuide inst instAllShapes instTerm term
marker net pBlkg pWire pgInstTerm rBlkg regular resizeBlkg row
special sViaInst sWire viaInst wire}]

-help # Prints out the command usage


-area {llx lly urx ury} # Specifies the search area {llx lly urx ury},
# where ll = lower left, ur = upper right.
# (box, required)
-d # User specified values and return values are in
# database units: default is um (bool, optional)
-objType {bump busGuide inst instAllShapes instTerm term marker net pBlkg
pWire pgInstTerm rBlkg regular resizeBlkg row special sViaInst sWire viaInst
wire}
# List of object types to return. Legal values are
# {bump busGuide inst instAllShapes instTerm term
# marker net pBlkg pWire pgInstTerm rBlkg regular
# resizeBlkg row special sViaInst sWire viaInst
# wire}, (special = union of sWire and sViaInst),
# (regular = union of wire and viaInst), (pBlkg =
# Placement Blockage), (rBlkg = Routing Blockage),
# (resizeBlkg = Size Blockage), default: inst
# (enum_list, optional)

1. Use dbQuery find the list of instances in the lower corner ({0 0 500 500}) of the
design (-objType is optional in this case as "inst" is the default objType).

innovus> dbQuery -area {0 0 500 500} -objType inst


0x2aaac8b92f60 0x2aaac8b93270 0x2aaac8b91910 0x2aaac8b91980
0x2aaac8b919f0 0x2aaac8b91a60 0x2aaac8b926a0 0x2aaac8b92710

53
0x2aaac8b92e10 0x2aaac8b93190 0x2aaac8ade620 0x2aaac8b917c0
That list of pointers can be used with dbGet.

2. Use dbQuery with dbGet find cell names of the instance in the lower corner ({0 0 500
500}) of the design.

innovus> dbGet [dbQuery -area {0 0 500 500} -objType inst].cell.name


PVSS1DGZ PVSS1DGZ PDIDGZ PDIDGZ PDIDGZ PDIDGZ PDO04CDG PDO04CDG
PCORNERDG PVDD1DGZ pllclk PDIDGZ

3. How can I filter out the MACROs that are CLASS PAD in LEF and find which
attribute will help me filter out the pads?

innovus> dbGet [dbQuery -area {0 0 500 500} -objType inst].cell.?h


*class*
baseClass: enum(block core corner cover none pad), Class type: derived
from LEF/OpenAccess (refer to documentation for complete mapping)
subClass(settable): enum(block blockBlackBox blockRing blockSoft core
coreAntenna coreEndCapBottomEdge coreEndCapLeftBottomCorner
coreEndCapLeftBottomEdge coreEndCapLeftBottomEvenSiteCorner
coreEndCapLeftBottomEvenSiteEdge coreEndCapLeftBottomOddSiteCorner
coreEndCapLeftBottomOddSiteEdge coreEndCapLeftEdge
coreEndCapLeftEvenSiteEdge coreEndCapLeftOddSiteEdge
coreEndCapLeftTopCorner coreEndCapLeftTopEdge
coreEndCapLeftTopEvenSiteCorner coreEndCapLeftTopEvenSiteEdge
coreEndCapLeftTopOddSiteCorner coreEndCapLeftTopOddSiteEdge
coreEndCapPost coreEndCapPre coreEndCapRightBottomCorner
coreEndCapRightBottomEdge coreEndCapRightBottomEvenSiteCorner
coreEndCapRightBottomEvenSiteEdge coreEndCapRightBottomOddSiteCorner
coreEndCapRightBottomOddSiteEdge coreEndCapRightEdge
coreEndCapRightEvenSiteEdge coreEndCapRightOddSiteEdge
coreEndCapRightTopCorner coreEndCapRightTopEdge
coreEndCapRightTopEvenSiteCorner coreEndCapRightTopEvenSiteEdge
coreEndCapRightTopOddSiteCorner coreEndCapRightTopOddSiteEdge
coreEndCapTopEdge coreFeedthru coreSpacer coreTieHigh coreTieLow
coreWellTap cornerBottomLeft cornerBottomRight cornerTopLeft
cornerTopRight cover coverBump coverFill none pad padAreaIO padInout
padInput padOutput padPower padSpacer), All the LEF CLASS and PROPERTY
LEF58_CLASS values (and equivalent OpenAccess values). Refer to the LEF
documentation for the complete list and descriptions. They are separated
into 5 classes with a unique prefix based on their usage as described
here:
CLASS COVER types all start with cover.
CLASS RING or BLOCK start with block.
CLASS PAD start with pad.
CLASS CORE start with core.
CLASS ENDCAP that are corner cells (TOPLEFT, TOPRIGHT, BOTTOMLEFT,
BOTTOMRIGHT) start with corner.
CLASS ENDCAP that are not corner cells all start with core because they
are all placed in the core rows like CLASS CORE cells.
No CLASS means the value is none.
Modifications are valid only for the current session.

54
It looks like the baseClass = pad is likely equivalent to CLASS PAD.

4. Try to access baseClass.

innovus> dbGet [dbQuery -area {0 0 500 500} -objType


inst].cell.baseClass pad
pad pad pad pad pad pad pad pad pad pad

In this case, you needed cells that are not CLASS PAD, so you need to use the dbGet -v
option to the negative pattern matching (similar to UNIX grep -v).

5. You found the right attribute to filter with, but you want to do a negative filter.

innovus> dbGet -v [dbQuery -area {0 0 500 500} -objType


inst].cell.baseClass pad
corner block

For this example, there is only one non-pad instance in the specified area. Now, all you
need is its instance name.

6. Now, get the instance name.

innovus> dbGet [dbGet -p2 -v [dbQuery -area {0 0 500 500} -objType


inst].cell.baseClass pad].name
IOPADS_INST/Pcornerll DTMF_INST/PLLCLK_INST

55
How to find objects at a specific point or that cross a specified line

7. Use dbQuery to find the list of DEF SPECIALNETS shapes that intersect a line from
{400 250} to {400 375} in the design.

innovus> dbQuery -area {400 250 400 375} -objType special


0x2aaad4873970 0x2aaad488c230 0x2aaad4873e20 0x2aaad488c6e0
The -area option can be used to specify an area {llx lly urx ury}, a line {x1 y1 x1 y2}
or {x1 y1 x2 y1}, or a pt {x y x y}. Any object enclosed or intersecting an object will
be returned. So, if a single-point location is specified with the -objType inst, it is
likely only one inst would be returned unless the pt is on the edge or corner where up
to four instances could be returned if they are not overlapping.

8. Use dbGet with dbQuery to find which layers those shapes are on.

innovus> dbGet [dbQuery -area {400 250 400 375} -objType


special].layer.extName
Metal5 Metal5 Metal5 Metal5
The .extName layer returns layer name information in the LEF/OA name space
instead of the Innovus internal name space.

9. Use dbGet with dbQuery to find which + SHAPE attribute is on those


shapes.

innovus> dbGet [dbQuery -area {400 250 400 375} -objType


special].shape
blockring blockring ring ring
There are two rings and two blockring shapes. You could use dbGet to isolate those
into separate lists if needed.

10. Use dbGet with dbQuery to find the coordinates of those shapes.

innovus> dbGet [dbQuery -area {400 250 400 375} -objType special].box
{346.28 346.44 664.28 354.44} {337.28 337.44 673.28 345.44} {285.64
285.72 1226.37 293.72} {276.64 276.72 1235.37 284.72}
Note that since you used dbQuery with a “line” as the method, there are no “enclosed”
objects; only “intersecting” objects.

56
Module 7: Using dbShape to
manipulate lists of
shapes

57
Lab 7-1 dbShape basics

Objective: To introduce the dbShape command and how to use it to do


logical operations on lists of shapes

In this section, you learn how to use dbShape for basic operations like finding intersections between
sets of shapes and then oversize the result.

Using dbShape to find intersections and do sizing operations

For this section, you are going to use the same database as in the earlier lab sections.

The dbShape command works on lists of shapes, not the database objects. So, you can use dbGet
and other commands to produce lists of shapes and other commands like createRouteBlk to create
database objects from the dbShape results.
innovus> dbShape -help
Usage: dbShape [-help] [-d] [-step <step>] [-output {polygon rect hrect
area}] <shapeList> [AND <shapeList> | ANDNOT <shapeList> | OR
<shapeList> | XOR <shapeList> | INSIDE shapeList | OUTSIDE shapeList |
ENCLOSE shapeList | STRADDLE shapeList | BBOX | HOLES | NOHOLES | MOVE
{<dx> <dy>} | SIZE <value> | SIZEX <value> | SIZEY <value>] ...

-help # Prints out the command usage


-d # User specified values and return values are in database
# units. Default: All values are in user units, in
# microns. (bool, optional)
-step <step> # Specifies step size if output format is rect, required
# to convert non-orthogonal shapes into series of
# rectangles. Default: minwidth value of first routing
# layer (coord, optional).
-output {polygon rect hrect area}
# Specifies the output format. (rect = vertical
# rectangles, hrect = horizontal rectangles), area = total
# area of final shapedefault: rect (enum, optional)
<shapeList> # polygon or rect or list of polygon and rect. polygon:
# {{x y} {x y} {x y} ... }; rect: {x1 y1 x2 y2} (list,
# required)
AND <shapeList> # binary operator: intersection of list of shapes
ANDNOT <shapeList> # binary operator: initial list of shapes minus
# second list of shapes
OR <shapeList> # binary operator: union of list of shapes
XOR <shapeList> # binary operator: union of list of shapes minus AND of
# the list of shapes(string, optional)
INSIDE <shapelist> # binary operator: initial shapes that are inside
# (including touching)of one of the shapes from the
# second list
OUTSIDE <shapelist> # binary operator: initial shapes that are outside
# (including touching)of the shapes from the second
# list
ENCLOSE <shapelist> # binary operator: initial shapes that completely
# enclose at least one shape from the second list
STRADDLE <shapelist> # binary operator: initial shapes that are partially
# inside and partially outside at least one shape
58
#from the second list
MOVE {<dx> <dy>} # unary operator : move the list of shapes by {<dx> <dy>}
BBOX # unary operator : computes the bounding box of list of
# shapes
# (string, optional)
HOLES # unary operator : returns list of new shapes that fill
# holes in the original list of shapes
NOHOLES # unary operator : returns list of new shapes that include
# filled holes in the original list of shapes(same as
# dbShape $shapeList HOLES OR $shapeList)
SIZE <value> # unary operator : increase the size of list of shapes by
# <value>
SIZEX <value> # unary operator : increase the size of the list of shapes
# in the X-direction by <value>
SIZEY <value> # unary operator : increase the size of the list of shapes
# in the Y-direction by <value>

1. Select the Metal5 VSS ring horizontal segment at the bottom left of the design and
store the .box attribute using dbGet.

innovus> set set1 [dbGet selected.box]


{285.64 285.72 1226.37 293.72}

2. Select the first two Metal6 VSS segments connecting to the hard block at the bottom
left of the design and store the .box attribute using dbGet.

59
innovus> set set2 [dbGet selected.box]
{535.28 289.72 543.28 350.44} {435.28 289.72 443.28 350.44}

3. Use dbShape to find the intersections of the set1 and set2 lists of shapes.

innovus> set intersection [dbShape $set1 AND $set2]


{435.28 289.72 443.28 293.72} {535.28 289.72 543.28 293.72}

4. Use dbShape to oversize each shape in the previous result by 2.5u.

innovus> dbShape $intersection SIZE 2.5


{432.78 287.22 445.78 296.22} {532.78 287.22 545.78 296.22}

5. The above two commands could be done in a single dbShape call.

innovus> dbShape $set1 AND $set2 SIZE 2.5


{432.78 287.22 445.78 296.22} {532.78 287.22 545.78 296.22}

dbShape operators (binary and unary) are processed in the left-to-right order.

60
Module 8: Using dbGet to
manipulate site data

61
Lab 8-1 dbGet sites basics

Objective: To introduce dbGet for basic site operations

In this section, you will learn how to use dbGet for basic site operations like finding site name, cell
name, symmetry, and row names.

For this section, you are going to use the same database as in the earlier lab sections.

1. Use dbGet to get all sites defined in LEF.

innovus > dbGet head.sites.name


corner pad tsm3site

2. Use dbGet to get all sites in the floorplan.

innovus > dbGet top.fPlan.coreSite.name


tsm3site

3. Use dbGet to query all cells using core site.

innovus > dbGet [dbGet top.fplan.coreSite.name tsm3site -


p3].insts.cell.name
DLY3X1 DLY4X1 DLY4X1 CLKBUFX12 CLKBUFX12 CLKBUFX8 CLKBUFX12 BUFX3 BUFX3
BUFX3 BUFX3 BUFX3 BUFX3 BUFX4 pllclk CLKBUFX12 MX2X1 MX2X1 MX2X1 MX2X1
MX2X1 MX2X1 MX2X1 MX2X1 MX2X1 MX2X1 MX2X1 MX2X1 MX2X1 MX2X1 MX2X1 MX2X1
ram_128x16A DLY1X1 CLKBUFX4 DLY1X1 DLY1X1 DLY2X1 DLY1X1 DLY1X1 DLY2X1
CLKBUFX4 …

4. Use dbGet to query site properties like symmetry and size.

innovus> foreach st [dbGet top.fPlan.coreSite] {


set size [dbGet [dbGet top.fPlan.coreSite.name tsm3site -p].size]
set x_symmetry [dbGet [dbGet top.fPlan.coreSite.name tsm3site -
p].symmetryX]
set y_symmetry [dbGet [dbGet top.fPlan.coreSite.name tsm3site -
p].symmetryY]
puts " [dbGet $st.name] \t $size \t $x_symmetry \t $y_symmetry"
}

tsm3site {0.66 5.04} 0 1

The command returns 1 if the site allows a symmetry of flipping about the X or Y axis and 0 if it
does not.

62
5. Use dbGet to fetch the rows where the site is located.

innovus > dbGet [dbGet top.fPlan.coreSite.name tsm3site -p2].rows.name


ROW_0 ROW_1 ROW_2 ROW_3 ROW_4 ROW_5 ROW_6 ROW_7 ROW_8 ROW_9 ROW_10 ROW_11
ROW_12 ROW_13 ROW_14 ROW_15 ROW_16 ROW_17 ROW_18 ROW_19 ROW_20 ROW_21
ROW_22 ROW_23 ROW_24 ROW_25 ROW_26 ROW_27 ROW_28 ROW_29 ROW_30 ROW_31
ROW_32 ROW_33 ROW_34 ROW_35 ROW_36 ROW_37 ROW_38 ROW_39 ROW_40 ROW_41
ROW_42 ROW_43 ROW_44 ROW_45 ROW_46 ROW_47 ROW_48 ROW_49 ROW_50 ROW_51
ROW_52 ROW_53 ROW_54 …

63
Module 9: Extra Credit: Working
on your own

64
Lab 9-1 Extra Credit

Objective: To practice techniques you have learned

In this section, you will see if you are ready to “go out on your own” and search through the
database for information and use that to pass to other commands.

For this section, you are going use the same database as in the earlier lab sections.

What are the names of the LEF VIAS with the DEFAULT keyword between Metal2
and Metal3 layers?

You can check your results by looking at the LEF files.

How many of those vias are used in the design?

Before the design is routed, you will have zero default vias. The provided database is already routed.
For an additional challenge, you could use the “expression” syntax to look for vias in a specific area.

Create a routing blockage on Metal2 over Metal1 portion of the pin shape for the
refclk terminal of the instance in the lower left of the core area

This is the first time you will need to break down the list-of-lists structure used by dbGet to return
geometric information in order to pass it to another command that expects individual coordinates to
be specified instead of accepting a list directly (refer to the createRouteBlk command usage for the
syntax).

Create a marker between the CLASS BLOCK instances if the instances are closer
than 25u

Refer to the createMarker command for how to add a marker to the database. Hint: use dbShape with
the SIZE operator twice to oversize (10u) and undersize (-10u) to merge shapes that are closer than
20u.

Get the special nets (for example, power and ground) of a specific instance

Hint: You can use the get_pg_inst_term_net command.

Solutions for the above labs are provided in the scripts directory.

65
Support
Cadence Support Portal provides access to support resources, including an extensive
knowledge base, access to software updates for Cadence products, and the ability to interact
with Cadence Customer Support. Visit https://support.cadence.com.

Feedback
Email comments, questions, and suggestions to content_feedback@cadence.com.

66

You might also like