INVS191 DBTCL Labs
INVS191 DBTCL Labs
INVS191 DBTCL Labs
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
Lab 1-2 Using the “.” to traverse to child objects using dbGet ................................................ 13
Lab 2-2 Using pattern matching to filter dbGet attribute searches ........................................... 24
Lab 3-1 Finding out more descriptive information about an attribute ...................................... 39
Lab 5-1 Converting coordinates from local to global using dbTransform ............................... 50
3
Module 8: Using dbGet to ............................................................................................................ 61
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
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.
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
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:
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™.
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.
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™.
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”.
9. Use dbGet to find the list of attributes available from a set of selected objects.
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.
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
In this section, you will learn how to use dbGet to walk through the database.
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.
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 “.”.
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.
5. The traversal also works when you have multiple objects selected.
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
In this section, you will learn how to use dbGet to walk through the database via the DB Browser.
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™.
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:
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
In this section, you will learn how to start a dbGet traversal from other objects (top, head, and user-
specified objects).
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.
Usage: dbGet [-help] [-d] [-u] [-v] [-e] [-i <num>] [-regexp] [-p[<num>]]
{<obj>|<objList>|head|top|selected}[.<objType>]...[[.<attrName>|.?|.??|.?h]
[<pattern> | [expression]]
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:
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
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.
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.
The displayed attributes are now limited to those that matched the *net* pattern.
24
Lab 2-3 Using <TAB> completion to find attribute names
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).
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.
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.
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.
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.
26
Lab 2-4 Using pattern matching to filter dbGet return results
In this section, you will learn how to filter results from the dbGet queries.
For this section, you will use the same database as in the earlier lab sections.
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:
Now, the return information contains only the terminal names that matched the sc*
pattern.
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:
4. Example of using dbGet with filtering to instances that have a cell master called
pllclk:
5. Example of using dbGet with filtering to instances that have a cell master called
pllclk and returning the cell pointers (-p):
6. Example of using dbGet with filtering to instances that have a cell master called
pllclk and returning the instance pointers (-p2):
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:
28
0x2aaac8e50620
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”.
10. Example 2: Search the database for instances that have “fixed” placement
status whose cell master is “pllclk”.
11. Example 3: Search the database for instances that have “fixed” placement
status whose cell master is “pllclk”.
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.
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):
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.
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.
31
Lab 2-5 Using expressions to filter dbGet return results
In this section, you will learn how to use Tcl expressions to filter the objects returned by dbGet.
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.
32
2. Use homogeneous list method (head.libCells) to obtain the list of library cells
instead of using "dbGet -p head.allCells.objType libCell".
3. Use Tcl expressions to find all library cells that have more than 10 inputs and
whose name matches the ra* pattern (two step).
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).
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
In this section, you will learn how to access geometric information (halos, pin location, etc.)
using dbGet.
For this section, you are going to use the same database as in the earlier lab sections.
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}
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:
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.
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
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.
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,
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.
-----------------------------------------------------------------------
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.
4. Use the .?h and filter to find out more about the clock-related attributes of the net
object.
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
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.
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.
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?
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?
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.
pHaloBot: 20.0
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_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.
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.
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.
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.
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.
48
Module 5: Using dbTransform to
convert coordinates
from local to global
49
Lab 5-1 Converting coordinates from local to global using
dbTransform
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).
2. Use the coordinates and selected instance pointer to convert the list of rectangles
into a list of rectangles in the design context.
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.
51
Module 6: How to query objects
within an area using
dbQuery
52
Lab 6-1 Find objects in an area using dbQuery
In this section, you will learn how to use dbQuery to obtain a list of objects in a specified area.
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.
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).
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.
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?
54
It looks like the baseClass = pad is likely equivalent to CLASS 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.
For this example, there is only one non-pad instance in the specified area. Now, all you
need is its instance name.
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.
8. Use dbGet with dbQuery to find which layers those shapes are on.
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
In this section, you learn how to use dbShape for basic operations like finding intersections between
sets of shapes and then oversize the result.
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>] ...
1. Select the Metal5 VSS ring horizontal segment at the bottom left of the design and
store the .box attribute using dbGet.
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.
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
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.
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.
63
Module 9: Extra Credit: Working
on your own
64
Lab 9-1 Extra Credit
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?
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
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