Home > Community > Blogs > Digital Implementation > dbshape for all your logical operation needs
 
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).
 

Email

* 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: *

Guest User Blog: dbShape For All Your Logical Operation Needs

Comments(3)Filed under: Digital Implementation, encounter, TCL, EDI, db access, Avago, dbShape, Gentry, EDI 10.1, logical operations

This is a guest post from Jason Gentry at Avago. I hope you enjoy this useful piece he's contributed on using the Encounter Digital Implementation System's dbShape command that debuted in 10.1.

I figured it was time for another guest blog, especially since I've been able to play with one of the new-to-EDI10.1 commands called "dbShape."  During CDNLive! 2008, one of the topics I talked about was my need for logical operations or LogOps for short.  Think basic OR, AND, ANDNOT, etc. operations on physical geometries.  I had Tcl-implemented versions of these that worked well (N-log(N)) but their performance was really poor when dealing with a large number of shapes (N).  Well, apparently Cadence was listening and decided to bolt-on a shapes engine.  EDI10.1 introduces the 'dbShape' command and it is a thing of beauty.  The usage is as follows:

Usage: dbShape [-help] [-d] [-step <step>] [-output <polygon|rect>]
             <shapeList> [AND <shapeList> | ANDNOT <shapeList> | OR <shapeList> | XOR <shapeList>
             | SIZE <value>| BBOX | MOVE {<dx> <dy>}] ...

-help            # Prints out the command usage
-d               # User specified values and return values are in database units.
                 # Default: All values are in user units, in microns. (bool, optional)
-step <step>     # Specifies step size if output format is rect, required to convert
                 # non-orthogonal shapes into series of rectangles. Default: minwidth
                 # value of first routing layer (coord, optional).
-output <polygon|rect>
                 # Specifies the output format. default: rect (string, optional)
<shapeList>      # polygon or rect or list of polygon and rect. polygon:
                 # {{x y} {x y} {x y} ... }; rect: {x1 y1 x2 y2} (list, required)
AND <shapeList>  # binary operator: intersection of shapeLists
ANDNOT <shapeList> # binary operator: initial shapeList minus <shapeList>
OR <shapelist>   # binary operator: union of shapelists
XOR <shapeList>  # binary operator: OR minus AND of shapeList
                 # (string, optional)
SIZE <value>     # unary operator: increase the size of shapeList by <value>
MOVE {<dx> <dy>} # unary operator: move the shapeList by {<dx> <dy>}
BBOX             # unary operator: computes the bounding box of shapeList
                 # (string, optional)


I've since replaced all of my low-level LogOp procedures with calls to dbShape.  I've seen some performance improvement but it wasn't until I re-architected some of my biggest programs that I saw a major impact.  One such script, a custom power grid insertion script, went from running in 8-9 hours to running in 1/2 an hour.  It ran so fast I had to double check that my power grid actually got inserted.  Below are some examples of each of the available operations (note that I use the '-output rect' option for all of these to simplify the illustrations but it is not necessary).

set shapes1 [list [list 100 100 1100 1100]]

 set shapes2 [list [list 300 300 500 500] [list 700 700 900 900]]

 

set shapes3 [list [list 500 700 1200 900]]

 

LogOp OR:
dbShape -d -output rect $shapes1 OR $shapes3


LogOp: AND
dbShape -d -output rect $shapes1 AND $shapes2



LopOp: ANDNOT
dbShape -d -output rect $shapes1 ANDNOT $shapes2



LogOp: SIZE
dbShape -d -output rect $shapes2 SIZE 100



There are some limitations that you should know about before you write your own scripts:

  - There is only a 'SIZE' logop, no 'SIZEX' or 'SIZEY' for sizing only one dimension.  This has caused me some headaches but I've gotten around it for the most part for now, albeit inefficiently.

  - The is no 'INTERSECTS' LogOp; a LogOp that returns all shapes that intersect the specified shapeList.  Think 'AND' without modifying the original shapeList.  This would be really nice for finding floating power wires (wires with no vias connecting to it).

  - If you choose to work with rectangles (-output rect), all of the rectangles are returned in maximally-vertical form.  In other words, the resulting rectangles will be cut such that they are as tall as possible.  You might ask, "Why do I care?"  The only time that I've needed to care whether I have maximally-horizontal versus maximally-vertical rectangles dealt with trying to compute spacing requirements.  The "run-length" of a given shape may change depending on whether or not it appears very long or very short.  I've included images below showing the above ANDNOT example with maximally-horizontal and maximally-vertical configurations.

Maximally-Vertical Rectangles:

 

Maximally-Horizontal Rectangles:

 

  - You can daisy-chain the operations.  This is best shown through example:

dbShape -d -output rect $shapes1 OR $shapes3 ANDNOT $shapes2

 

-Jason Gentry

Related Post: Using dbTransform to Translate Geometric Coordinates in Encounter

Comments(3)

By Kari on February 16, 2011
Awesome guest blog, Jason! This is really cool stuff.

By Nataraja G on June 19, 2012
How to get the output in Maximally-Horizontal Rectangles ?

By BobD on June 19, 2012
Try: dbShape -output hrect

Leave a Comment


Name
E-mail (will not be published)
Comment
 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.