• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Objects selected in schematic, but car(selectedSet()) returns...

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 144
  • Views 4586
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Objects selected in schematic, but car(selectedSet()) returns Nil

jasons
jasons over 14 years ago

I'm trying to write a SKILL script to take the selected pins belonging to an instance placed into a schematic and create corresponding pins at the schematic level.  Sounds straightforward, right?  But after selecting a couple of these things in the schematic, I try to use the old standby css() or car(selectedSet()), but then I get a return value of Nil.  I haven't found any way to access these things.  When I do an "edit properties" in the schematic editor, I see the property name "instance pins", but then can't use the "select by property" setting the property to "instance pins" to select the objects.  When I use schHiSelectAll, and then in the pop-up window select only "pin" under the category "Instance Objects", these objects finally do get selected -- but again, css() returns Nil, and thus I can find no way to work with them in my script.  Any thoughts or help would be greatly appreciated.  

  • Cancel
  • dmay
    dmay over 14 years ago

    selectedSet() works on the active window. Does hiGetCurrentWindow return the window id of the window containing the selection? It is possible that your Window manager (KDE/gnome) makes windows active as the cursor moves across the screen and it may be that the Cadence window containing the selection is no longer the active window.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jasons
    jasons over 14 years ago

     I'm pretty sure it's not a problem with active window.  When I select any other type of object, car(selectedSet()) works -- but when the instance pins are selected, the result is nil.  Also, I don't have any other windows open. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 14 years ago

     Hi Jason,

    The instance terminal (pin) is a representation of the instance masters' pin, and so I think this is why it gives 'nil' when queried.  I think that we are allowed to select these for convenience.  However, it sounds like you want to create pins from the selected instance (although you said selected pins, so it might not be all pins of that symbol?) and as luck would have it, I just wrote exactly this SKILL code the other day, here it is:

    
    
    procedure(CCSpromotePins(inst "d")
      let( (transform pinpoint pininfo pinmaster)
        ;; if the passed in object is not an instance provide a warning
        ;; otherwise use the instance object to gather information for
        ;; creating pins in the current cellview
        if(inst~>objType=="inst" then
          ;; store the instances' transform
          transform = inst~>transform
          ;; iterate over the pins in the master of this instance
          foreach(term inst~>master~>terminals
    	;; foreach pin of this terminal (typically only one)
    	;; find the pin figure location and translate that into
    	;; the coordinates of the cellview where this instance is
    	foreach(pin term~>pins
    	  pinpoint = geTransformUserPoint(centerBox(pin~>fig~>bBox)
    		      transform)
    	  ;; when a pin master can be found for this terminal direction
    	  when(pininfo = caddr(assoc(term~>direction schPinMasters))
    	    ;; use the pin information to open the pin master
    	    ;; and use that to create a pin in this cellview
    	    ;; using the same name, direction and location
    	    when(pinmaster = apply('dbOpenCellViewByType pininfo)
    	      schCreatePin(inst~>cellView pinmaster term~>name 
    		term~>direction nil pinpoint "R0")
    	    ); when the pin master can be opened
    	  ); when the pin direction matches one of the schPinMasters
    	); foreach pin
          ); foreach terminal
        else
          warn("CCSpromotePins: object should be an instance")
        ); if
      ); let
    ); procedure CCSpromotePins
    
    
    procedure(CCShiPromotePins()
      let( ((selSet geGetSelectedSet()))
        ;; when there is somthing selected, invoke the CCSpromotePins
        ;; function on the first (perhaps the only?) object selected
        when(selSet
          forall(obj CCSpromotePins(car(selSet)) obj)
        ); when
      ); let
    ); procedure CCShiPromotePins
    
    

    Basically we go to the instance's master (the symbol master) and find the figures associated with the pins associated with the terminals (the figures are the selectable objects, the pins and terminals are logical), we transform the center point of the figure into the top level coordinate system and then the code creates a schematic pin for each of the symbol pins, using the center of the instance pin as the location for the created pin origin.

     

    Please give this a try and let me know if it helps you.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jasons
    jasons over 14 years ago

    Thanks a lot for the suggestion -- i'll try that out and let you know how it goes.

     --Jason

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jasons
    jasons over 14 years ago

     Lawrence -- that ended up being very useful.  I needed to make a few changes, because for some reason term~>pins was returning nil, but I was able to make good use of geTransformUserPoint function, which I did not know about, and really was key in getting everything to work.  So, thanks again!

     

    --Jason

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 14 years ago

    Jason,

    Glad to hear it!  There is a geTransformUserBBox() function too, but in this case I just wanted a point, so rather than transforming the box and then finding the centre, I found the centre and transformed the point, but it's probably 6 of one and sqrt(36) of the other.

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • man xuecheng
    man xuecheng over 7 years ago

    Hi, i face the same problem with you. I have the script to create all pins and nets from the the selected instance. But sometimes I still have the need to create net or pin from the selected pins belonging to an instance. I go through the "skdfref" documents,  and I find the function geGetObjectSelectedSet() meets our requirements well.  I think "edit properties" form use this function too.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • mbracht
    mbracht over 7 years ago

    I believe those "dots" around an instance in a schematic are actually markers - markers that are child objects of the instance...inst~>children returns them. However clicking on them hilights but doesn't select them...I don't know whether there's any way to do that in a schematic editor - I'am not a schematic editor specialist though. You could select them in SKILL of course:

    (geSelectFigs (setof child inst~>children child~>objType=="marker"))

    I have used the setof function because I'am not sure whether an instance may have any other kind of (non marker) child objects

    The pin related information can be found in the marker's msg attribute.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information