• 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. creating PINs from selected nets in schematic

Stats

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

creating PINs from selected nets in schematic

naresh9005
naresh9005 over 1 year ago

Hello, I'm new to skill coding and need to wire one skill code to generate pins in the schematic based on selected nets.

procedure(CreatePinFromselNet()

ss = geGetSelectedSet()
netname = ""
netname1 = ""
foreach(sss ss
netname1 = sss~>net~>name
netname = strcat(netname "\n" netname1)
)

printf("You can make the following pins in the schmeatic by clicking wherever you want %c" netname)
schHiCreatePin( ?terminalName netname ?direction "input" ?usage "schematic" )
netname = nil
hiiToggleEnterForm(schCreatePinForm)

This script fails when we select bus nets like net<0:5>, net1:10>, etc. 

please help us, how to create pins from the selected bus -nets as well ? 

Regards 

Naresh 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    Naresh,

    Not sure why you are using "\n" to concatenate all the names together on the strcat() line. If you change it to " " (a space) then it will work fine.

    Or you could simply replace the foreach loop with:

    netname=buildString(ss~>net~>name)

    which is simpler still (of course, there's no error checking that everything selected has a net name - you could solve that by adding a setof to filter. I also added some local variable declarations and also enqueued the toggling of the enter form:

    procedure(CreatePinFromselNet()
      let((ss netname)
        ss = geGetSelectedSet()
        netname = buildString(setof(nn ss~>net~>name stringp(nn)))
    
        printf("You can make the following pins in the schematic by clicking wherever you want %s" netname)
        hiEnqueueCmd("hiToggleEnterForm(schCreatePinForm)")
        schHiCreatePin( ?terminalName netname ?direction "input" ?usage "schematic" )
      )
    )

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • naresh9005
    naresh9005 over 1 year ago in reply to Andrew Beckett

    Thank you Andrew ... 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • naresh9005
    naresh9005 over 1 year ago in reply to Andrew Beckett

    Thank you for your response. I can now generate pins form the selected bus nets. 

    while creating this pin , How can I add prifix or sufix to each pin ? 

    To add the prifix, I'm replacing stringp(nn) with strcat("prix" nn) in the above script, but it's not working. 

    could you please help how can i do this ?

    Regards 

    Naresh 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 1 year ago in reply to naresh9005

    Hi Naresh,

    I strongly advise you to follow some SKILL training to understand what is going on in Andrew's script, you can find many articles in Cadence support

    This one is a good starting point: Where do I look for SKILL example codes, tutorials, and trainings?

    You should at least lookup and understand the following basic functions : 

    list
    quote ‘
    cons
    car
    cdr
    nth
    progn
    prog1
    let
    if
    when
    unless
    cond
    case
    foreach
    setof
    exists
    forall
    concat
    strcat

    To do so, in Virtuoso main window (CIW) you go to the banner menu 'Tools' -> 'SKILL API Finder' and you can obtain the documentation for each function

    You can now see that `setof` is a function to filter a list using a predicate and that `stringp` is a predicate to check that the provided object is a string

    By doing : 

    netname = buildString(setof(nn ss~>net~>name stringp(nn)))

    Andrew is creating a concatenated string containing all valid names from ss~>net~>name

    You cannot just replace `stringp` by `strcat` because those two functions are not doing the same thing at all!

    What you can do is : building the list of prefixed names, and then concatenate them.

    ss = geGetSelectedSet()

    ;; Filter empty names
    netname = setof(nn ss~>net~>name stringp(nn))

    ;; Remove duplicated names (you might want to do that)
    netname = removeListDuplicates(netname)

    ;; Prefix names
    netname =  foreach( mapcar nn netname strcat("prix" nn) ) 

    ;; Build final string
    netname = buildString( netname )

    Note that this is not the more efficient way to do it (you browse your list several times) however it is quite clear to do it step by step and also you would have to select a huge amount of objects before having performances issues

    Hope this helps,

    Aurélien

    • Cancel
    • Vote Up +1 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