• 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. Can I remove session from preSaveOceanScript Skill function...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 9035
  • 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

Can I remove session from preSaveOceanScript Skill function?

ChristophK
ChristophK over 3 years ago

I've code that registers a custom skill function with

envSetVal("asimenv.misc"  "preSaveOceanScript" 'string  "MyFunc")

MyFunc is defined to have session and fp as arguments. However, session is unused. Can I remove session argument? Or has MyFunc to obey a certain signature?

documentation is a bit vague as it write "use follwoing syntax" and not "procude must have exactly two arguments"

preSaveOceanScript

This procedure is executed before the ocean script is created, when the Save Ocean Script option is enabled. You can add your own customized code here. Use the following syntax to specify the SKILL functions/procedures:

MYfirstProc( session fp )

https://support.cadence.com/apex/techpubDocViewerPage?path=oceanref/oceanrefICADVM20.1/oceanrefTOC.html

Thanks for clarification.

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

    As is common with callback procedures where you just specify the function name, it must follow a well-defined signature. Otherwise how would the caller of the function know which arguments are expected? So you must define the function to accept two arguments.

    By convention, if you're not using the argument you can prefix it with an underscore:

    procedure(MyFunc(_session fp)
      fprintf(fp "; some additional comment\n")
    )

    The underscore doesn't alter anything about how the code works, but the convention is checked by SKILL Lint - so if you have an argument to a function that's unused within the function, SKILL Lint would normally flag this; if the argument is prefixed by an underscore then SKILL Lint won't complain about the argument being unused.

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    As is common with callback procedures where you just specify the function name, it must follow a well-defined signature. Otherwise how would the caller of the function know which arguments are expected? So you must define the function to accept two arguments.

    By convention, if you're not using the argument you can prefix it with an underscore:

    procedure(MyFunc(_session fp)
      fprintf(fp "; some additional comment\n")
    )

    The underscore doesn't alter anything about how the code works, but the convention is checked by SKILL Lint - so if you have an argument to a function that's unused within the function, SKILL Lint would normally flag this; if the argument is prefixed by an underscore then SKILL Lint won't complain about the argument being unused.

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • ChristophK
    ChristophK over 3 years ago in reply to Andrew Beckett

    Thanks for the fast and explicit clarification. Also for resolving the linter warning.

    • 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