• 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. Specify input options(flag) and values to skill code

Stats

  • State Suggested Answer
  • Replies 5
  • Answers 1
  • Subscribers 19
  • Views 3437
  • Members are here 0
More Content

Specify input options(flag) and values to skill code

BRC7
BRC7 over 3 years ago

Hi,

I'm running a skill code from Allegro using "skill load "skillcode.il"" and I would like to know if there is an option to pass command line arguments to the code?

Example:

skill load "skillcode.il" -file "skilltest.txt" 

I could achieve this by loading the code first and then calling the function that works with filename but that is not what I'm looking for. The input will be used by multiple functions inside the code.

Another simple use case would be skill load "skillcode.il" -help which would ideally print help for the script.

Does skill allow this type of input loading ? If not, are there any workarounds?

Thanks!

  • Cancel
  • Sign in to reply
Parents
  • JuanCR
    0 JuanCR over 3 years ago

    Hey there. When you say that the input would be used by multiple functions inside the code, do you mean that you want to run multiple functions at the same time? Seems odd to me

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

    I do not want to run multiple functions at same time. The input options (script arguments) that I specify would essentially be like a global variable that would be used by multiple functions. Hope this clarifies?

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

    No, I'm sorry. I still don't see 100% clear what you want to do ... but I checked the syntax for the load function and there is no mention to additional arguments. So in principle the answer to your question is that it cannot be done. However, if what you want to do is to save time because the same argument is used by several functions, you could (like you say) first load the skill file, and then create/call a function that will load the values that you'll use with all those other functions. Not sure if I'm making myself clear. It would be a preliminary function that will create these global values for other functions to use. Would that work for you?

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

    I already tried what you're proposing but that's kind of two step process. Here's a realistic scenario that I'm trying to work with:

    I want to use a -debug flag which will print certain information throughout the process. If the flag is not specified, it does not print that information. This way, I don't have to keep adding/commenting print lines every time I want to debug the code.

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

    Define a procedure debugPrintf which takes in any number of arguments and

    prints the arguments when the global debug variable is set to true as shown below.

    toDebug=t
    (procedure debugPrintf(@rest args)
      (if toDebug
       apply( 'printf args )
      )
    )

    Calling the function is as follows.

    debugPrintf("Variable value is %L\n" cell1)

    bebugPrintf("Found subclass %s for class %s\n" value className)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Kirti Sikri
    0 Kirti Sikri over 3 years ago in reply to BRC7

    Define a procedure debugPrintf which takes in any number of arguments and

    prints the arguments when the global debug variable is set to true as shown below.

    toDebug=t
    (procedure debugPrintf(@rest args)
      (if toDebug
       apply( 'printf args )
      )
    )

    Calling the function is as follows.

    debugPrintf("Variable value is %L\n" cell1)

    bebugPrintf("Found subclass %s for class %s\n" value className)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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