I V N I V E
Dat ab as e A c c es s i n EDI w e
• Robust and eas to use db access mechanisms la a huge role in defining how productive users of design systems can be • s or ca y, ncoun er’s access as een power u and fast, but a bit cryptic and difficult to learn • In 7.1 7.1 a new new db acce accesss mec mecha hani nissm was was intr introd oduc uced ed which minimizes the need to peruse the 2000+ FE-TCL commands and condenses them into 2 commands:
2
June June 28, 28, 201 2011 1
Cade Cadenc nce e Conf Confid iden enti tial al
• Make it easy for a new user to explore a design interactively – Make it a self-documenting API • query which fields are available from any object • query fields for short description and legal enumerated values
– Query all field values of an object at one time – resent t e ata n user un ts y e au t or opt ona y n
un ts
• Make it easy to script common operations – – – –
common starting points built-in (top, head, selected) general pattern matching for every field object pointer direct from pattern match unique objects from list with repeated objects
Approach • Use a methodology similar to what is available to DFII-SKILL with the ~> operator • Enhance it with some new options not found in SKILL 3
June 28, 2011
Cadence Confidential
Two main commands a ong w t some e pers • dbGet • dbSet • Related Commands: – – – – –
4
June 28, 2011
setDbGetMode/getDbGetMode dbSchema dbTransform dbQuery dbShape (available in 10.1)
Cadence Confidential
•
What is this thing I have selected? Select an instance graphically and then:
•
Get a pointer to the selected object(s): encounter 4> dbGet selected 0x2a9ef88578
•
Get a list of the attributes for that object: encoun er > e se ec e . inst: box cell instTerms isDontTouch isHaloBlock isJtagElem isPhysOnly isSpareGate name objType orient pHaloBot pHaloBox pHaloLeft pHaloRight pHaloTop pStatus pgCellTerms pgTermNets pt rHaloBotLayer rHaloSideSize rHaloTopLayer
•
encounter 6> dbGet selected.?? box: {416.46 889.84 434.28 894.88} cell: 0x2a9e734280 instTerms: 0x2a9ef8a4f0 0x2a9ef8a550 0x2a9ef8a5b0 0x2a9ef8a610 0x2a9ef8a670 0x2a9ef8a6d0 0x2a9ef8a730 isHaloBlock: 0
5
June 28, 2011
Cadence Confidential
. • dbGet uses . as a se arator for ob /attr traversal – Similar to DFII ~>
• dbget top.insts.cell.name … – – – –
6
June 28, 2011
“top” is a cell pointer for the top cell “insts” is the list of inst pointers in top “cell” is the master cell pointers for each inst “name” is the master cell name
Cadence Confidential
dbGet Exam les: • • • •
.?h
Similar to .? but includes type, legal enum values, and a short description For obj or objList includes objType Note ob T e field itself is su ressed as too lon with comment how to see it Alphabetical
encount er 1> dbGet t op. i nst s. ?h ================================ i nst : I nst ance - canoni cal ( f l at ) , equi val ent t o DEF COMPONENT. Poi nt s t o a l i bCel l or t nCel l . -------------------------------box: r ect , Boundi ng box of t he i nst ance pt ( set t abl e) : pt , Locat i on of t he i nst ance i nst Ter ms: obj Li st ( i nst Ter m) , Li st of poi nt er s t o i nst ance t er mi nal s … or i ent ( set t abl e) : enum( MX MX90 MY MY90 R0 R180 R270 R90) , I nst ance pl acement or i ent at i on pSt at us( set t abl e) : enum( cover f i xed pl aced unpl aced) , I nst ance pl acement status
7
June 28, 2011
Cadence Confidential
• Can be used to match field names or values • Simple wildcard matching used by default (*, ?) – use –regexp option for regular expression matching
• Value matchin encount er 1> dbGet t op. net s. name *cl k* a_cl k1 cl k2 cl k3 cl k[ 1] cl k_2 encount er 2> dbGet t op. net s. name *cl k? _
• Field name matching (for .? .?? .?h) also useful to get just one field encount er 1> dbGet t op. i nst s. ?h pst at * pSt at us( set t abl e) : enum( cover f i xed pl aced unpl aced) , I nst ance pl acement st at us
8
June 28, 2011
Cadence Confidential
– • The – o tion returns the ointer of the ob ect rather than the field value, so pointers of objects that match a field value can be returned • e –p op on goes ac eve s o o ec s, -p goes back 3 levels, etc. .
.
a_cl k1 cl k2 cl k3 … # al l net s mat chi ng *cl k* encount er 2> dbGet –p t op. net s. name *cl k* 0x111111 0x222222 … # pt r s t o net s mat chi ng *cl k* encount er 3> dbGet [ dbGet - p t op. i nst s. cel l . name I NVX1] . name I NVX1 I NVX1 I NVX1 … # al l I NVX1 cel l s i n desi gn encount er 4> dbGet [ dbGet –p2 t op. i nst s. cel l . name I NVX1] . name i 1/ i 2 i 1/ i 3 i 4/ i 5/ i 6 … # al l i nst names of I NVX1 i n desi gn
9
June 28, 2011
Cadence Confidential
• dbGet … Specifies a Tcl expression where values of attributes or objects can be accessed and utilized in Tcl "expr" style • Example: Find all the high fanout nets that aren’t clocks – encounter 1> dbGet -p top.nets.numInputTerms 20 0x2aaab371adc8 0x2aaab371afc0 – encounter 2> dbGet top.nets {.numInputTerms >= 20} 0x2aaab45257e8 0x2aaab4525890 0x2aaab4526460 … – encounter 3> dbGet top.nets {.numInputTerms >= 20 && .isClock == 0} 0x2aaab45257e8 0x2aaab4525890 0x2aaab4526460 …
10
June 28, 2011
Cadence Confidential
– • For some items, like cell names, the returned list ma have the same entry multiple times encount er 1> dbGet t op. i nst s. cel l . name
• If the user only wanted the unique list of different cells they can use –u encount er 2> dbGet - u t op. i nst s. cel l . name I NV AND2 OR2 … encount er 3> dbGet –u t op. i nst s. cel l 0x1111 0x2222 … #one pt r t o each cel l used i n desi gn
11
June 28, 2011
Cadence Confidential
Usage: dbGet [-d] [-p#] [-u] [-regexp] < _ >.
_
.
_
. .
.
–p | -p1 | -p2 | -p3 … levels for back traversal of objects (p or p1 = 1 level, p2 = 2 levels, etc.) –u removes duplicate objects so that the resulting list has unique entries -d return dbu units rather than user units (by default coords are floats in um rather than ints) objList list of 1 or more object pointers (can be a homogeneous or heterogeneous list) head used for technology info [dbgHead] top used for current top cell, [dbHeadTopCell] selected list of objects in the selected set .objName object or object list field name .attrName attribute field name .? return list of available objects/fields available from the last object in the chain .?? return list of available objects/fields and their values from the last object in the chain . pattern string expression to compare against attribute values (objName/attrName for .?, .??, .?h)
12
June 28, 2011
Cadence Confidential
• encounter 1> dbGet top. • encounter 2> dbGet top.i dbGet top.insts. • encounter 3> selectInst i1 • encounter 4> selectNet net1 • encounter 5> dbGet selected. • > . . . < > dbGet top.insts.cell.name 13
June 28, 2011
Cadence Confidential
• dbGet is case insensitive – dbGet, dbget are both accepted – . , . ,
.
• Empty fields return 0x0 • Illegal field name gives Error msg but still return 0x0, so list of mixed objects still ok • 0x0 in objList is silently allowed, so list of mixed objects is still ok >dbGet $n. al l Ter ms . name #$n i s cl k net at t ached t o t er m and i ns t Ter m cl k i 1/ i 2/ cl kI n #combo of t er ms and i nst Ter ms . . ERROR: " i ns t " - I nval i d obj / at t r i but e f or t er m 0x0 0x111111 #t er m has no i nst f i el d, s o 0x0 r et ur ned >dbGet $i . name 0x0 i 1/ i 2x #no er r or msg f r om 0x0. name >dbGet $i . name i 1* i 1/ i 2x >dbGet $i . name * x* #0x0 i s not a name, s o * x* does NOT mat ch 0x0 i 1/ i 2x >dbGet $i . name 0* #no name was mat c hed at al l , so empt y l i st of 0x0 r et ur ned 0x0
14
June 28, 2011
Cadence Confidential
• The followin exam les are the same: >set pgnet s [ dbGet - p t op. net s. i sPwr Or Gnd 1] 0x111111 0x222222 >dbGet $ net s. name VDD VSS >dbGet [ dbGet VDD VSS
15
June 28, 2011
Cadence Confidential
t o . net s. i sPwr Or Gnd 1] . name
• By default, all distance values in um rather than dbu (use –d for dbu) • A few object names have been changed to align better with Virtuoso and OpenAccess terminology. For example: – term in dbGet is FTerm in the FEDB (dbForEachCellFTerm) – instTerm in dbGet is Term in the FEDB (dbForEachInstTerm)
16
June 28, 2011
Cadence Confidential
• dbGet pointers can be used by equivalent FE-TCL DB access • FE-TCL DB pointers can be used by equivalent dbget object – although dbGet does not support all FE DB objects >set a [ dbget –p t op. i nst s. name i 1/ i 2] 0x222222 ns e ame a i 1/ i 2 >set b [ dbGet I nst ByName i 1/ i 2] x >dbget $b. name i 1/ i 2
17
June 28, 2011
Cadence Confidential
•
rect objType is a list with 4 values like {100.1 0.0 100.3 0.2} – use –d for dbu values – use Tcl “join” if you need to flatten the list {1 2 3 4} to 1 2 3 4
> dbGet t op. f pl an. pbl kgs . s hapes . r ect #r et ur ns l i s t of l i s t s {100. 1 0 100. 3 0. 2} {200. 0 100. 0 220. 0 110. 0} >dbGet –d t op. f pl an. pbl kgs. shapes. r ect {100100 0 100300 200} {200000 100000 220000 110000} >set b [ l i ndex [ dbGet t op. f pl an. pbl kgs. shapes] 0] 0x222222 >set c [ dbGet –d $b. r ect ] #st i l l a l i s t of l i s t s {100100 0 100300 200} >j oi n $c #”f l at t en” t he l i st 100100 0 100300 200
•
pt and ptList objTypes are similar, with ptList a list of lists of lists
pt : {100. 1 100. 2} pt Li st : {{100. 1 100. 2} {100. 1 100. 4} …}
18
June 28, 2011
Cadence Confidential
• setDbGetMode -dis la Limit value -dis la Format (simple | table)] – The displayLimit controls the .?? output for both the number of • As .?? is for interactive use, the goal is to not have thousands of lines output that would not be useful • Default: 10
– The displayFormat controls the .?h and .?? style outputs • Some users like a more tabular style •
19
June 28, 2011
Cadence Confidential
• dbSet allows editing of appropriate attribute fields, but no po n ers • Does not support creation or deletion of objects • – placement status, halo values, gap values – dbget .?h descriptions show (settable) for attributes that can be u
Syntax: dbset objList{.objName}*.attrName attrValue >dbSet t op. i nst s. pSt at us pl aced >dbSet [ dbGet – p t op. i nst s. name *cl k* ] . pSt at us f i xed
20
June 28, 2011
Cadence Confidential
• dbSchema provides a way to find the attributes available ’ already • dbSchema allows filtering to simplify output and look for – Syntax: dbSchema [-help] [objNamePattern [objAttrNamePattern]] – match the *ptn* pattern. encount er > dbSchema * *pt n* =================================================== hI ns t : Hi er ar c hi c al i ns t a nc e ( der i ved f r om net l i s t ) =================================================== ptn: obj(ptn), Pointer to the partition
=============================== head: Root / Head of t he dat abase =============================== ptns: objList(ptn), List of pointers to partitions in the design
– The hInst and head objects matched the query 21
June 28, 2011
Cadence Confidential
dbTransform for Translating Global/Local oor nates Usage: dbTr ansf or m [ - hel p] [ - d] {- i nst | {- cel l - or i ent } - pt {x y}}} {- l ocal Pt | - gl obal Pt } - hel p -d
# Pr i nt s out t he command usage # User speci f i ed val ues and r et ur n val ues ar e i n dat abase # uni t s: def aul t i s um ( bool , opt i onal ) - i nst # i nst ance obj ect ( db obj ect , r equi r ed) - cel l # cel l obj ect ( db obj ect , opt i onal ) - or i ent {R0| R90| R180| R270| MX| MX90| MY| MY90} # or i ent at i on # ( enum, opt i onal ) - pt {x y} # l ocat i on ( poi nt , opt i onal ) - l ocal Pt # a pt {x y}, r ect {xl yl xu yu} or l i s t of pt s and/ or # r ects {{x1 y1} {x2 y2} {xl yl xu yu} . . . } i nsi de cel l # ( st r i ng, r equi r ed) - gl obal Pt # a pt {x y}, r ect {xl yl xu yu} or l i s t of pt s and/ or # r ect s x1 1 x2 2 xl l xu u . . . i nsi de desi n # ( st r i ng, r equi r ed)
22
June 28, 2011
Cadence Confidential
Usage: dbShape [ - hel p] [ - d] [ - st ep ] [ - out put ] [ AND | ANDNOT | OR | XOR | SI ZE | BBOX | MOVE { }] . . . - hel p -d
# Pr i nt s out t he command usage # User speci f i ed val ues and r et ur n val ues ar e i n dat abase uni t s. # Def aul t : Al l val ues ar e i n user uni t s, i n mi crons. ( bool , opt i onal ) - st ep # Speci f i es st ep si ze i f out put f or mat i s r ect , r equi r ed t o conver t # non- or t hogonal shapes i nt o ser i es of r ect angl es. Def aul t : mi nwi dt h # val ue of f i r st r out i ng l ayer ( coor d, opt i onal ) . - out put # Spec i f i es t he out put f or mat . def aul t : r ec t ( s t r i ng, opt i onal ) # pol ygon or r ect or l i st of pol ygon and r ect . pol ygon: # x x x . . . ; r ect : x1 1 x2 2 ( l i s t , r e ui r ed) AND # bi nar y oper at or : i nt er sect i on of shapeLi st s ANDNOT # bi nar y oper at or : i ni t i al shapeLi st mi nus OR # bi nar y oper at or : uni on of s hapel i st s XOR # bi nar y oper at or : OR mi nus AND of shapeLi st # ( s t r i ng, opt i onal ) MOVE { } # unar y oper at or : move t he s hapeLi st by { } BBOX # unar y oper at or : comput es t he boundi ng box of shapeLi st # ( s t r i ng, opt i onal )
23
June 28, 2011
Cadence Confidential
Usage: dbQuer y [ - hel p] [ - d] - ar ea {l l x l l y ur x ur y} [ - obj Type - hel p -d
# Pr i nt s out t he command usage # User speci f i ed val ues and r et ur n val ues ar e i n , - ar ea {l l x l l y ur x ur y} # Speci f i es t he s ear ch ar ea {l l x l l y ur x ur y}, # wher e l l = l ower l ef t , ur = upper r i ght . ox, r equ r e - obj Type # l i st of obj ect t ypes t o r et ur n. Legal val ues ar e: # {i nst speci al }, ( speci al = uni on of sWi r e and s a ns , e au : ns s r ng, op ona
24
June 28, 2011
Cadence Confidential
• It would be im ossible to rovide native functionalit to suit every need that might arise, so db access commands are useful in bridging the gap between tool ’ implemented • dbGet and dbSet provide a simple, consistent way to programmatically probe and tweak the database • We welcome your suggestions for improvement to
25
June 28, 2011
Cadence Confidential