• 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. Allegro X Scripting - Skill
  3. How to add a (working) Cancel or Done popup option to a...

Stats

  • State Verified Answer
  • Replies 4
  • Subscribers 17
  • Views 7390
  • Members are here 0
More Content

How to add a (working) Cancel or Done popup option to a SKILL program ?

soll
soll over 3 years ago

Hello :)

I am writing a short SKILL program that creates Match Groups using pin pairs. I would like to add a cancel and done option in the right click pop up menu, but I have trouble getting it to work.

First, let me explain what the program does :

  • it asks the user to select a first symbol
  • it asks the user to select a second symbol
  • there is some computation to find the nets that these symbols have in common
  • it asks the user to input a name for the match group to be created (using an inline form)
  • it creates pin pairs for all the nets in common (except those with the VOLTAGE property
  • it creates the match group.

It works quite well (when used as intended), but I found that the axlSingleSelectPoint() procedure is quite sensitive and if you don't use it correctly (for instance if you try to use an other command like move, while Allegro is waiting for the selection) it can freezes Allegro quite easily.
I also noticed that after the program completes, it stays in a "in command" state. What I mean by that is that if you go to constraint manager directly after using the program (or any program I wrote with SKILL), you will get the error message "Host application is busy. Do you wish to finish the current command ?" (you probably know what I mean ; I have come to hate this message from the bottom of my heart).

I used the simple example provided by eDave in this thread. It kind of works : when I use the Cancel option i just created, it cancel the selection process, but then it goes to the next step in the program. Is there a way to just cancel the whole program ? Like with the return() function used with prog() ?

As for the done option, it seems to do the exact same thing than the cancel option : it jumps to the next part of the program. I would like the done function to exit the program once it has done all its stuff. Maybe a popup option is not the right way to do it, if so, could anyone suggest me a better way to do that ?

I am using Allegro 17.2, app mode is None.

You can find the program here : https://github.com/soll123/easyMG/blob/main/easyMG.il

DISCLAIMER : I am absolutely not a developer. This program will most probably contain strange things. Maybe the way I laid out the procedures or variables isn't good : don't hesitate to correct me, don't hesitate to tell me if I did something wrong here, even if it does not relate directly to the main question of this thread. I started programming using SKILL a few weeks ago, please be kind :p
If you find that program useful, don't hesitate to use it ! I wrote it after a colleague of mine worked on a board with 3 CPU hooked up to 8 32bit memory chip each, for a grand total of 768 pin pairs to set up. It was a real nightmare.

Thank you and please have a great day !

  • Cancel
  • Sign in to reply
  • eDave
    +1 eDave over 3 years ago

    Firstly - well done. That's a good effort for someone with little experience in Skill scripting.

    Without examining the code too closely, you can probably solve your problem by registering the command and running it from the command console (not the Skill window).

    Use axlCmdRegister("easyMG" 'easyMG ?cmdType "general")

    If you want this to loop you will need a while statement before "; SELECT SYMBOLS". This can be a bit tricky so look at a few examples.

    As for other feedback:

    1/ Keep your variables local. Use let and list ALL the variables that you use locally in the function. You don't need to initialise any local variables to nil or('().

    2/ Try to use an upper case letter for the first character of your functions (eg "GetSymbol"). This will ensure that you code will never conflict with any internal Cadence functions. Better still give them a prefix like "EasyMG_getSymbol"

    3/ "!= nil" is unnecessary in Skill and this should work: when(assoc('VOLTAGE axlDBGetProperties(net '(user allegro))), remd(net netListCommon))

    4/ As above, use "when" (or "unless") if there is no "else" in your if statement.

    5/ It's good practice to use a "case" statement to handle your callback loop.

    Good luck!

    Dave

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • soll
    0 soll over 3 years ago in reply to eDave

    Hello,
    Thank you very much for the kind words, and for taking the time to answer ! I'm sorry I could not come back earlier, I was out of work and forgot to bring my Cadence Community password with me.

    I tried registering the command using axlCmdRegister("easyMG" 'easyMG ?cmdType "general"), it completely crashed the Allegro :p ("Allegro is not responding"). I wondere, could it have something to do with the location of the file ? My company use a very specific environment for all that kind of things (programs, scripts, custom menus), that does not seem to be the same than what I see in the users manual.

    Concerning you other feedbacks, I will try to implement them all in a second version of this program and post it here. I would love to do it now but I have to finish a board, as soon as I finish it, I will go back to SKILL programming (I am hooked).

    Thanks again !

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • soll
    0 soll over 3 years ago

    So after a bit of time, here is an updated version of this program.

    I followed eDave's recommendations and now everything works quite well.

    It is not possible to cancel the program before it prints the Match Group creation form, but it's not really a problem.

    Here is the updated version : https://github.com/soll123/easyMG/blob/main/EasyMG.il

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • soll
    0 soll over 3 years ago

    Hello !

    To anyone who might be interested, here is the latest version of EasyMG.il :)

    It now have a better UI : you can choose the nets you want to add to the match group and filter them a little bit. It works great. As always, if you have any idea how to make it better, don't hesitate to tell me !

    https://github.com/soll123/easyMG/blob/main/EasyMG.il

    EasyMG UI picture

    Thanks again to eDave for the advices !

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Cadence Guidelines

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