Home > Community > Forums > Custom IC Design > Need a Skill code to get a list of elements under a plygonal shape.

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

 Need a Skill code to get a list of elements under a plygonal shape. 

Last post Fri, Feb 6 2009 10:01 AM by AmitBiswas. 15 replies.
Started by AmitBiswas 25 Jan 2009 07:15 AM. Topic has 15 replies and 10256 views
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts:
  • Sun, Jan 25 2009 7:15 AM

    • AmitBiswas
    • Top 500 Contributor
    • Joined on Sun, Jan 25 2009
    • Bangalore, Karnataka
    • Posts 22
    • Points 575
    Need a Skill code to get a list of elements under a plygonal shape. Reply

    I am looking for a comand in skill to get the list of elements under a polygonal shape.

    There is a command

     dbgetTrueOverlaps( d_cellView l_bBox)

     here the output of this command is a list of elements. But this command only takes the input as a list of two points.

     I want to give a list of more number of points as input to the code and the output it will return a list of elements under the polygon formed by the list of input points.

    If anybody knows how to get it done please repply.

    Regards,

    Amit 

     


    Filed under:
    • Post Points: 20
  • Mon, Jan 26 2009 6:33 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 396
    • Points 7,460
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

    The only way to do this is to decompose the polygon into rectangles and run dbGetTrueOverlaps on each rectangle. If your polygons are not orthogonal, then you'll have to do some approximating. Cadence has a routine called dbLayerTile that will take an input shape and decompose it into trapezoids. If the original shape is orthogonal, then the results will be rectangles. The drawback to this routine is that it will actually create the trapezoids (or rectangles) in your layout where the source shapes are located. If you need to be able to work in a read-only mode, then you would have to mess around with a scratch cell to do your layer tiling. You alternative is to write your own polygon to trapezoid routine or find one out on the web.

     -Derek

    • Post Points: 20
  • Mon, Jan 26 2009 12:43 PM

    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

     Derek is correct, using dbLayerTile will break an orthogonal polygon into rectangles which can then be fed to dbGetTrueOverlaps. The first  argument for dbLayerTile is a cellView ID so you could open a scratch cellView using dbOpenCellViewByType in "s" mode (including IC6.1.3) and create the resulting rectangles there. dbLayerTile returns the dbId's for the rectangles so you could then process them from there. I often open a scratch cellView and keep it open just for this type of issue, sharing it among multiple programs.

     

    Ted

    • Post Points: 20
  • Tue, Jan 27 2009 3:36 AM

    • AmitBiswas
    • Top 500 Contributor
    • Joined on Sun, Jan 25 2009
    • Bangalore, Karnataka
    • Posts 22
    • Points 575
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

    Thans a lot , it solved my problem.

    But now I have one more issue that is when I am using  " dbGetTrueOverlaps " command , if there is any Guardring or any multipartpath present inside that area, This command returns list of dbid of the  multipartpath along with all the individual contacts and vias and layers.

    I want  dbID of the MultipartPath only.

    And How to diferentiate a " Path " and a " Multipartpath " in the layout.

    car(geGetSelSet()) ~>??    for both Path and Multipartpath  gives the same kind of properties.

    Filed under:
    • Post Points: 20
  • Tue, Jan 27 2009 8:33 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,598
    • Points 16,075
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

    Amit,

    One way that you could check is to see if rodGetObj() returns a rod object id or nil, if a rodObj:0x... is returned, then the path is possibly a multipart path. Then you could check the subShapes attribute of the rodObject to see if the path is indeed a multi-part path, or just a named rod path with no sub-parts. (Create->Multipart Path could create a rod path with no subparts, but then it is really just a rod-named path).

    I hope that this answers your question, or at least helps you.

    Regards,

    Lawrence.

    • Post Points: 20
  • Thu, Jan 29 2009 3:51 AM

    • AmitBiswas
    • Top 500 Contributor
    • Joined on Sun, Jan 25 2009
    • Bangalore, Karnataka
    • Posts 22
    • Points 575
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

     Thank you Lawrence, because of you only now I have a bug free code.

    Really it reduced my lot of work. Now I hve one more doubt How to get the dbid of last placed object in the layout,

    because I want to get the dbid of the polygon but hiCreatepolygon  does not return any dbid.

    Filed under:
    • Post Points: 20
  • Thu, Jan 29 2009 6:57 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 396
    • Points 7,460
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

    Sounds like you want to use a combination of enterPolygon and dbCreatePolygon. The enterPolygon routine will allow you to define your own polygon creation interface. When it completes, you can use dbCreatePolygon to create the actual polygon and the return value of this routine is your dbId.

    Derek

    • Post Points: 20
  • Fri, Jan 30 2009 5:26 AM

    • AmitBiswas
    • Top 500 Contributor
    • Joined on Sun, Jan 25 2009
    • Bangalore, Karnataka
    • Posts 22
    • Points 575
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

    Derek ,

    Acually I want to get the dbID of last placed object in the layout.I intentionally used lehiCreatePolygon command (whhich does not return any dbid). 

    I can not use dbcreatePolygon command because I want to create the polygon using human interface  after that I will check the points of that polygon.

    and in enterPolygon command also I need to give the list of points as an argument.

     

    Thanks & Regards,

    Amit 

    Filed under:
    • Post Points: 20
  • Fri, Jan 30 2009 6:53 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 396
    • Points 7,460
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

    The points argument is not required. This simple example (similar to the one in the documentation for enterPolygon) will allow you to create a polygon interactively:

    procedure(myPolygon()
        enterPolygon(
            ?prompts list("Point at the first point of the polygon:" "Point at the next point of the poygon")
            ?doneProc "myPolygonDp"
            ?cmdName "My Polygon"
        )
    )

    procedure(myPolygonDp(w done pts)
      let((polyId)
        if( done then
            printf("Polygon entered was %L.\n" pts)
            polyId = dbCreatePolygon( w->editCellView leGetEntryLayer() pts)
        else
            println("Polygon entry aborted.")
        )
        polyId
      )
    )

    • Post Points: 20
  • Wed, Feb 4 2009 9:59 AM

    • AmitBiswas
    • Top 500 Contributor
    • Joined on Sun, Jan 25 2009
    • Bangalore, Karnataka
    • Posts 22
    • Points 575
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply
    enterPolygon code is working fine. I solve that problem some other way. now can u plz explain me how this code is working. How that "done" "pts" and "w" is initialized .this is the code given as an example in the documentation but I didn't find any explanation. For my last question that how do I get the dbid of last placed object in the layout. I have done it. its working fine but I am not sure It is working by chance or it is the right code. What I have done 1.deselect all element 2.select all element 3. then car(geGetselset) will return the last placed object's dbid. is it correct for all the time. the first point of deselecting all the element is because I found that if any object is selected then it will return that object's dbid as the output of car(geGetselSet()) If you have any other code to do it, plz tell me. Regards, Amit
    Filed under:
    • Post Points: 35
  • Wed, Feb 4 2009 10:29 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,598
    • Points 16,075
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

     Hi Amit,

    The "doneProc" automatically has three arguments supplied, the "w" is the window id, done is t/nil indicating whether the user completed the action or aborted (e.g. by pressing "Esc" during the enterFunction command), and points are the digitized points that the user supplied.

    I'm not sure that it is safe to rely on the selection giving the most recently added shape first.  However, it may just always work this way. A similar thing that you might be able to rely on more soundly is the cellview shapes attribute, for example:

    cv = geGetEditCellView()
    ;; the following should give the most recent shape
    car(cv~>shapes)
    ;; the folowing should give the most recent polygon shape
    car(setof(sh cv~>shapes sh~>objType=="polygon"))
    
    

    Hope it helps.

    regards,

    Lawrence.

    Filed under:
    • Post Points: 5
  • Wed, Feb 4 2009 10:36 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 396
    • Points 7,460
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

    The "doneProc" for enterPolygon automatically passes the windowId the points and a t/nil (done) to indicate if the routine was completed or not. Cadence provides hooks for doneProcs or callbacks to some of their interactive routines and these are usually passed a fixed set of arguments. The documentation should explain what these arguments are. If you are having trouble finding the doc (or are too lazy to look it up), you can use the following trick to find out how many arguments are needed and what type of arguments they are:

    procedure(myPolygonDp(@optional a b c d)
       println(list(a b c d))
    )

    This will take an optional number of arguments and default the rest to nil. It will then print out their values. In the preceding example, it would be easy to see that the windowId and points are passed to the routine. It would be less clear what the second argument (done) is since you would simply get a t. There is usually enough information for me to write the routine. The code given in the documentation is self-explanatory since it checks the value of done and draws a polygon in w using pts.

    As for your second question, I have observed the same as you (the last object created appears first in the selectedSet for all objects). I do not know if this will work all the time. A safer approach could be to get a list of all objects in the cell. Call the leHiCreatePolygon code. Then get a new list of all the objects in the cell and identify which object is not in the original set.

    cv = geGetEditCellView()
    polygons = setof(x cv~>shapes x~>objType=="polygon")
    leHiCreatePolygon()
    newPolygon = car(setof(x cv~>shapes x~>objType=="polygon" && !memq(x polygons)))

    -Derek

    • Post Points: 20
  • Wed, Feb 4 2009 10:53 AM

    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

     I have to agree with Derek, do not rely on the order of the data retrieved from the database. It is poor programming to rely on an undocumented order which may change depending on spaces in the virtual memory.

    You can also use @rest to get all the arguments regardless of the number and then print them:

     procedure(myPolygonDp2( @rest argList )
           println( argList )
    )

    The second argument is gets set to nil if you cancel the enterfunction so you can clean up your code, such as restoring data as it was before the command started.

    Ted

    - Derek - can you email me directly, I need to get some user input.

    • Post Points: 20
  • Fri, Feb 6 2009 9:01 AM

    • AmitBiswas
    • Top 500 Contributor
    • Joined on Sun, Jan 25 2009
    • Bangalore, Karnataka
    • Posts 22
    • Points 575
    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply
    I wan to create a form where some of the form fields will be automatically evaluated depending upon the other form field value.suppose metal width is one one form field and I want to calculate no. of row of via , will be calculated taking care of DRC in the form itself so that user can take a descision before proceeding further.All the calculation I will do but how to reflect the result of the calculation in the form itself.one example like during instantiating a resistor if width is independent variable, length will be calculated depending upon the vale of the resistor.
    Filed under:
    • Post Points: 20
  • Fri, Feb 6 2009 9:45 AM

    Re: Need a Skill code to get a list of elements under a plygonal shape. Reply

     Hi Amit

     Why don't you make this a new topic as it it is different from what we dicussed in this topic and may be of interest to others who will be creating forms. Then I will be able to answer and get the widest audience.

     

    Ted

    • Post Points: 5
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts:
Started by AmitBiswas at 25 Jan 2009 07:15 AM. Topic has 15 replies.