Useful DbGet One
Useful DbGet One
If you've been checking out the other blogs here in the Digital Implementation community,
you've probably seen mention of the database access mechanism dbGet/dbSet. Back in the SoC-
Encounter 6.x days, our very own BobD gave me a quick demo of dbGet. I couldn't wait for 7.1
to come out, so I could start using it. Of course I got busy with customer projects and never quite
found the time to play with it and get up-to-speed. Today, I'm still far from a dbGet power-user,
but I have started exploring it and using it in my work. Instead of starting off by reading the
documentation (although the docs are a great reference), I've found that the best way to learn
dbGet is to just start playing with it.
The return line specifying the usage may look cryptic at first, but let's check out a few things.
The most interesting keywords at first glance are head, top, and selected.
Using a single question mark will show you a list of the attributes available at this level.
> dbGet head.?
> head: allCells dbUnits layers mfgGrid objType props
The most interesting items to me in this list are dbUnits and mfgGrid:
> dbGet head.dbUnits
> 1000
> dbGet head.mfgGrid
> 0.005
You can also list all the attributes AND their values with a double question mark:
> dbGet head.??
The results may not always be readable text, as in the example of layers:
> dbGet head.layers
> 0x118781e0 0x13ff8cd0 0x13ff97c0 0x13ffa2b0 0x13ffada0 0x13ffb890 0x13ffc380
0x13ffcea0 0x13ffda10 0x13ffe500 0x13ff77e8 0x13ff9248 0x13ff9d38 0x13ffa828 0x13ffb318
0x13ffbe08 0x13ffc8f8 0x13ffd418 0x13ffdf88 0x13ffea78
Cool, lots of stuff to play with here! Try out various attributes and start thinking about how you
can use the results in scripts, or just to poke around your design and check out a few things.
Finally, select one of the instances in your design (I selected a RAM), then:
> dbGet selected.?
> inst: box cell instTerms isDontTouch isHaloBlock isJtagElem isPhysOnly isSpareGate name
objType orient pStatus pgCellTerms pgTermNets pt
This is a quick way to get information for just the things you've selected. (Try selecting more
than one thing and see how the results look.)
This has been a VERY brief introduction to playing with dbGet. (We didn't even get to dbSet
yet!) I'd love to hear in the comments if you are already using dbGet, if you know about it but
haven't used it yet, or if you didn't even know about it but think you might use it now. Have fun
playing around and finding some useful dbGet combinations - then save those for a future post,
where I'll ask everyone for their favorites.
We've gotten some good feedback about posts in this forum relating to dbGet and dbSet (the
database access mechanism inside SoC-Encounter). I've been collecting interesting dbGet/dbSet
lines over the past several months that I think are very useful. Some of these may be something
you've wanted to do as well, or maybe they will serve as a starting point for a different idea or
even a longer script. I gave credit to the people whose emails I extracted these from:
See what metal layers your block's IO pins are on: (Bob Dwyer)
dbGet top.terms.pins.allShapes.layer.name
Get a list of all cell types used in the design: (Gary Nunn)
dbGet -u top.insts.cell.name
(The "-u" filters out duplicate objects.)
Get the size of block placement halos: (Kari Summers / Bob Dwyer)
dbGet [dbGet -p2 top.insts.cell.subClass block*].pHaloTop
dbGet [dbGet -p2 top.insts.cell.subClass block*].pHaloBot
dbGet [dbGet -p2 top.insts.cell.subClass block*].pHaloLeft
dbGet [dbGet -p2 top.insts.cell.subClass block*].pHaloRight
Get the size and top/bottom layers of block routing halos: (Bob Dwyer)
dbGet [dbGet -p2 top.insts.cell.subClass block*].rHaloSideSize
dbGet [dbGet -p2 top.insts.cell.subClass block*].rHaloBotLayer.name
dbGet [dbGet -p2 top.insts.cell.subClass block*].rHaloTopLayer.name
Make sure all your tiehi/lo connections have tie cells (and are not connected to a rail instead):
(Gary Nunn)
dbGet top.insts.instTerms.isTieHi 1
dbGet top.insts.instTerms.isTieLo 1
(Should return "0x0" if all connections have tie cells.
If "1"s are returned, use the following 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
Change the routing status of a net (for example, from FIXED to ROUTED): (Gary Nunn)
dbSet [dbGet -p top.nets.name netName].wires.status routed
I'm sure there are many more useful dbGet/dbSet one-liners out there; let's hear yours! Please
post in the comments some of the dbGet lines that you have come up with.