• 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. Help with bindkey (toggle) for auto / single via

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 5818
  • 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

Help with bindkey (toggle) for auto / single via

JJAP
JJAP over 1 year ago

Can you help combining this code into using 1 bindkey that can toggle between auto and single via?

procedure( viaAuto()
le0ViaForm->viaMode->value= "Auto"
leHiCreateVia()
)

procedure( viaSingle()
le0ViaForm->viaMode->value= "Single"
leHiCreateVia()
)

hiSetBindKey("Layout" "Shift<Key>o" "viaAuto()")
hiSetBindKey("Layout" "Ctrl<Key>o" "viaSingle()")

  • Cancel
Parents
  • JJAP
    JJAP over 1 year ago

    I've done it by doing this: 

    procedure( via_Autosingle_toggle()

    if(
    le0ViaForm->viaMode->value == "Single"
    then
    le0ViaForm->viaMode->value= "Auto"
    printf("Auto Via\n")
    else
    if(
    le0ViaForm->viaMode->value == "Auto"
    then
    le0ViaForm->viaMode->value= "Single"
    printf("Single Via\n")
    );if
    );if
    leHiCreateVia()
    );procedure

    hiSetBindKey("Layout" "Shift<Key>F3" "via_Autosingle_toggle()")

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • JJAP
    JJAP over 1 year ago

    I've done it by doing this: 

    procedure( via_Autosingle_toggle()

    if(
    le0ViaForm->viaMode->value == "Single"
    then
    le0ViaForm->viaMode->value= "Auto"
    printf("Auto Via\n")
    else
    if(
    le0ViaForm->viaMode->value == "Auto"
    then
    le0ViaForm->viaMode->value= "Single"
    printf("Single Via\n")
    );if
    );if
    leHiCreateVia()
    );procedure

    hiSetBindKey("Layout" "Shift<Key>F3" "via_Autosingle_toggle()")

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

    Here's a cleaner approach that doesn't involve interacting with the form name (which won't exist if you've never done a create via in the session) and may be named differently if you have more than one technology in use in the session:

    procedure( CCFtoggleAutoSingleVia()
      case(leGetEnv("viaMode")
        ("Single" leSetEnv("viaMode" "Auto"))
        ("Auto" leSetEnv("viaMode" "Single"))
      )
      leHiCreateVia()
    )
    
    hiSetBindKey("Layout" "Shift<Key>F3" "CCFtoggleAutoSingleVia()")

    This works by looking at the env var that controls the form.

    Andrew

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

    Thanks for simplifying this, I'm new to skill and have only done if/else, I'm trying to learn case and condition. 

    • 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