Uploaded by minhhieubku

dbGet practice

advertisement
2. How to start your dbget chain?
1) head
> dbget head.topCells.name
2) top
> dbget top.insts.name
[start chain with Root/Head of the database]
[start chain with specified top cell]
3) object/attribute pointer
> dbget 0x2aaac4a9c000.objType [start chain with certain one pointer of object/attribute]
4) selected
> dbget selected.name
[start chain with object selected through select* commands or GUI]
3. How to trace your dbget chain to downgrade?
1) "Tab" menu after period
> dbget top.<Tab>
[return all subordinate objects/attributes]
bumps designLib designView fPlan
hInst
insts
2) objects/attribute .? | .?? |.?h
> dbget top.?
[return all subordinate objects/attributes]
topCell: bumps designLib designView fPlan hInst
> dbget top.??
[return all subordinate objects/attributes and corresponding value]
> dbget top.?h
[return all subordinate objects/attributes and related description]
=======================================================
topCell: Top cell, container for flattened connectivity
------------------------------------------------------designLib: string, Library name for the design in OpenAccess cellview
3) dbschema
> dbSchema head
description]
[{dbschema $obj} return all sub-object/attribute and corresponding
===============================
head: Root/Head of the database
------------------------------allCells: objList(libCell ptnCell topCell vCell), List of pointers to cells of all types (library cells and design
cells)
cellEdgeSpacings: list(list), List of cell edge spacing values, list form: {cell_edge_name1 cell_edge_name2
spacing_coord}.
dbUnits: int, Database units per user unit
> dbSchema *net [{dbschema $obj_pattern} return all matched object and the subordinate
objects/attributes description ]
=============================================
hNet: Hierarchical net (derived from netlist)
--------------------------------------------allTerms: objList(hInstTerm hTerm instTerm), List of pointers to connections on the net
defName: string, Fully qualified def name of the hNet from db
5. How to use "dbschema" to trace your dbget chain to upgrade?
1) dbSchema
> dbSchema -parent fPlan
attributes, with description]
[{dbschema -parent $obj/$attrs} return the parent object or
=======================================================
topCell: Top cell, container for flattened connectivity
------------------------------------------------------fPlan: obj(fplan), Pointer to the floorplan
> dbSchema -parent fPlan -list
[{dbschema -parent $obj/$attrs -list} return list of parent]
topCell
> dbSchema * fPlan
[{dbschema $pattern $obj/attrs} return all parent and description]
=======================================================
topCell: Top cell, container for flattened connectivity
------------------------------------------------------fPlan: obj(fplan), Pointer to the floorplan
> dbSchema * *Status
[fuzzy match for attributes and find the parent]
6. How to get what object/attribute information you want through dbget option?
(1) dbGet [-p num ] if you specify -p[num], the software traverses "num"
levels back through the specified objects pointer.
Example:
> dbGet top.insts.pStatus fixed -p [traverses one level back through the specified object:inst
pointer whose pStatus matched "fixed", "-p" is equal to "-p1".]
0x2aaaf4a57100 0x2aaaf4a57170 ...
> dbGet top.nets.instTerms.inst.name u_aes_io/pi_din_in_1 -p2
[traverses two levels back
through the specified object:instTerm pointer whose inst name matched "u_aes_io/pi_din_in_1"]
0x2aaaf8dbb8f8 0x2aaaf8dbb888 0x2aaaf8dbb8c0
> dbget [dbGet top.nets.instTerms.inst.name u_aes_io/pi_din_in_1 -p2].objType
instTerm instTerm instTerm
> dbGet top.nets.instTerms.inst.name u_aes_io/pi_din_in_1 -p3
[traverses three levels back
through the specified object:net pointer whose inst name matched "u_aes_io/pi_din_in_1"]
0x2aaaf4b38160 0x2aaaf4b38f20 0x2aaaf88f7798
> dbget [dbGet top.nets.instTerms.inst.name u_aes_io/pi_din_in_1 -p3].objType
net net net
(2) dbGet [-u]
Removes duplicate objects from the query results so that the
results list only contains unique entries.
(3) dbGet [-i]
The option -i num would select the the numth element starting from 0
Example:
> dbGet top.nets.name dout* -p -i 0
[return 1st pointer in the list of the nets whose name
matches the pattern dout*]
0x2aaaf4b38268
> dbget [dbGet top.nets.name dout* -p -i 0].name
dout_out_0
(4) dbget [-d] Returns values in database integers. Default: Returns values in floating point user
units
(5) dbget [-e]
To avoid NULL (0x0) pointers and results from being printed. This is an optional
option of type boolean and would effect all kinds of outputs.
> dbget top.nets.name
> llength [dbget top.nets.name]
> llength [dbget top.nets.name -e]
and results ]
[with option "-e", the return ignored NULL (0x0) pointers
> llength [dbget top.nets {.wires == 0x0}]
total number of wires(5300+66582 = 71882)]
[the sum of "0x0" and valid pointers matched
(6) pattern
Specifies a string expression to use to match object or attribute names, or attribute
values. The software uses simple wildcard matching ( * , ? ).
> dbGet top.insts.? pstatus
inst: pStatus
> dbGet top.insts.? PSTATUS
inst: pStatus
> dbGet top.insts.? ps*
pattern is case incensitive.]
[when you use pattern to match object or attribute names, the
> dbGet top.insts.pStatus placed -u
placed
PRACTICE:
•
List all cell types used in the design
•
Ensure all your tiehi/tielo connections have tie cells (and are not connected to a rail instead)
•
Get all instTerm names that are tied to tieLo cells
•
Find all instances of a certain cell type
•
List the nets marked in the db as clock net
•
Get database units
•
Report Dont Touch instances:
•
Report Dont Use cells in the database
•
Get all the sequential cells of a particular module (selectModule <module_name>)
•
Get the instname / cellname of the driver driving a specific net
•
Query max_cap for a list of cells
•
Find non-clock ports in a design
•
Report the clock gate in a design
•
Print all module names in the design
•
Get all leaf cells used in the design
•
To get cells with timing models, use the following command:
•
To get multibit cells and their instance names in a design, use the following command:
•
Apply set_dont_touch on selected instances
•
Report latency of all memories in the design
•
Script to find and delete nets with no Fanout(Dangling Nets).
•
Script to find Floating input pins in a design.
•
Script to find Floating output pins in a design.
•
Script to report floating Instances in a design.
•
Script to report Floating IO ports in a design.
•
Suppose you want to capture a list of all nets in the design that are connected to IO pins.
•
Find back-to-back Inverter pair: This script traces all the inverter cells having a master cell
name, inv, and print back-to-back Inverters in a file.
•
Report the instances of one particular library cell
•
Report the properties of an instance
•
Find the number of fanout loads for the output terminal of the given instance
•
Find out latches in the design
•
Get a list of instance names connected to a specific port, pin or net
•
Upsize driver cells that have high SI effect on nets: This script can be used to upsize driver cells of
the nets that have high SI (incremental delay) effect.
•
Reporting cell class, number of instances and area like below:
Cell Model
Cell Class
Instances
Area (um^2)
<libCell name>
Combinational
1
0.171360
<libCell name>
Combinational
1
0.142800
<libCell name>
Inverter
1
0.142800
<libCell name>
Inverter
1
0.085680
<libCell name>
Buffer
2
0.456960
<libCell name>
Buffer
8
0.913920
<libCell name>
Combinational
6
0.514080
<libCell name>
Flop
9
7.197120
<libCell name>
Flop
3
2.484720
<libCell name>
Flop
8329
6184.782240
###############################################################################
Answers:
•
List all cell types used in the design
dbGet -u top.insts.cell.name
•
Ensure all your tiehi/tielo connections have tie cells (and are not connected to a rail instead)
dbGet top.insts.instTerms.isTieHi 1
dbGet top.insts.instTerms.isTieLo 1
The previous commands should return "0x0" if all connections have tie cells. If "1s" are returned,
use the following commands to find the terms that still need a tie cell:
dbGet [dbGet -p top.insts.instTerms.isTieHi 1].name
dbGet [dbGet -p top.insts.instTerms.isTieLo 1].name
•
Get all instTerm names that are tied to tieLo cells
dbGet [dbGet -p [dbGet -p2 top.insts.cell.subClass
coreTieLo].instTerms.net.allTerms.isInput 1].name
•
Find all instances of a certain cell type
dbGet [dbGet -p2 top.insts.cell.name cellName].name
•
List the nets marked in the db as clock net
dbGet [dbGet -p top.nets.isClock 1].name
•
Get database units
dbGet head.dbUnits
•
Report Dont Touch instances:
dbGet [dbGet -p top.insts.dontTouch true].name
•
Report Dont Use cells in the database
dbGet [dbGet -p head.libCells.dontUse 1].name
•
Get all the sequential cells of a particular module
selectModule <module_name>
dbGet [dbGet selected.insts.cell.isSequential 1 -p2].name
•
Get the instname / cellname of the driver driving a specific net
set netName netName
set inst [dbGet [dbGet -p [dbGet -p top.nets.name $netName].allTerms.isOutput
1].inst]
Puts "Net: $netName, driving inst name: [dbGet $inst.name], driving cell name:
[dbGet $inst.cell.name]"
•
Query max_cap for a list of cells
cellPtrList [dbGet -p head.allCells.name BUF*]
foreach cellPtr $cellPtrList {puts "[dbGet $cellPtr.name] [dbFTermMaxCap [dbGet -p
$cellPtr.terms.name termName] 1]"}
•
Find non-clock ports in a design
dbGet [dbGet -p [dbGet -p2 top.terms.net.isClock 0].isInput 1].name
•
Report the clock gate in a design
set icgInstPtrList [dbGet -p3 top.insts.cell.terms.type gatedClockTerm]
foreach icgInstPtr $icgInstPtrList {
set instName [dbGet $icgInstPtr.name]
set cellName [dbGet $icgInstPtr.cell.name]
Puts "Instance: $instName ($cellName)"
}
set numOfIcgs [llength $icgInstPtrList]
Puts ""
Puts "Total ICG Instances: $numOfIcgs"
Puts ""
•
Print all module names in the design
foreach module_name [dbGet top.hInst.treeHInsts.cell.name] {
Puts "$module_name"
}
This will not include the top module name. To get the top module name, run the following
command:
dbGet top.name
•
Get all leaf cells used in the design
foreach leaf_name [dbGet -u top.insts.cell.name] {
Puts "$leaf_name"
}
•
To get cells with timing models, use the following command:
dbGet [dbGet -p head.libCells.isTimeDefined 1].name
To get cells without timing models, use the following command:
dbGet [dbGet -p head.libCells.isTimeDefined 0].name
•
To get multibit cells and their instance names in a design, use the following command:
dbGet [dbGet [dbGet -p head.libCells.isSequential 1] {.numOutputs > 1 }].name
To get instance names of cells, use the following command:
foreach cell [dbGet [dbGet [dbGet -p head.libCells.isSequential 1] {.numOutputs
> 1 }].name *DFF*] {
foreach instPtr [dbGet top.insts.cell.name $cell -p2] {
puts "INST: [dbGet $instPtr.name]"
}
}
•
Apply set_dont_touch on selected instances
Select the instances on which to apply set_dont_touch. For example, select all level-shifter
instances with the "LS" prefix:
dbGet top.insts.name LS*
Then, run the following command:
foreach term [dbGet selected.instTerms.net.term –e] {
set_dont_touch [dbGet $term.net.name] true
}
•
Report latency of all memories in the design
Following script prints the latency of all memories with cell name *RAM* and clock pin name
*CLK. You can change *RAM* with cell name of the desired memories, or as per your
design.
set mem_pin [dbget [dbget top.insts.cell.name *RAM* -p2].instTerms.name *CLK]
foreach i $mem_pin {
puts "$i [get_property [get_pins $i] actual_latency_late_rise_max]"
}
•
Script to find and delete nets with no Fanout(Dangling Nets).
proc dangling_net {output_file} {
set out [open $output_file "w"]
set ss [dbGet [dbGet -p top.nets.numInputTerms 0 ].name]
foreach dangling $ss {
puts $out " Dangling Net found : $dangling "
puts " deleting Net $dangling "
deleteNet $dangling
}
close $out
}
•
Script to find Floating input pins in a design.
proc floating_input_pin {output_file} {
set out [open $output_file "w"]
foreach x [dbget [dbget -p [dbget -p top.insts.instTerms.name *].isInput
1].name] {
set y [dbget [dbget -p top.insts.instTerms.name $x ].net]
if {[regexp $y 0x0]} {
puts $out "Dangling pin $x"
} else {
set signalNet [dbget [dbget -p top.insts.instTerms.name
$x ].net.isPwrOrGnd]
if {$signalNet==0} {
set driver [dbget [dbget -p top.insts.instTerms.name
$x ].net.numOutputTerms]
if {$driver==0} {
puts $out "Pin connected to net but net has no driver $x"
}
}
}
}
close $out
}
•
Script to find Floating output pins in a design.
proc floating_output_pin {output_file} {
set out [open $output_file "w"]
foreach x [dbget [dbget -p [dbget -p top.insts.instTerms.name *].isOutput
1].name] {
set y [dbget [dbget -p top.insts.instTerms.name $x ].net]
if {[regexp $y 0x0]} {
puts $out "Dangling pin $x"
} else {
set signalNet [dbget [dbget -p top.insts.instTerms.name
$x ].net.isPwrOrGnd]
if {$signalNet==0} {
set driver [dbget [dbget -p top.insts.instTerms.name
$x ].net.numInputTerms]
if {$driver==0} {
puts $out "Pin connected to net but net has no load $x"
}
}
}
}
close $out
}
•
Script to report floating Instances in a design.
proc floating_instance {output_file} {
set out [open $output_file "w"]
foreach instPtr [dbGet top.insts] {
set instName [dbGet $instPtr.name]
set connectionFound 0
# Foreach instance term check if it is connected to a net. If
# it is connected to a net make sure output terms drive a sink,
# and sinks are driven by output term. Set $connectionFound = 1
# if any connections are found.
foreach instTerm [dbGet $instPtr.instTerms] {
if {[dbGet $instTerm.net] != "0x0"} {
# If term is an input, check if the net has a driver
set isInput [dbGet $instTerm.isInput]
set isOutput [dbGet $instTerm.isOutput]
set numOutputTerms [dbGet $instTerm.net.numOutputTerms]
set numInputTerms [dbGet $instTerm.net.numInputTerms]
if {$isInput == "1" && $numOutputTerms > 0} {
set connectionFound 1
}
if {$isOutput == "1" && $numInputTerms > 0} {
set connectionFound 1
}
}
}
if {$connectionFound == 0} {
puts $out "Instance $instName is floating"
}
}
close $out
}
•
Script to report Floating IO ports in a design.
proc floating_IO_ports {output_file}
set out [open $output_file "w"]
set a [dbGet [dbGet [dbGet top.terms
set b [dbGet [dbGet [dbGet top.terms
0}].name]
puts $out "list of floating IO ports
close $out
}
•
{
{(.isInput)}].net {.numInputTerms == 0}].name]
{(.isOutput)}].net {.numOutputTerms ==
$a $b"
Suppose you want to capture a list of all nets in the design that are connected to IO pins.
set outfile [open io.nets "w"]
foreach net [dbGet [dbGet -u top.terms.net].name] {
puts $outfile $net
}
close $outfile
•
Find back-to-back Inverter pair: This script traces all the inverter cells having a master cell
name, inv, and print back-to-back Inverters in a file.
proc trace_inv {filename} {
set file [open $filename "w"]
set backToBackInv 0
foreach invInst [dbGet [dbGet top.insts.cell.name -p2 *inv*].name] {
foreach instTerm [dbGet [dbGet top.insts.name -p $invInst].instTerms.isOutput -p1
1] {
set invCount [llength [dbGet $instTerm.net.instTerms.inst.cell.name -p1
*inv*]]
if {[expr $invCount > 1]} {
puts $file "Inv Pair::
[dbGet [dbGet $instTerm.net.instTerms.inst.cell.name -p2 *inv*].name]"
set backToBackInv [expr $backToBackInv + 1]
}
}
}
puts $backToBackInv
close $file
}
•
Report the instances of one particular library cell
dbGet [dbGet -p2 top.insts.cell.name <lib_cell_name>].name
•
Report the properties of an instance
For example, get the property for a particular instance at a later stage if an instance has
the resizeOnly attribute set by setOptMode -sizeOnly <filename>:
dbGet [dbGet [dbGet -p top.insts.name instName].props].name
ResizeOnly
dbget [dbget [dbGet -p top.insts.name padName].props ].name
connectEntry InstIo
•
Find the number of fanout loads for the output terminal of the given instance
dbGet [dbGet -p [dbGet -p1 top.insts.name <inst_name>].instTerms.isOutput
1].net.numInputTerms
•
Find out latches in the design
set j 0
dbForEachCellInst [dbgTopCell] inst {
if { [dbIsCellLatch [dbInstCellName $inst]] } {
set instName [dbInstName $inst]
# Puts "Latch : $instName : [dbInstCellName $inst]"
incr j
}
}
Puts "There are $j Latches in this Design.
•
Get a list of instance names connected to a specific port, pin or net
If you want to find the instances connected to a specific pin or port, you can first find the net name
connected to the pin or port, and then pass the net name into the following procedure.
To find the net connected to a port:
set netName [dbGet -p top.terms.name $portName].net.name
To find the net connected to a pin:
set netName [dbGet -p top.insts.instTerms.name $pinName].net.name
proc getInstsConnectedToNet {netName} {
set termPtrList [dbGet [dbGet -p top.nets.name $netName].allTerms]
foreach term $termPtrList {
if {[dbGet $term.objType] == "instTerm"} {
Puts " Instance: [dbGet $term.inst.name]"
}
}
}
•
Upsize driver cells that have high SI effect on nets: This script can be used to upsize driver cells of
the nets that have high SI (incremental delay) effect.
## Dump timing reports
set_table_style -no_frame_fix_width -nosplit
set_global timing_report_group_based_mode false
report_timing -max_paths 10000000 -max_slack 0 -format {net incr_delay}
##
> tim.rpt
## Set incr delay threshold
set incr_thresh 0.05
##
## Dump nets having incr delay more than threshold
set fp [open tim.rpt r]
set fp1 [open net.rpt w]
while {![eof $fp]} {
gets $fp line
while {![regexp
"Net
Incr" $line]
&& ![eof $fp]} {gets $fp line}
if {[eof $fp]} {break}
gets $fp line ; gets $fp line ; gets $fp line
while {![regexp {\---} $line]} {
set net [lindex $line 0]
set incr [lindex $line 1]
if {$incr==0 || [regexp {\-} $incr] || [regexp {\-} $net]} {gets $fp line ; continue}
if {$incr > $incr_thresh} {puts $fp1 "$net $incr"}
gets $fp line
}
}
close $fp
close $fp1
exec sort -u net.rpt > tmp
exec mv tmp net.rpt
##
## Dump change_cell for the nets having incr_delay more than specified threshold
set fp [open net.rpt r]
set fp1 [open change_cell.tcl w]
while {![eof $fp]} {
gets $fp line
if {$line==""} {continue}
set net [lindex $line 0]
set net1 [dbGetNetByName $net]
dbForEachNetOutputTerm $net1 pin {set pin [dbGet $pin.name]}
set inst [dbGet [dbGetTermByInstTermName [lindex $pin 0]].inst.name]
puts $fp1 "change_cell -inst $inst -upsize"
}
close $fp
close $fp1
•
Reporting cell class, number of instances and area like below:
Cell Model
Cell Class
Instances
Area (um^2)
<libCell name>
Combinational
1
0.171360
<libCell name>
Combinational
1
0.142800
<libCell name>
Inverter
1
0.142800
<libCell name>
Inverter
1
0.085680
<libCell name>
Buffer
2
0.456960
<libCell name>
Buffer
8
0.913920
<libCell name>
Combinational
6
0.514080
<libCell name>
Flop
9
7.197120
<libCell name>
Flop
3
2.484720
<libCell name>
Flop
8329
6184.782240
###############################################################################
proc report_cell_area {args} {
parse_proc_arguments -args $args options
if { [info exists options(-append)] } { set append "-append" } else { set append "" }
if { [info exists options(-file)] } {
eval [subst "redirect $options(-file) {report_cell_area} $append -quiet"]
return
}
Puts [format "%-50s %-15s %-10s %-15s" "Cell Model" "Cell Class" "Instances" "Area
(um^2)"]
foreach c [dbGet head.libCells {.numRefs > 0}] {
set name [dbGet $c.name]
set insts [dbGet $c.numRefs]
set area [expr 1.0 * $insts * [dbGet $c.size_x] * [dbGet $c.size_y]]
set class "other"
if
{ [dbGet $c.isIsolationCell] == 1 } {
set class "Isolation"
} elseif { [dbGet $c.isLevelShifter] == 1 } {
set class "LevelShifter"
} elseif { [dbGet $c.isBuffer] == 1 } {
set class "Buffer"
} elseif { [dbGet $c.isInverter] == 1 } {
set class "Inverter"
} elseif { [regexp {true} [get_property [get_lib_cells -quiet */$name]
is_integrated_clock_gating_cell]] } {
set class Latch
} elseif { [dbGet $c.isSequential] == 1 } {
set class "Flop"
} elseif { [regexp {true} [get_property [get_lib_cells -quiet */$name]
is_combinational]] } {
set class Combinational
} elseif { [dbGet $c.numTerms] == [dbGet $c.numOutputs] } {
set class "Constant"
}
Puts [format "%-50s %-15s %10d %15f" $name $class $insts $area]
}
}
define_proc_arguments [namespace current]::report_cell_area -info {Generates an area report
for all cells used in design.} -define_args {
{-file "output filename" "filename" string}
{-append "appends to output file" "" boolean}
}
Lab of dB:
https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1O0V0000067AMGUA2&pageName=A
rticleContent
Download
Study collections