• 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. Automatically generating pins from nets problem

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 16380
  • 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

Automatically generating pins from nets problem

Nicolas Callens
Nicolas Callens over 7 years ago

Hello everyone,

I wanted to write a SKILL code that generates automatically your pins depending on the selected nets and the place where you clicked. However, the latter one does not work and the pins get generated somewhere else in the schematic... Underneath you can find the important part of my code where the problem is situated:

procedure(schAutoCreatePins(ok theListBox)

let( (xcoord ycoord inputCVId)

    xcoord = xCoord(hiGetCommandPoint())

    ycoord = yCoord(hiGetCommandPoint())

    inputCVId = dbOpenCellViewByType("basic" "iopin" "symbol" "" 'r)

    if( ok then printf("Creation of pins: \n")

       foreach(choice theListBox->value

       sprintf(namePin "%s" choice)

       schCreatePin(geGetEditCellView() inputCVId namePin "inputOutput" nil xcoord:ycoord "R0")

       ycoord = ycoord + 0.25

       printf("Pin %s\n" namePin)

       ) ; foreach

    else printf("Cancelled automated pins creation.")

    ) ; if

  )

) ; procedure


Kind Regards,

Nicolas

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Hi Nicolas,

    First of all, you should not write your own code using the same prefixes as Cadence (so don't create your own functions with prefixes such as "sch"). The whole point of using prefixes is to reduce the chance of clashes - and you've then named your function with an increased likelihood of a clash with a future function from Cadence.

    Secondly, if you're calling this from an enter function (e.g. enterPoint), why not use the point that was provided to the callback? It's not that clear how  you're calling the function you show - perhaps you can provide more details?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Nicolas Callens
    Nicolas Callens over 7 years ago in reply to Andrew Beckett

    Hi Andrew,

    1. In the meantime I have followed your advice concerning the prefixes

    I have added the full code, with some additional comments:

    ; Generates List Box with callback cstAutoCreatePins(). TrShowPinListBox(netList) creates list box in which you can select the nets to be generated as pins by cstAutoCreatePins()

    procedure(TrShowPinListBox(netList)
        hiShowListBox(
            ?name gensym('cstPinListBox)
            ?choices netList
            ?callback 'cstAutoCreatePins    
            ?title "Net to pin transformation"
            ?multipleSelect t
            ?applyButton t
        ) ; hiShowListBox
    ) ; procedure

    ; When clicking on certain place in schematic of cellview, the point should be retrieved by hiGetCommandPoint(). This point should be the location where the first pin should be situated, all other pins are above this "reference point", each with an incremental step of 0.25 (as implemented in the code)


    procedure(cstAutoCreatePins(ok theListBox)
        let( (xCo yCo inputCVId)
        xCo = xCoord(hiGetCommandPoint())
        yCo = yCoord(hiGetCommandPoint())
        inputCVId = dbOpenCellViewByType("basic" "iopin" "symbol" "" 'r)
            if( ok then printf("Creation of pins: \n")
                foreach(choice theListBox->value
                     sprintf(namePin "%s" choice)
                     schCreatePin(geGetEditCellView() inputCVId namePin "inputOutput" nil xCo:yCo "R0")
                     yCo = yCo + 0.25   
                     printf("Pin %s\n" namePin)          
                ) ; foreach
            else printf("Cancelled automated pins creation.")
            ) ; if
        )
    ) ; procedure

    ; Just generates the list of nets and call the list box, in which you select the nets to be generated as pins each with an 0.25 increment above each other.

    procedure(cstLoadTrShowPinListBox()
        cv = geGetWindowCellView()
        netNames = cv~>nets~>name

        TrShowPinListBox(netNames)
    )

    Hopefully, I have made myself clearer.

    Thanks!

    Kind regards,

    Nicolas

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to Nicolas Callens

    Nicolas,

    I changed the code to use an enter function - so it prompts you to click on a point to start placing the pins. Better still would be to have started with the enterPoint and then have an options form to ask you the nets you wanted to create the pins for, but that was a little more work to create the form (as then you'd need to create the form and have a listbox field within the form rather than using hiShowListBox) - not much, but I didn't have time.

    I think the problem with using hiGetCommandPoint is that if the focus moves away from the window, it won't work.

    Here's the updated code:

    ; Generates List Box with callback cstAutoCreatePins(). TrShowPinListBox(netList) creates list box in which you can select the nets to be generated as pins by cstAutoCreatePins()
    
    procedure(TrShowPinListBox(netList)
        hiShowListBox(
            ?name gensym('cstPinListBox)
            ?choices netList
            ?callback 'cstAutoCreatePins    
            ?title "Net to pin transformation"
            ?multipleSelect t
            ?applyButton t
        ) ; hiShowListBox
    ) ; procedure
    
    
    ; When clicking on certain place in schematic of cellview, the point should be retrieved by hiGetCommandPoint(). This point should be the location where the first pin should be situated, all other pins are above this "reference point", each with an incremental step of 0.25 (as implemented in the code)
    
    
    procedure(cstAutoCreatePins(ok theListBox)
        let( (xCo yCo inputCVId pointList)
            when(ok
                pointList=enterPoint(?prompts list("Enter point for first pin"))
                unless(pointList ok=nil)
            )
            if( ok then printf("Creation of pins: \n")
                inputCVId = dbOpenCellViewByType("basic" "iopin" "symbol" "" 'r)
                xCo = xCoord(pointList)
                yCo = yCoord(pointList)
                foreach(choice theListBox->value
                     sprintf(namePin "%s" choice) 
                     schCreatePin(geGetEditCellView() inputCVId namePin "inputOutput" nil xCo:yCo "R0")
                     yCo = yCo + 0.25   
                     printf("Pin %s\n" namePin)          
                ) ; foreach
            else printf("Cancelled automated pins creation.")
            ) ; if
        )
    ) ; procedure
    
    ; Just generates the list of nets and call the list box, in which you select the nets to be generated as pins each with an 0.25 increment above each other.
    
    procedure(cstLoadTrShowPinListBox()
        cv = geGetWindowCellView()
        netNames = cv~>nets~>name
    
        TrShowPinListBox(netNames)
    )

    Alternatively, could use code similar to yours (I'm assuming you're calling cstLoadTrShowPinListBox() from a bindkey), but record the coordinate early in the code, like this:

    ; Generates List Box with callback cstAutoCreatePins(). TrShowPinListBox(netList) creates list box in which you can select the nets to be generated as pins by cstAutoCreatePins()
    
    procedure(TrShowPinListBox(netList)
        hiShowListBox(
            ?name gensym('cstPinListBox)
            ?choices netList
            ?callback 'cstAutoCreatePins    
            ?title "Net to pin transformation"
            ?multipleSelect t
            ?applyButton t
        ) ; hiShowListBox
    ) ; procedure
    
    
    ; When clicking on certain place in schematic of cellview, the point should be retrieved by hiGetCommandPoint(). This point should be the location where the first pin should be situated, all other pins are above this "reference point", each with an incremental step of 0.25 (as implemented in the code)
    
    
    procedure(cstAutoCreatePins(ok theListBox)
        let( (xCo yCo inputCVId)
        xCo = xCoord(cstLoadTrShowPinListBox.coord)
        yCo = yCoord(cstLoadTrShowPinListBox.coord)
        inputCVId = dbOpenCellViewByType("basic" "iopin" "symbol" "" 'r)
            if( ok then printf("Creation of pins: \n")
                foreach(choice theListBox->value
                     sprintf(namePin "%s" choice) 
                     schCreatePin(geGetEditCellView() inputCVId namePin "inputOutput" nil xCo:yCo "R0")
                     yCo = yCo + 0.25   
                     printf("Pin %s\n" namePin)          
                ) ; foreach
            else printf("Cancelled automated pins creation.")
            ) ; if
        )
    ) ; procedure
    
    ; Just generates the list of nets and call the list box, in which you select the nets to be generated as pins each with an 0.25 increment above each other.
    
    procedure(cstLoadTrShowPinListBox()
        cv = geGetWindowCellView()
        netNames = cv~>nets~>name
    
        cstLoadTrShowPinListBox.coord=hiGetCommandPoint()
        TrShowPinListBox(netNames)
    )

    Finally, I should point out that "cst" is one of our prefixes too! Better to use a prefix that begins with an uppercase letter, as then it won't clash with a Cadence prefix.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to Nicolas Callens

    Nicolas,

    I changed the code to use an enter function - so it prompts you to click on a point to start placing the pins. Better still would be to have started with the enterPoint and then have an options form to ask you the nets you wanted to create the pins for, but that was a little more work to create the form (as then you'd need to create the form and have a listbox field within the form rather than using hiShowListBox) - not much, but I didn't have time.

    I think the problem with using hiGetCommandPoint is that if the focus moves away from the window, it won't work.

    Here's the updated code:

    ; Generates List Box with callback cstAutoCreatePins(). TrShowPinListBox(netList) creates list box in which you can select the nets to be generated as pins by cstAutoCreatePins()
    
    procedure(TrShowPinListBox(netList)
        hiShowListBox(
            ?name gensym('cstPinListBox)
            ?choices netList
            ?callback 'cstAutoCreatePins    
            ?title "Net to pin transformation"
            ?multipleSelect t
            ?applyButton t
        ) ; hiShowListBox
    ) ; procedure
    
    
    ; When clicking on certain place in schematic of cellview, the point should be retrieved by hiGetCommandPoint(). This point should be the location where the first pin should be situated, all other pins are above this "reference point", each with an incremental step of 0.25 (as implemented in the code)
    
    
    procedure(cstAutoCreatePins(ok theListBox)
        let( (xCo yCo inputCVId pointList)
            when(ok
                pointList=enterPoint(?prompts list("Enter point for first pin"))
                unless(pointList ok=nil)
            )
            if( ok then printf("Creation of pins: \n")
                inputCVId = dbOpenCellViewByType("basic" "iopin" "symbol" "" 'r)
                xCo = xCoord(pointList)
                yCo = yCoord(pointList)
                foreach(choice theListBox->value
                     sprintf(namePin "%s" choice) 
                     schCreatePin(geGetEditCellView() inputCVId namePin "inputOutput" nil xCo:yCo "R0")
                     yCo = yCo + 0.25   
                     printf("Pin %s\n" namePin)          
                ) ; foreach
            else printf("Cancelled automated pins creation.")
            ) ; if
        )
    ) ; procedure
    
    ; Just generates the list of nets and call the list box, in which you select the nets to be generated as pins each with an 0.25 increment above each other.
    
    procedure(cstLoadTrShowPinListBox()
        cv = geGetWindowCellView()
        netNames = cv~>nets~>name
    
        TrShowPinListBox(netNames)
    )

    Alternatively, could use code similar to yours (I'm assuming you're calling cstLoadTrShowPinListBox() from a bindkey), but record the coordinate early in the code, like this:

    ; Generates List Box with callback cstAutoCreatePins(). TrShowPinListBox(netList) creates list box in which you can select the nets to be generated as pins by cstAutoCreatePins()
    
    procedure(TrShowPinListBox(netList)
        hiShowListBox(
            ?name gensym('cstPinListBox)
            ?choices netList
            ?callback 'cstAutoCreatePins    
            ?title "Net to pin transformation"
            ?multipleSelect t
            ?applyButton t
        ) ; hiShowListBox
    ) ; procedure
    
    
    ; When clicking on certain place in schematic of cellview, the point should be retrieved by hiGetCommandPoint(). This point should be the location where the first pin should be situated, all other pins are above this "reference point", each with an incremental step of 0.25 (as implemented in the code)
    
    
    procedure(cstAutoCreatePins(ok theListBox)
        let( (xCo yCo inputCVId)
        xCo = xCoord(cstLoadTrShowPinListBox.coord)
        yCo = yCoord(cstLoadTrShowPinListBox.coord)
        inputCVId = dbOpenCellViewByType("basic" "iopin" "symbol" "" 'r)
            if( ok then printf("Creation of pins: \n")
                foreach(choice theListBox->value
                     sprintf(namePin "%s" choice) 
                     schCreatePin(geGetEditCellView() inputCVId namePin "inputOutput" nil xCo:yCo "R0")
                     yCo = yCo + 0.25   
                     printf("Pin %s\n" namePin)          
                ) ; foreach
            else printf("Cancelled automated pins creation.")
            ) ; if
        )
    ) ; procedure
    
    ; Just generates the list of nets and call the list box, in which you select the nets to be generated as pins each with an 0.25 increment above each other.
    
    procedure(cstLoadTrShowPinListBox()
        cv = geGetWindowCellView()
        netNames = cv~>nets~>name
    
        cstLoadTrShowPinListBox.coord=hiGetCommandPoint()
        TrShowPinListBox(netNames)
    )

    Finally, I should point out that "cst" is one of our prefixes too! Better to use a prefix that begins with an uppercase letter, as then it won't clash with a Cadence prefix.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • Nicolas Callens
    Nicolas Callens over 7 years ago in reply to Andrew Beckett

    Thanks Andrew, I really appreciate the effort you have taken! I will try to implement it with the enterPoint function like you have suggested.

    Kind regards,

    Nicolas

    • 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