• 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 4592
  • 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
Parents
  • 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
Reply
  • 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
Children
No Data

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