Home > Community > Blogs > Digital Implementation > getting started with dbset
Login with a Cadence account.
Not a member yet?
Create a permanent login account to make interactions with Cadence more conveniennt.

Register | Membership benefits
Get email delivery of the Digital Implementation blog (individual posts).


* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

Getting Started with dbSet

Comments(1)Filed under: Digital Implementation, dbGet, encounter, dbSet

A while back, I posted a blog called Getting Started with dbGet. It was a brief introduction to this database access mechanism. Well, dbGet is only half the story - there is also a command called dbSet, which can give you even more power in your scripting or manipulating of the design database.

It works in much the same way as dbGet. As a quick review, let's say we wanted to find out the placement status of the instances in our design. If we didn't remember the exact syntax, we would start with:

> dbGet top.?

The ? will list all the things we can look at regarding "top", the top cell of our design.

> topCell: fPlan hInst insts name nets numBidirs numInputs numInsts numNets numPhysInsts numPhysNets numTerms objType pgTerms physInsts physNets props statusClockSynthesized statusGRouted statusIoPlaced statusPlaced statusPowerAnalyzed statusRCExtracted statusRouted statusScanOpted terms

What we want is insts, or all the instances in the design:

>dbGet top.insts.?
>inst: box cell instTerms isDontTouch isHaloBlock isJtagElem isPhysOnly isSpareGate name objType orient pStatus pgCellTerms pgTermNets pt

And finally, pStatus (placement status):

>dbGet top.insts.pStatus
>fixed placed placed placed placed... (etc.)

So now that we have the attribute we want, let's change it! Suppose we want all the instances to be fixed and not just placed. Well, dbSet makes this very easy:

>dbSet top.insts.pStatus fixed

If you reissue the dbGet command, you'll see that all the instances are now fixed.

Here's a more realistic example. I had a design where I wanted to fix the placement of all of my adder cells. They were large cells, and allowing them to be moved around after their initial placement would cause them to be placed far away from their original location. So, first I had to grab pointers to all of the adder cells:

>dbGet -p2 top.insts.cell.name ADD*

The -p2 means to grab the database pointers of the instances gathered by this command, which means all instances whose master cell names start with ADD. (For some more explanation of how the -p function works with dbGet, see the post A dbGet Code Example).

Now that I have those pointers, I can examine the placement status of these instances:

>dbGet [dbGet -p2 top.insts.cell.name ADD*].pStatus

But what I really want to do is set the placement status to fixed, so the final line would look like this:

>dbSet [dbGet -p2 top.insts.cell.name ADD*].pStatus fixed

For a list of attributes that are editable with dbSet, you can check out Appendix B of the Encounter Text Command Reference. Scroll down the tables and look at the "Editable" column. Most of the editable attributes fall under the "inst" database object.

I hope this short introduction to dbSet has inspired you to check it out and use it in your scripts. Let me know in the comments how you're using dbSet. I'm always interested to see clever one-line dbGet/dbSet commands. In fact, I'm collecting them for a future post. (Don't worry, I'll give you credit!)


By NAADHAN on May 19, 2009
Kari...as usual simple and clear...thanks a lot...Pls continue this so that we all learn db scripting from this :-)..thanks again...

Leave a Comment

E-mail (will not be published)
 I have read and agree to the Terms of use and Community Guidelines.
Community Guidelines
The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.