Doc DbCommands
description
Transcript of Doc DbCommands
-
CADENCE CONFIDENTIALCADENCE CONFIDENTIAL
Encounter TclDatabase Access Commands
Cadence ICD R&DPatrick J. EichenseerJune 14, 2005 Version 1.0
-
2 CADENCE CONFIDENTIAL
1.0 Overview1.0 Overview2.0 Introduction3.0 Schema Diagrams4.0 Testing Objects5.0 Retrieving Object6.0 Retrieving Object Properties7.0 Setting Objects8.0 Adding/Creating/Manipulating Objects9.0 Deleting Objects10.0 Examples11.0 Labs
-
CADENCE CONFIDENTIALCADENCE CONFIDENTIAL
Encounter TclDatabase Access Commands
2.0 Introduction
-
4 CADENCE CONFIDENTIAL
2.0 Introduction - Premise For This Material
Users should not need to be TCL experts to be effective with EDA tools
TCL can serve as a short term solution until native functions can be developed and delivered; TCL shouldnt serve to eliminate the need to enhance and refine an EDA tool
Becoming familiar with the native database structure in a designsystem can help users be more effective with the tool
EDA databases are (hopefully) organized in a more logical way than a text output from the tool
Manipulating EDA databases should be faster than parsing and manipulating text output from tools
-
5 CADENCE CONFIDENTIAL
2.0 Introduction The following files are searched for and loaded if found:
$ENCOUNTER/etc/enc.tcl ->Project-wide TCL Commands ./enc.tcl -> Design-specific TCL commands ~/enc.tcl -> User-specific TCL commands
these initialization tcl files which run just after FE invocation Very easy to customize and automate Encounter using Tcl database access commands Support both hierarchical database access and flat database access Tcl 8.x for Encounter Fast-Track database access and user programming. Tk 8.x for Encounter GUI customization. Loading Tcl source file
source $ENCOUNTER/gift/scripts/tcl & $ENCOUNTER/fe/etc/ has examples updateStatus force is often used with db access tcl scripts to update the current design
status
-
6 CADENCE CONFIDENTIAL
2.1Capturing TCL Commands encounter.cmd: Contains TCL commands that were executed during a session encounter.log: Contains the log file that was streamed to the screen
Tip: TCL commands are also embedded within the .log file. Search for the string
To determine what the name of the current .log/.cmd files: encounter> getLogFileName encounter> getCmdLogFileName
To replay the commands executed within a session: encounter
Design->Design Import->OK maps to "loadConfig bigchip.conf" encounter>amoebaPlace;trialRoute;extractRC;buildTimingGraph;reportViolation -outfile bigchip.tarpt;exit
encounter -init encounter.cmd encounter -help -> for more startup options Puts vs puts
-
7 CADENCE CONFIDENTIAL
2.2 Command Line Help
"info command *pattern*" or "*pattern*" info command *Place* -> returns a list of all defined TCL commands that
match *Place* *Place* -> also returns a list of commands, as it is "ambiguous", however, if
the search string matches exactly 1 TCL command, the command is executed:
remove*Tree -> executes "removeBufferTree" command
help amoebaPlace -> returns usage for command Case Sensitivity:
Good: trialRoute trialroute TRIALROUTE Bad: TrialRoute trial_route Options ARE case senstive:
help trialRoute -> trialRoute [-guide ] [-noDetour] [-ignoreObstruct] GOOD: trialRoute -noDetour BAD: trialRoute -nodetour
-
8 CADENCE CONFIDENTIAL
2.3 Documentation
Where to get Encounter Documentation? Click "Help" on the Main Encounter GUI for html cp $ENCOUNTER/doc/*/*.pdf ~/fedocs/.
soceUG.pdf (Encounter Users Guide) encounter.pdf (Menu Command Reference) fetxtcmdref.pdf (Text Command Reference) soceDBAref.pdf (Database Access Command Reference)
-
9 CADENCE CONFIDENTIAL
2.4 My "encounter>" prompt is hung!
encounter> prompt locks up after typing: removeBuffre removeBuffre^[[3 FE thinks a TCL command has been started, and is waiting for you
to complete it
Solutions On the next line "close" the square brackets: ]] Try "editCmdLine" stty erase
-
10 CADENCE CONFIDENTIAL
2.5 Connectivity Model cells have fterms insts have terms
terms connect to nets
nets connect to terms and fterms fterms are IO Pins as viewed by the top cell fterms can also be the pins on a library cell, as in BUFX2
instPtr
instPtrnetPtr
termPtr
IO Pin: ftermPtr
termPtr
set cell [dbgTopCell]
set instName dtmf_inst/i635set cell [dbInstCell [dbGetInstByName $instName]]set cellName [dbCellName $cell]BUFX2
A ftermZ fterm
Block Level Perspective:
Library Cell Perspective:
-
11 CADENCE CONFIDENTIAL
2.6 Simple Example
1. # select all instances connected to a specified net name
2. proc selectInstByNet { netName } { # proc and argument definition 3. set netPtr [dbGetNetByName $netName] # get the net pointer4. dbForEachNetTerm $netPtr termPtr { # loop for all terminals5. if { [dbIsObjTerm $termPtr] == 1 } { # if the object is instance terminal6. set instPtr [dbTermInst $termPtr] # get a instance pointer of the terminal7. set instName [dbInstName $instPtr] # get the instance name8. set cellName [dbInstCellName $instPtr] # get the cell master name9. puts "Instance $instName ($cellName) # print names10. selectInst $instName # select the instance11. }12. }13. }
14. encounter> source sample.tcl # source the tcl file15. encounter> selectInstByNet # run the proc defined in your tcl file
instPtr
instPtr
instPtrnetPtr
termPtr
termPtr
termPtr
-
CADENCE CONFIDENTIALCADENCE CONFIDENTIAL
Encounter TclDatabase Access Commands
3.0 Schema Diagrams
-
13 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell 38)Hinst->Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
14 CADENCE CONFIDENTIAL
3.2 Multiple Object Pointers: dbForEach dbForEach Usage: dbForEachHeadSelPtr Example: Finding all of the clock nets by a search string set count 0
dbForEachCellNet [dbgTopCell] netPtr { set netName [dbNetName $netPtr] if {[string match *CLK* $netName} { puts "Net $netName matches search string \*CLK\*." incr count
} } puts "Done. Found $count net(s) that match search criteria."
-
15 CADENCE CONFIDENTIAL
HeaddbgHead
dbHeadName
4.2 Encounter Tcl/Tk Database AccessSingle Objects
07/01/05 P. Eichenseer
Design Info
Cadence Company Confidential
Database UnitsNumbers
dbHeadAspectRatiodbHeadBox
dbHeadCoreBoxdbHeadIoBoxdbHeadIoHgt
dbHeadBlockAsStdCell
dbHeadTopCell/dbHeadChipTopCell
dbHeadStdCellHgt
dbHeadSpDetailLen
dbHeadBlockMargin
dbHeadSpGlobalLen
dbHeadNrHilitedbHeadNrLayer
dbHeadNrLefLayerdbHeadNrExtRule
dbHeadNrWireLayerdbHeadNrExtRulePlus1
dbHeadNrSeldbHeadDBUPerIGUdbHeadOhmPerDBUdbHeadDBUPerIoGU
dbHeadNPicoSecPerDBUdbHeadMicroPerDBU
dbHeadDBUPerMGrid
dbHeadPicoFPerDBU
-
16 CADENCE CONFIDENTIAL
3.5 Querying Single Object Pointers
db $netPtr
Example: Querying a net to find out how many recievers it has encounter> dbNetNrFanOut $netPtr
782
Capturing the result for later use set fanout [dbNetNrFanOut $netPtr] encounter> puts "Net $fanout" 782
-
17 CADENCE CONFIDENTIAL
3.4 Getting Single Object Pointers By Selection
set netPtr [dbHeadFirstSelPtr] By Name
dbGetByName Where is one of:
Net, Inst, Term, set Ptr [dbGetByName ] Examples:
encounter> set netPtr [dbGetNetByName SH17/net18028] Returns: 0xc4d5c0c is GOOD Returns: 0x0 means not foundBy
By Reference dbNetTerm
-
18 CADENCE CONFIDENTIAL
3.7 Modifying Single Objects
dbSet Example: Setting a net's weight for Amoeba Placement dbSetNetUserWt dbSetNetUserWt [dbGetNetByName " SH17/net18028"] 10 dbSetIs Example: Instructing Trial Route to not route a certain net dbSetNetIsIgnoreInRoute dbSetNetIsIgnoreInRoute $netPtr 1
-
19 CADENCE CONFIDENTIAL
3.6 Looping Through Objects: dbForEach dbForEach Example: dbForEachHeadSelPtr Example: Finding nets that match a search string set count 0
dbForEachCellNet [dbgTopCell] netPtr { set netName [dbNetName $netPtr] if {[string match *CLK* $netName} { puts "Net $netName matches search string \*CLK\*." incr count
} } puts "Done. Found $count net(s) that match search criteria."
-
20 CADENCE CONFIDENTIAL
3.7 The Selected Set
Usage: dbForEachHeadSelPtr Example: Finding all currently selected Hierarchical Instances set names {} dbForEachHeadSelPtr [dbgHead] object { if {[dbObjType $object] == "dbcObjHInst"} { lappend names [dbHInstName $object] } } Note: Objects can be hilited without being selected
dbIsInstHilite is not the same as dbIsInstSel Refer to the number of selected objects in the lower right part of the GUI
-
21 CADENCE CONFIDENTIAL
3.7 The Selected Set# userCheckArea checks a certain area(Box) on a specific# layer and returns the object(s) type and name as well# as the total number of objects# eg. encounter> userCheckArea { 1000 1000 4000 4000 } 2# Info: editSelect -layer 2 -area 1000 1000 4000 4000# Info: found object SH25 of type dbcObjHInst# 2
# encounter
#
proc userCheckArea { Box layerList } {set NrObj ""foreach this_layer $layerList {
editSelect -layer $this_layer -area [lindex $Box 0] [lindex $Box 1] [lindex $Box 2] [lindex $Box 3]if { [dbHeadNrSel] > 0} {set NrObj "$NrObj $this_layer"puts "Info: editSelect -layer $this_layer -area [lindex $Box 0] [lindex $Box 1] [lindex $Box 2] [lindex $Box 3]"
}dbForEachHeadSelPtr [dbgHead] SelPtr {Puts "Info: found object [dbObjName $SelPtr] of type [dbObjType $SelPtr]"
}deselectAll
}return $NrObj
}
-
CADENCE CONFIDENTIALCADENCE CONFIDENTIAL
Encounter TclDatabase Access Commands
4.0 Testing Objects
-
23 CADENCE CONFIDENTIAL
4.0 Testing Objects - What is this Thing?
dbObjType [dbHeadFirstSelPtr] Returns something like "dbcObjGuide"
Use this to guide your scripting set count 0 dbForEachFPlanConstraint $floorplanPointer constraint {
if {[string match [dbObjType $constraint] "dbcObjGuide"]} { puts "Found a guide!" incr count
} } puts "Done. Found a total of $count floorplan guide(s)."
-
24 CADENCE CONFIDENTIAL
4. Testing Objects4-1 general return the constant value of object type
ObjType dbObjType $objPtr
dbcObjNet dbcObjTerm dbcObjFTerm dbcObjInst, dbcObjWire dbcObjHead dbcObjCelldcbObjHInst dbcObjPath dbcObjIo dbcObjLayer dbcObjTimeArc dbcObjFPlan dbcObjStdRowdbcObjConstraint dbcObjScreen dbcObjProp dbcObjDPath dbcObjDPInst dbcObjDPHInstdbcObjObstruct dbcObjectWireX dbcObjPerim dbcObjGroup dbcObjBus dbcObjSecdbcObjPtn dbcObjVio dbcObjSNet dbcObjRouteBox dbcObjRouteGuide dbcObjNetGroupdbcObjDLine dbcObjTimeLib dbcObjOpCond dbcObjLayerBlk dncObjRuler dbcObjPtnCutdbcObjPtnPinBlk dbcObjPtnFeed dbcObjPinGroup dbcObjCellPad dbcObjNetRectdbcObjXPin dbcObjRPin dbcObjBumpCell dbcObjBump dbcObjIoSlot dbcObjFPin dbcObjAPindbcObjNetRectIntf dbcObjPowerSink dbcObjClock dbcObjPinWire dbcObjCloneListdbcObjRectList dbcObjVia dbcObjViaRuleLayer dbcObjViaRuleCut dbcObjViaRule dbcObjSpacingdbcObjLayerRule dbcObjExtRule dbcObjForeign dbcObjAntennaAttr dbcObjTabledbcObjLinearTable dbcObjViaCell dbcObjVNet dbcObjVTerm dbcObjVInst dbcObjVCelldbcObjVFterm dbcObjAntModel dbcObjPowerDomain dbcObjIter dbcObjLefFPin dbcObjLayerBox
Test the object type using constant, for example if { $obj_type == "dbcObjInst" } {}
Testing can also be done with the db access commands of the form dbIs* and dbSetIs*.
-
25 CADENCE CONFIDENTIAL
4.2 Testing ObjectsExample:
proc userQuery {} {set s [dbHeadSelList]if { $s } {
set objPtr [dbSelPtr $s]set obj_type [dbObjType $objPtr]if { $obj_type == "dbcObjInst" } {
set objName [dbObjName $objPtr]set leafCell [dbInstCellName $objPtr]set cellPtr [dbInstCell $objPtr]set orient [dbInstOrient $objPtr]if { [dbIsInstPlaced $objPtr] == 1 } {
set placeStatus "Placed"} else { set placeStatus "Not Placed" }if { [dbIsCellBlock $cellPtr] == 1 } {
set cellType "Hard Block"} elseif { [dbIsCellStdCell $cellPtr] == 1 } {
set cellType "Std Cell"} elseif { [dbIsCellIo $cellPtr] == 1 } {
set cellType "I/O Cell"} else { set cellType [dbCellType $cellPtr] }
} elseif { $obj_type == "dbcObjWire" } {set wirePtr [dbWireNet $objPtr] set wireName [dbNetName $wirePtr]set netPtr [dbWireNet $objPtr]
-
CADENCE CONFIDENTIALCADENCE CONFIDENTIAL
Encounter TclDatabase Access Commands
5.0 Retrieving Database Objects
-
27 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-1 Head -- Pointer to the Fast-Track database currently opened
Head itself dbgHeadHiLite dbForEachHeadHilite [dbgHead] hilitePtr {}Selected dbForEachHeadSel [dbgHead] selPtr {}Numbers of things dbHeadNrSel (number of selected objects)
Example:
proc rptSelectedObjs {} {dbForEachHeadSel [dbgHead] selPtr {
set objPtr [dbSelPtr $selPtr]set obj_type [dbObjType $objPtr] set obj_name [dbObjName $objPtr]puts $obj_name of type $obj_type is selected
}}
-
28 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-2 Fplan -- Floorplan Information
Cell Floor Plan dbCellFPlan [dbgTopCell]Standard Row dbForEachFPlanDefRow $fplanPtr stdRowPtr {}Obstruct dbForEachFPlanObstruct [dbCellFPlan [dbgTopCell]] obsPtr { }Layer Blockages dbForEachFPlanLayerBlk $fplanPtr layerBlkPt {}Groups dbForEachFPlanCellGroup $fplanPtr cellGroupPtr {}Partitions dbForEachCellPtn $fplanPtr ptnPtr {}
Feeds/Pin Blockages/Cuts dbForEachFPlanPtnFeed/PtnPinBlk/PtnCutConstraint(Region/Fence/Guide) dbForEachFPlanConstraint [dbCellFPlan [dbgTopCell]] constPtr {}Density Screens dbForEachFPlanScreen $fplanPtr screenPtr {}Global Net Connections dbForEachFPlanGlobalNetConnection
Example 1:proc rptPtnNames {} {
puts The following are partitions in this design:dbForEachCellPtn [dbHeadFPlan] ptnPtr{
set name [dbPtnName $ptnPtr]puts $name
}}
-
29 CADENCE CONFIDENTIAL
Retrieving Database Objects5-2 Fplan Old Floorplan Information (pre 4.1) Routing Blockage (LayerBlk)
Multiple layer in a layer blockage One box
Placement Blockage (Obstruct) One box
Area Density (Screen) Capacity (0 to 16) One box
GUI and FloorPlan file merge Obstruct and Screen into placement blockage
-
30 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-2 Fplan -- Floorplan Information (starting in 4.1) Floor Plan Objects
BLOCKAGE LAYER PLACEMENT
Hard (Obstruct) Soft (Screen with capacity 0) Partial (Screen with capacity > 0)
No more FE rows only DEF rows Only one set of track data.
-
31 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-2 FPlan
Example 2:
proc userGroupGateCount {grpName} { set grpPntr [ dbGetGroupByName $grpName ]set grpHierInstPntr [ dbGroupHInstList [ dbGetGroupByNamegroup1 ] ]set cc 0dbForEachGroupHInst $grpPntr instPntr {
set cc [ expr $cc+1 ]}puts " number of gates in $grpName is : $cc "
}
-
32 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-2 FPlanExample 3:proc userCheckForFenceOverlap { } {
dbForEachFPlanConstraint [dbHeadFPlan] constraintPtr {set constraintType [dbConstraintType $constraintPtr]
if { $constraintType == "dbcFence" } {set hinstName1 [dbHInstName [dbConstraintHInst $constraintPtr]]set box1 [dbConstraintBox $constraintPtr]
dbForEachFPlanConstraint [dbHeadFPlan] constraintPtr2 {set hinstName2 [dbHInstName [dbConstraintHInst $constraintPtr2]]if { $constraintType == "dbcFence" } {
set box2 [dbConstraintBox $constraintPtr2]set yes [dbIsBoxOverlappingOrTouchingBox $box1 $box2]if { $yes == 1 } {
if { $hinstName1 != $hinstName2 } {puts "The fences overlap for modules $hinstName1 $hinstName2"
}}}}}}}
-
33 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-2 FPlan
Example 4:
#################################################################### userRptPinGuides reports the name and pins of pin guides#####################################################################proc userRptPinGuides { } {
# Usage: dbForEachNetGroupNet # Usage: dbRouteGuideNetGroup # Usage: dbRouteGuideBoxList # Usage: dbFPlanRouteGuideList
set routeGuidePtr [dbFPlanRouteGuideList [dbCellFPlan [dbgTopCell] ] ]while {"$routeGuidePtr" != "0x0"} {Puts "RoutingGroup: [dbObjName $routeGuidePtr ]"set netGroupPtr [dbRouteGuideNetGroup $routeGuidePtr]dbForEachNetGroupNet $netGroupPtr netPtr {Puts " [dbObjName $netPtr]"
}Puts " "set routeGuidePtr [dbRouteGuideNext $routeGuidePtr]
}
}
-
34 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
35 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-3 Cell Cell master in current database
Top Level Cell dbgTopCellHeadCell dbForEachHeadCell [dbgHead] cell {}Cell dbGetCellByName
Example 1:proc doesCellExist { cell } {dbForEachHeadCell [dbgHead] cellPtr {
if { $cell == [dbCellName $cellPtr] } {puts The cell $cell does exist.
}} Example 2:proc userFindCellByCellName {cellNamePattern} {
set cellNameList {}dbForEachHeadCell [dbgHead] cellPtr {
if [string match $cellNamePattern [dbCellName $cellPtr]] {lappend cellNameList [dbCellName $cellPtr]
}}return $cellNameList
}
-
36 CADENCE CONFIDENTIAL
Retrieving Database Objects
5-3 Cell - Old FE Cell Geomtry Cell
FTerm FPin
Via
Via (via obs) Blk (metal layer obs)
Bits used to block whole layer LayerBlk
Blk (cut layer obs array) Cut layer pins are treated as cut layer obs
-
37 CADENCE CONFIDENTIAL
Retrieving Database Objects
5-3 Cell - LEF (starting in 4.1) Cell Geometry LEF file structure
MACRO (Cell) PIN (FTerm)
PORT (LefPort) Layer Geometry (LayerShape) RECT/POLYGON/PATH (Shape) VIA (LayerShape)
OBS (dbsLefOBS) LayerId Index of layers defined in LEF file No more contact layer use dbsViaCell
-
38 CADENCE CONFIDENTIAL
Retrieving Database Objects5-3 Cell Obstructions (starting in 4.1)
dbForEachCellLefOBSif (dbLefObsType == dbLefObsTypeVia) { /* viaobs */
dbViaCell = dbGetLefObsViaCell(obs);dbsLoc loc = dbmGetObsViaLoc(obs);
} else { /* obs on one layer, maybe metal, cut, or overlap layer */dbLayer = dbLefObsLayer(obs);dbForEachLefOBSShape(obs, shape)
/* shape access routines */}
}}
-
39 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-3 Cell Cell master in current database
Example 3:
Description: userGenJtagRegion generates "mini-regions" for JTAG cellsUsage: userGenJtagRegion padInstRootName jtagHInstRootName regWidth regDept
dbForEachCellIo [dbgTopCell] ioPtr {set ioName [dbIoName $ioPtr]if { [string match $padInstRootNamePattern $ioName] && [dbIsIoDummyPad $ioPtr] == 0 } {
set ioNameLength [string length $ioName]set ioSuffix [string range $ioName $padInstRootNameLength $ioNameLength]set jtagHInstNameList [concat $jtagHInstRootName $ioSuffix]set jtagHInstName [join $jtagHInstNameList ""]
dbForEachHInstTreeHInst [dbGetHInstByName $hierInst] hinstPtr {set hinstName [dbHInstName $hinstPtr]if { [string match $jtagHInstName $hinstName] } {
createRegion $hinstName $region_llx $region_lly $region_urx $region_ury"specifyJtag -inst $hinstName
-
40 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
41 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-4 Inst Cell instance
CellInst dbForEachCellInst [dbgTopCell] inst {}InstByName dbGetInstByName $instName
Eample:proc userSelectInsts { matchName } {
Puts "\n\n\nInfo: Checking for instance names pattern matching $matchName...\n"set cnt_inst 0dbForEachCellInst [dbgTopCell] instPtr {
set instName [dbInstName $instPtr]if [string match $matchName $instName] {
incr cnt_instPuts "\tInstance: $instName"selectInst $instName
}}Puts "\nInfo: Selected $cnt_inst instance(s)\n".s redraw
}
-
42 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
43 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-5 Hinst Hierarchical instance = Verilog module
HInstByName dbGetHInstByName $hinstPtrHInstTreeHInst dbForEachHInstTreeHInst $hinstPtr instPtr {}InstHInst dbInstHInst $hinstPtrParent dbHInstParent $hinstPtrCell dbCellHInst $cellPtr
Example:
proc rptNamesOfSelectedModules { } {dbForEachHeadSelPtr [dbgHead] objPtr {
set objName [dbObjName $objPtr]set obj_type [dbObjType $objPtr]if { $obj_type == "dbcObjHInst" } {
set hierCell [dbHInstCellName $objPtr]puts Module $hierCell is selected
}}
}
-
44 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-5 Hinst Hierarchical instance = Verilog module
Example 2:dbForEachCellPtn [dbgTopCell] ptnPtr {
set ptnName [dbPtnName $ptnPtr]set ptnCellPtr [dbPtnCell $ptnPtr]set name [dbCellName $ptnCellPtr]dbForEachHInstTreeHInst [dbCellHInst [dbgTopCell]] hinstPtr {
if [dbIsHInstHInst $hinstPtr] {set hinstName [dbHInstName $hinstPtr]set cellName [dbHInstCellName $hinstPtr]if { $name == $cellName } {
-
45 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell 38)Hinst->Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
46 CADENCE CONFIDENTIAL
1. Get database object(s)1-6 Hterm Hierarchical instance terminal on Verilog module
HInstHTerm dbForEachHInstHTerm $hinstPtr htermPtr {}
Example:
proc userRptHInst { hinstPtr } {dbForEachHInstHTerm $hinstPtr htermPtr {
set hinstName [dbHInstName $hinstId]set netId [dbHTermNet $htermPtr]set netName [dbNetName $netId]set netNrTerm [dbNetNrTerm $netId]puts $fp "HPIN : $hinstName/$ftermName"puts $fp "NET : $netName"puts $fp "TERMS : $netNrTerm"
}}
Behavior of dbForEachHInstHTermhad been changed from v3.2 to 3.3.
For 3.2, dbForEachHInstHTermreturned only HTerm with net connected.
On 3.3, dbForEachHInstHTermruturns all HTerm and [dbHTermNet$HTerm] returns "0x0" as net pointer for HTerm which doesn't have any net connection. Thus, one should test whether the net is not 0x0 before using the pointer.
-
47 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
48 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-7 HTermExample 2:proc userRptFloatingPortsOnModules {} {set delimiter [dbgHierChar]set list_hinsts {}dbForEachCellNet [dbgTopCelll] netPtr { # get all nets in top cell
set netName [dbNetName $netPtr]dbForEachNetTerm $netPtr termPtr { # get all terminals on net
if { ![dbIsTermFTerm $termPtr]} { # don't care about IO, just connections to instances set termInstName [dbTermInstName $termPtr]set inst_hier1 [lindex [split $termInstName $delimiter] 0] # get module instance is inset length [llength $list_hinsts] # add module to the list if it's not already in the listset flag 0for { set i 0 } { $i < $length } {incr i } {
if { $inst_hier1 == [lindex $list_hinsts $i] } {set flag 1
}}if { $flag == 0 } {set hinstName [dbHInstCellName [dbGetHInstByName $inst_hier1]]lappend list_hinsts $hinstName
}
}}
-
49 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-7 HTermExample 2 (Continued):# now go through all verilog connections and see
dbForEachHInstHInst [dbCellHInst [dbgTopCell]] hinstPtr {set hinstName [dbHInstCellName $hinstPtr]if [dbIsHInstHInst $hinstPtr] {
dbForEachHInstHTerm $hinstPtr HTermPtr {set ftermPtr [dbHTermFTerm $HTermPtr $hinstPtr]set ftermName [dbFTermName $ftermPtr]set netPtr [dbHTermNet $HTermPtr]set netName2 [dbNetName $netPtr]if { $netName == $netName2 } {
# see if hinst is list; if not, it's not connected inside hinstif { [lsearch -exact $list_hinsts $hinstName] } {puts "The term $ftermName is not connected to any instances is the module $hinstName"
}}
}}}set list_hinsts {}
}}
-
50 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
51 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-7 Term Instance terminal
InstTerm dbForEachInstTerm $instPtr termPtr {}InstInputTerm dbForEachInstInputTerm $instPtr termPtr {}InstOutputTerm dbForEachInstOutputTerm $instPtr termPtr {}TermByName dbGetTermByName $startInst $startTerm
Example:proc scanTracePath { startTermPoint } { "\n\n\nInfo: Tracing scan chain starting at $startTermPoint...\n" set delimiter [dbgHierChar]set hier_list [split $startTermPoint $delimiter]set cnt 0foreach i $hier_list {incr cnt
} Note: Partial code listingset startTermIndex [expr $cnt - 1]set startTerm [lindex $hier_list $startTermIndex]set inst_list ""set cnt 0foreach i $hier_list {incr cntif { $cnt
-
52 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
53 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-8 FTerm Formal Terminal on master cell
CellFTerm dbForEachCellFTerm $cellPtr ftermPtr InputFterm dbForEachCellInputFTerm [dbgTopCell] {}OutputFTerm dbForEachCellOutputFTerm [dbgTopCell] {}FTermByName dbGetFTermByName $startCellPtr $startTermFTermNet dbFTermNet $startFTermPtrHTermFTerm dbHTermFTerm $ftermPtr
Example 1:proc userFixPins {} {
dbForEachCellInputFTerm [dbgTopCell] ftermpointer {dbSetIsFTermPreassigned $ftermpointer 1
}dbForEachCellOutputFTerm [dbgTopCell] ftermpointer {dbSetIsFTermPreassigned $ftermpointer 1
}}
-
54 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-8 FTerm Cell Pin Geometry Traverse (starting in 4.1)dbForEachFTermLefPort
dbForEachLefPortLayerShapedbForEachShapeListShape
/* shape access routines */}
}}
-
55 CADENCE CONFIDENTIAL
6. Retrieving Object Properties6-12 FTermExample 2:proc userRptTermDirs { netName } {
dbForEachNetTerm [dbGetNetByName $netName] termPtr {if { [dbIsObjTerm $termPtr] == 1 } {
set instName [dbTermInstName $termPtr]puts "Instance $instName has a port as follows"set termName [dbTermName $termPtr]if {[dbIsTermInput $termPtr]} {
puts " $termName with a direction of input"} elseif { [dbIsTermOutput $termPtr] } {
puts " $termName with a direction of output"} elseif { [dbIsTermBidi $termPtr] } {
puts " $termName with a direciton of bidir"} else {
puts " $termName has an unknown direction"}
} elseif { [dbIsFTermFTerm $termPtr] == 1 } {puts "The top cell has a port as follows:"set ftermPtr $termPtrset termName [dbFTermName $ftermPtr]if {[dbIsFTermInput $termPtr]} {
puts " $termName with a direction of input"} elseif { [dbIsFTermOutput $termPtr] } {
puts " $termName with a direction of output"} elseif { [dbIsFTermBidi $termPtr] } {
puts " $termName with a direciton of bidir"} else {
puts " $termName has an unknown direction"}
-
56 CADENCE CONFIDENTIAL
6. Retrieving Object Properties6-12 FTermExample 3:proc userRptAllPGPins { pat output {output1 "userRptPin.rpt"}} {dbForEachCellInst [dbgTopCell] instPtr {
set cellPtr [dbInstCell $instPtr]set instName [dbInstName $instPtr]set name [dbCellName $cellPtr]
if {[string match $pat $name]} {puts "Processing cell $name..."dbForAllCellPGFTerm $cellPtr ftermPtr {set ftname [dbFTermName $ftermPtr]set side [dbFTermSide $ftermPtr]set width [dbFTermWidth $ftermPtr]set depth [dbFTermDepth $ftermPtr]dbForEachFTermLefPort $ftermPtr portPtr {dbForEachLefPortLayerShape $portPtr lsPtr {
set testlen [string length [dbLayerShapeLayer $lsPtr]]if {$testlen == 9} {set trunkLayerName [dbLayerName [dbLayerShapeLayer $lsPtr]]set layer [dbLayerWireId $trunkLayerName]if { [dbIsLayerShapeShapeList $lsPtr] == 1 } {dbForEachLayerShapeShape $lsPtr shapePtr {set box [dbShapeRect $shapePtr]set bllx [dbBoxLLX $box]set blly [dbBoxLLY $box]set burx [dbBoxURX $box]set bury [dbBoxURY $box]
-
57 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
58 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-8 FTerm Formal Terminal on master cell
Example 4:proc userSetIONetWeight { } {
dbForEachCellInputFTerm [dbgTopCell] ioPtr { set ioNetPtr [dbTermNet $ioPtr] set ioNetName [dbNetName $ioNetPtr] puts "Setting weight on INPUT net: $ioNetName" specifyNetWeight $ioNetName 10
} dbForEachCellOutputFTerm [dbgTopCell] ioPtr {
set ioNetPtr [dbTermNet $ioPtr] set ioNetName [dbNetName $ioNetPtr] puts "Setting weight on OUTPUT net: $ioNetName" specifyNetWeight $ioNetName 5
} }
-
59 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-8 FTerm Formal Terminal on master cell
Example 5:proc userFindInstsByFterm { fterm fileName } {
set f [open $fileName w]set cellPtr [dbgTopCell]dbForEachCellInst $cellPtr instPtr {
set instName [dbInstName $instPtr]#puts $instNamedbForEachInstTerm $instPtr termPtr {
set xxxnetPtr [dbTermNet $termPtr]if { $xxxnetPtr != 0x0 } {
set ftermName [dbTermName $termPtr]if { $ftermName == $fterm } {
puts $f "$instName"}
}}
close $f}
-
60 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)HTerm->Net 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin 37) Head->Tile Cell
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
61 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-9 NetCellNet dbForEachCellNet [dbgTopCell] netPtr {} / dbForAllCellNet $cellPtr $netPtr {}P/G Nets dbGetSNetByName $nameTermNetFTermNet/HTermNet dbTermNet $termPtrNetTerm dbForEachNetTerm $netPtr termPtr {}NetOutputTerm dbForEachNetOutputTerm $netPtr termPtr {}NetInputTerm dbForEachNetInputTerm $netPtr termPtr {}NetByName dbGetNetByName $netNameWireNet dbWireNet $objPtrHInstTreeNet dbForEachHInstTreeNet
-
62 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-9 Net
Example 1:proc userRptMultiDriverNets { {maxDriver {}} } {
if { $maxDriver == "" } {set maxDriver 2}
set designName [dbgDesignName]dbForEachCellNet [dbgTopCell] netPtr {
set net [dbNetName $netPtr]set cnt 0dbForEachNetOutputTerm $netPtr outputTermPtr {incr cnt
}if {$cnt >= $maxDriver } {puts "Net: $net Drivers: $cnt
}}}
-
63 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
q dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)Head->TileCell 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
64 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-9 Net
Find and report all nets connecting to specified instance
Example 2:proc userFindNetsByInst { instName } {
set instPtr [dbGetInstByName $instName]set cellName [dbInstCellName $instPtr]Puts "Instance: $instName ($cellName)"
dbForEachInstTerm $instPtr termPtr {set termName [dbTermName $termPtr]set netPtr [dbTermNet $termPtr]
if { $netPtr != 0x0 } {set netName [dbNetName $netPtr]Puts "Term: $termName ($netName)"
}}
}
-
65 CADENCE CONFIDENTIAL
Head
Partition TimeLib
OpCond
Cell DPath
Term
HInst
Fterm
Net
StripBox
HTerm
dbgHead
dbForEachHeadPtn LayerHeadTimeLibdbForEachHeadDPath
dbForEachTimingLibOpCond
dbForEachC
ellIo
dbForEachCellInst
dbForEachInstTerm
dbForEachHeadCell
d
b
T
e
r
m
I
n
s
t
dbTerm
Net
d
b
F
o
r
E
a
c
h
N
e
t
T
e
r
m
q dbForEachNetWiredbWireNet
dbIns
tCell
dbIoC
elldbConstraintHInstdbHInstConstraint
d
b
F
o
r
E
a
c
h
C
e
l
l
F
T
e
r
m
dbFTermNet
dbForEachHInstHTermdbHTermFTerm
dbForEachHInstTreeInst
dbForE
achHIn
stTreeN
et
dbHInstParent
dbForEachCellNet
dbForEachHInstTreeHInst
4.2 Encounter Tcl/Tk Database Access07/01/05 P. Eichenseer
Notes: There are a few db objects (or object relationships not depicted). Some of them are 1)Cell->StorInst2)Cell->PhyFterm 3)Cell->VInst 4)Cell->VNet5)VInst->VTerm 6)VNet->VTerm 7)FPlan->PowerDom8)FPlan->AIORowCluster 9)FPlan->Strip 10)Strip->Box11)PowerDomain->Pad 12)Nets->netGroup 13)FPlan->netGroup 14)FPlan->PinGroup 15)Pin->GroupPin
16)Head->ObjProp 17)Head->TileCell 18)Head->TileInst19)ExtRule->LayerRule 20)Cell->TimeArc21)AreaECOScreen->Screen 22)Row->Cluster Row23) TileCell->TilePin 24) Head->BumpCell 25)Head-> CustomLayer 26)Head->TechSite 27)Head->Site 28)GeomList->GeomBox 29)GeomList->Geom30)GeomList->Path 31)GeomList->Poly 32)Head->ExtRule 33)Head->FELayer 34)Head->LEFLayer35)Head->PropType 36)TileCell->TilePin
Clone
PathdbForEachPtnCloneList
dbForEachGroupHInst
Layer
SNet
LefObs
DPinst
ClockPath
Bump
GeomList
ConstraintBox
TimeArc
DPHinst
d
b
F
o
r
E
a
c
h
P
a
t
h
T
e
r
m
dbCellFT
erm
SelectPtrHilitePtr
Cadence Company Confidential
dbTermFtermdbFtermTerm
dbFTermHTerm
IO Inst
Placement Blkg.
Constraint(Guide/Fence)
ptnPinBlk
Routing Blkg.
ptnCutdbForEachFPlanPtnCut
dbForEachFPlanObstruct
dbForEachFPlanConstraint
dbForEachFPlanLayerBlk
dbForEachFPlanPtnPinBlk
Group
ptnFeed
CellPad
Standard Row
densityScreendbForEachFPlanScreen
dbForEachFPlanGroup
dbForEachFPlanCellPad
dbForEachFPlanPtnFeed
dbForEachFPlanDefRow
FPlan Rule Clocks
BlackBox Halo
dbHeadFPlandbCellFPlan
HeadRule
dbForEachHeadCell
dbCellPadCell
dbSNetNet
dbForEachCell Wire
dbForEachSNetStripBox
dbInstHierHinst
Route GuidesdbForEachFPlanRouteGuide
GeomListdbForEachFPlanGeomList
GlobalNetConnectiondbForEachFPlanGlobalNetConnection
LefPort
dbForEachFTermLefPort
layerShape
Shape
Most of the cellrelationships shown in thisdiagram are forthe top cell only;std cells use FtermTimeLib, LefObsGeomList under FPlan is for user created, while under cell is for GDS
-
66 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-9 Net
Issue: We are meeting timing except for these mutli-fanin nets connected to output pins coming from the IO pad cells to core flip flop registers. Is there a way to force optDesign to buffer these and fix the max tran violations automagically.
Example 3:set bidirNets [userGetAllBidirNets]foreach netName $bidirNets {
specifyNetWeight $netName 10}
set netNameList [userGetViolMultiFaninNets]if { $netNameList != {} } {
foreach net $netNameList {bufferMultiDriverNet -cell bfx6 -net $net
}refinePlacetrialroute -highEffort -maxRouteLayer 6extractrcbuildTimingGraphreportTranViolation -outfile vmips_display_tran2b.rptoptDesign
-
67 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-9 Net
Issue: From a slack file I can extract a list of timing critical std-cells and nets. How can I feed this list into amoebaPlace (or placeDesign) ??
Example 4:markCriticalNets -slackLessThan -0.3
dbForEachCellNet [dbHeadTopCell] net {if {[dbIsNetCritical $net]} {specifyNetWeight [dbNetName $net] 10
}}
You could later check which nets are marked other than default (2 isdefault) with something like this:
dbForEachCellNet [dbHeadTopCell] net {if {[dbNetUserWt $net] > 2} {puts "[dbNetName $net] [dbNetUserWt $net]"
}}
-
68 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-9 Net
Issue: Tracing logic connectivity
Example 5:set TermInstPtr [dbTermInst $termPtr]set termInst [dbTermInstName $termPtr]
dbForEachInstOutputTerm $termInst termPtr {set FTermPtr [dbTermFTerm $termPtr]set nextNetPtr [dbTermNet $termPtr]set nextNetName [dbNetName $nextNetPtr]set TermInstPtr [dbTermInst $termPtr]set termInst [dbTermInstName $termPtr]set termName [dbTermName $termPtr]
dbForEachNetTerm $nextNetPtr termPtr {set FTermPtr [dbTermFTerm $termPtr]set flag_input [dbIsTermInput $termPtr]
-
69 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-9 Net - Reporting a net delay# Usage: userRptNetDelay proc userRptNetDelay { netName } {
set netPtr [dbGetNetByName $netName]if { $netPtr != 0x0 } {
dbForEachNetOutputTerm $netPtr otermPtr {if { [dbIsObjTerm $otermPtr] == 1 } {
set source_inst [dbTermInstName $otermPtr]set sport [dbTermName $otermPtr]dbForEachNetInputTerm $netPtr itermPtr {
if { [dbIsObjTerm $itermPtr] == 1 } {set dest_inst [dbTermInstName $itermPtr]set dport [dbTermName $itermPtr]reportP2PCritPath -fromPin $source_inst/$sport -toPin $dest_inst/$dport
} elseif { [dbIsFTermFTerm $itermPtr] == 1 } {set iftermPtr $itermPtrset oPort [dbFTermName $iftermPtr]reportP2PCritPath -fromPin $source_inst/$sport -toPort $oPort
}}} elseif { [dbIsFTermFTerm $otermPtr] == 1 } {
set ftermPtr $otermPtrset iPort [dbFTermName $oftermPtr]dbForEachNetInputTerm $netPtr itermPtr {
if { [dbIsObjTerm $itermPtr] == 1 } {set dest_inst [dbTermInstName $itermPtr]set dport [dbTermName $itermPtr]reportP2PCritPath -fromPort $iPort -toPin $dest_inst/$dport
} elseif { [dbIsFTermFTerm $itermPtr] == 1 } {set iftermPtr $itermPtrset oPort [dbFTermName $iftermPtr]reportP2PCritPath -fromPort $iPort -toPort $oPort
}}}}}}}}}}}}
-
70 CADENCE CONFIDENTIAL
Retrieving Database Objects
5-9 Net - Special
Special Net (SNet or Strip) Always has a net Space holder
Special Wire (dbStripBox) dbsStripBox* dbSprNewPolygon(dbsNet*, dbsPoly*, Int z); dbsStripBox* dbSprNewRect(dbsNet*, dbsBox*, Int z); dbsStripBox* dbSprNewWireWithShapeAndStyle(dbsNet*, dbsLoc
*pt1, dbsLoc *pt2, Int z, dbsSprShape shape, Int style); Int dbSprQueryWireWithStyle(dbsStripBox*, dbsLoc *pt1, dbsLoc
*pt2, Int *style, dbsCoord *width);
-
71 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-9 Net - Special Net Traverse
- To traverse special net wiresdbForEachSNetBox
/* wire access routines */- To traverse special net vias
dbForEachSNetBoxV/* via access routines */
-
72 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-10 Wire wire geometry
NetWire dbForEachNetWire $netPtr segmentPtr {}WireNet dbWireNet $wirePtrWireInfo dbWireInfo $wirePtr
Example 1:proc rptSelectedTotalWireLength {} {
set s [dbHeadSelList]set objPtr [dbSelPtr $s]
set netPtr [dbWireNet $objPtr]set netName [dbNetName $netPtr]dbForEachNetWire $netPtr segmentPtr {
set segLength [dbWireLen $segmentPtr]set wireLength [expr $wireLength+$segLength]
}puts Wire $netName has a length of: [expr $wireLength*[dbHeadMicronPerDBU]] um"
}
-
73 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-10 Wire wire geometry
Example 2 (wire boxes):
dbForEachCellNet [dbgTopCell] netPtr {set net [dbNetName $netPtr]puts $fid "NET - $net"dbForEachNetWire [dbGetNetByName $net] wirePtr {
set wireBox [dbWireBox $wirePtr]set wireInfo [dbWireLocWithZ $wirePtr]puts $fid "$wireInfo $wireBox"
-
74 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-11 Vias
ViaName dbGetViaCellByName $viaCellPtrViaInfo dbInfoVia $viaCellPtr
Examples:
proc printOneVia {viaName} { set viaCellPtr [dbGetViaCellByName $viaName] set loc [dbViaLoc $viaPtr] set name [dbViaCellName $viaCellPtr] puts " via: $name $loc"
}set cutbox [dbViaCellCutBox [dbGetViaCellByName VIA23]]set x1 [lindex $cutbox 0]set y1 [lindex $cutbox 1]set x2 [lindex $cutbox 2]set y2 [lindex $cutbox 3]set width [expr [$x2 - $x1]set height [expr [$y2 - $y1]]
-
75 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-12 TechnologyTiming Lib dbForEachHeadTimeLib [dbgHead] tlibPtr {}Timing Library Name dbTimeLibName timeLibPtrTiming Library OpCond dbForEachTimeLibOpCond $tlib opcondLayer dbForEachHeadLayer [dbgHead] layer {}/dbGetLayerByNameRule dbHeadRule [dbgHead]ExtendedRule dbHeadExtRuleList [dbgHead]Clocks dbForEachHeadClock [dbgHead]TechSite dbTechSiteName
The dbLayer* commands access layer rules. The dbLayerRule* and dbLayerExtededRule* are for non-default rules
-
76 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-12 Technology
Example 1:proc rptTimeLibs {} {
dbForEachHeadTimeLib [dbgHead] tlibPtr {set name [ dbTimeLibName tlibPtr]
puts Timing library name = $name}
Output:Timing library name = t25lib_tt
Example 2:getClockprocdbForEachHeadClock [dbgHead] clockPtr {
if {[string match [dbClockName $clockPtr] "my_clock_name"]} {puts "[dbClockName $clockPtr] [dbClockRate $clockPtr]"
}}
Example 3:####################################### userGetClockRoot gets the clock roots of all clocks#####################################proc userGetClockRoot {} {
getClockdbForEachHeadClock [dbgHead] clockptr {
set clockName [dbClockName $clockptr]}
}
-
77 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-12 TechnologyExample 4:set layer_list [list M1 M2 M3 M4 M5 M6 M7]
foreach layerName $layer_list {Puts "Layer \"$layerName\":"set layerPtr [dbGetLayerByName $layerName]Puts " isHorizontal : [dbIsLayerH $layerPtr]"Puts " isVertical : [dbIsLayerV $layerPtr]"Puts " minWidth : [expr [dbLayerMinWidth $layerPtr] * [dbgMicronPerDBU]]"Puts " maxWidth : [expr [dbLayerMaxWidth $layerPtr] * [dbgMicronPerDBU]]"Puts " minSpace : [expr [dbLayerMinSpace $layerPtr] * [dbgMicronPerDBU]]"Puts " pitch : [expr [dbLayerWirePitch $layerPtr] * [dbgMicronPerDBU]]"Puts " offset : [expr [dbLayerOffset $layerPtr] * [dbgMicronPerDBU]]"
}
-
78 CADENCE CONFIDENTIAL
5. Retrieving Database Objects
5-12 TechnologyExample 5:encounter 5> dbHeadNrExtRule [dbgHead]10encounter 6> dbExtRuleName [dbHeadExtRuleList [dbgHead]]WMRULE1P5_1encounter 7> dbForEachExtRuleLayerRuleList [dbHeadExtRuleList [dbgHead]] layerRulePtr
{ puts "[dbLayerRuleMinSpacing $layerRulePtr]"}460560920
There are 10 extended rules. The first non-default rule is named WMRULE1P5_1. The minimum spacings for WMRULE1P5_1 are .46, .56 and .92.
-
79 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-13 PowerDomainsPower Domains dbForEachPowerDomain [dbgHead] powerDomainPtr {}Pads dbForEachPowerDomainPad $powerDomainPtr instPtr {}Groups dbGroupPowerDomain $groupPtrGround Nets dbPowerDomainGNet powerDomainPtrPower Nets dbPowerDomainPNet powerDomainPtr
Example1:dbForEachPowerDomain [dbgHead] powerDomainPtr {set powerNetName [dbPowerDomainPNet $powerDomain]puts Power net = $powerNetName
}
Output:VDD1
Example2:proc userRptPowerDomainBoxes { } {dbForEachFPlanGroup [dbHeadFPlan] group {if {[dbIsGroupPowerDomain $group]} {puts "[dbGroupBox $group]"
}}
}
-
80 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-14 Properties
Name dbGetOrCreatePropByName $obj nameProperties dbForEachObjProp / dbGetOrCreatePropByNameRegister type dbRegisterProptType $propName $propDescription $propDataType
Example:proc user_inst_props {} {
dbRegisterPropType CORE_ROW Core Route TOP, BOTTOM, etc" strdbRegisterPropType CORE_SOURCE Core Route CORE or PERIPHERY" strdbForEachCellInst [dbgTopCell] instPtr {
if { [dbIsInstPlaced $instPtr] == 1 } {set rowPtr [ dbGetOrCreatePropByName $inst CORE_ROW ]set srcPtr [ dbGetOrCreatePropByName $inst CORE_SOURCE ]dbSetPropValue $rowPtr "TOP" dbSetPropValue $srcPtr "CORE" set iName [dbInstName $inst] set cName [dbInstCellName $inst] puts [format " instPtr = %-s instName = %-s cellName = %-s" $inst $iName $cName ]
}}}
-
81 CADENCE CONFIDENTIAL
5. Retrieving Database Objects5-15 Misc
BlackboxesBumpsBumpCellsBusBitsCloneDPathsFootPrintFPinsGDSCell/Inst/Layer/Lib/Path/Poly/TextGeomBox/Line/Path/Poly/TextNetGroupsPathPinGroupRouteGuidesRowClusterRulerStripsIOsHalos
-
CADENCE CONFIDENTIALCADENCE CONFIDENTIAL
Encounter TclDatabase Access Commands
6.0 Retrieving Object Properties
-
83 CADENCE CONFIDENTIAL
6. Retrieving Object Properties
6-2 FPlanAspect ratio dbHeadAspectRatio [dbgHead]Size of the design dbHeadBox [dbgHead]Size of the core area dbHeadCoreBox [dbgHead]FPlanBox dbFPlanBoxCoreBox dbFPlanCoreBoxSize of the IO area dbHeadIoBox [dbgHead]
Standard Row dbRowBoxdbFPlanNrRowdbRowOrientdbRowTechSitedbStdCellHgt
Site dbSiteName/dbForEachHeadSitedbSiteSizeXdbSiteSizeYdbStdRowSitedbRowSite
-
84 CADENCE CONFIDENTIAL
6. Retrieving Object Properties
6-2 FPlan (continued)ConstraintType dbConstraintType(dbcGuide/dbcFence/dbcRegion)
dbConstraintBox
LayerBlockage dbLayerBlkType(dbcPtnCutLayerBlock, dbcRouteGuideLayerBlk, dbcUserLayerBlock)dbLayerBlkCutLayerdbLayerBlkLayer
Obsructions dbObstructType (dbcUserObstruct, dbcBlockObstruct, dbcDynamicObstruct, dbcPtnCutObstruct)dbObstructBox
Partitions dbPtnBoxdbPtnCoreToLeft/Right/Bottom/TopdbPtnCutdbPtnFeedBoxdbPtnFeedLayerdbPtnLayerBlockeddbPtnMinPinSpacedbPtnPinSpaceOnSide
Screen dbScreenBoxdbScreenCapacity
Partition:
-
85 CADENCE CONFIDENTIAL
6. Retrieving Object Properties6-2 FPlan (continued)
Example:proc prePlaceCloneInsts {} {dbForEachCellPtn [dbgTopCell] ptnPtr {
dbForEachPtnCloneList $ptnPtr clonePtr {set obj [dbCloneListInst $clonePtr]set cloneName [dbObjName $obj]puts "Processing clone = $cloneName"
# Get fence box of corresponding cloneset constraintPtr [dbHInstConstraint $obj]set constraintBox [dbConstraintBox $constraintPtr]set x1 [expr [lindex $constraintBox 0]*[dbHeadMicronPerDBU]]set y1 [expr [lindex $constraintBox 1]*[dbHeadMicronPerDBU]]set x2 [expr [lindex $constraintBox 2]*[dbHeadMicronPerDBU]]set y2 [expr [lindex $constraintBox 3]*[dbHeadMicronPerDBU]]set x [expr $x1 + [expr [expr $x2 - $x1] / 2 ]]set y [expr $y1 + [expr [expr $y2 - $y1] / 2 ]]
# Place all clone cells in the middle of the fence# and mark as preplaceddbForEachCellInst [dbgTopCell] instPtr {
set instName [dbInstName $instPtr]if [string match $cloneName* $instName] {
placeInstance $instName $x $ydbSetIsInstPreplaced $instPtr 1
}}}}}
-
86 CADENCE CONFIDENTIAL
6. Retrieving Object Properties6-3 Cell
CellName dbCellName $cellNrInst dbCellNrInstNrBlock dbCellNrBlockNrRef dbCellNrRefNrRow dbCellNrRowNrFTerm dbCellNrFTermNrBidi dbCellNrNrBidiNrInput dbCellNrInputNrOutput dbCellNrOutputNrInst dbCellNrInstCellType dbCellType $cellOrigin dbCellOriginDimensions dbCellDim
Example:proc userFindInstsByCellName { cellName } {
set designName [dbgDesignName]Puts "\nInfo: Searching for number of instances with $cellName cell master in $designName...\n"set cnt 0
set cellPtr [dbgTopCell]dbForEachCellInst $cellPtr instPtr {
set instName [dbInstName $instPtr]set leafCell [dbInstCellName $instPtr]if { $leafCell == $cellName } {
incr cnt
}}Puts "\nInfo: Found $cnt instances with $cellName cell master\n"
}
-
87 CADENCE CONFIDENTIAL
6. Retrieving Object Properties
6-4 InstInstName dbInstName $cellInstCellName dbInstCellName $instPtrInstBox dbInstBox $instPtrInstBoxDimX dbBoxDimX [dbInstBox $inst]]InstBoxDimY dbBoxDimY [dbInstBox $inst]]InstOrient dbInstOrient $objPtrInstLoc dbInstLoc $objNameNrBidi Pins dbInstNrBidiNrOutput Pins dbNrOutputNrInput Pins dbInstNrInputHasObstruct dbInstHasObstruct
-
88 CADENCE CONFIDENTIAL
6. Retrieving Object Properties6-4 Inst Example 1###########################################################################
# userRptSelectInstancesInBox reports all selected instances in a given box################################################################################
proc userRptSelectInstancesInBox {llx lly urx ury} { set outfileName [dbgDesignName].outputs "Searching in box $llx $lly $urx $ury expected input units are microns" set outfile [open $outfileName "w"] set count 0
set dbllx [dbMicronsToDBU $llx] set dblly [dbMicronsToDBU $lly] set dburx [dbMicronsToDBU $urx] set dbury [dbMicronsToDBU $ury] set dbsearchbox [list $dbllx $dblly $dburx $dbury] dbForEachCellInst [dbHeadTopCell] inst {
set instBox [dbInstBox $inst] if {[dbIsBoxOverlappingOrTouchingBox $instBox $dbsearchbox]} { if {[dbIsInstSel $inst]} { puts $outfile "[dbInstName $inst]" puts "[dbInstName $inst]" incr count
}}}close $outfileputs "Done. Selected instances found in box $llx $llx $urx $ury: $count" puts "Wrote instance names to $outfileName" }
dbIsBoxOverlappingOrTouchingBoxis a very useful function
-
89 CADENCE CONFIDENTIAL
6. Retrieving Object Properties6-4 Inst Example 2proc userSplitLoad_2PinInst { minFanOut minLoadInPf } {
set designName [dbgDesignName]set f [open $designName.sel_net w]set cntNets 0dbForEachCellNet [dbgTopCell] netPtr {
set nrTerms [dbNetNrTerm $netPtr]set nrFanOut [dbNetNrFanOut $netPtr]set nrFanIn [dbNetNrFanIn $netPtr]set netLoad [expr [dbNetCap $netPtr] * [dbgPicoFPerDBU]]dbForEachNetOutputTerm $netPtr termPtr {
set srcInst [dbTermInstName $termPtr]set leafCell [dbInstCellName $srcInst]set nrSrcInstTerms [dbTermInstName $termPtr]set srcPort [dbTermName $termPtr]
}if { $nrFanIn == 1 && $nrFanOut >= $minFanOut && $netLoad >= $minLoadInPf } {
dbForEachNetOutputTerm $netPtr termPtr {set srcInst [dbTermInstName $termPtr]set srcPort [dbTermName $termPtr]set nrSrcInstTerms [dbInstNr