• 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. Own SKILL function available in calculator but "undefined...

Stats

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

Own SKILL function available in calculator but "undefined" when called in ADE ?

JorisLambrecht
JorisLambrecht over 10 years ago

Hello all,

I wrote two small functions in SKILL (see below) and added these to my .cdsinit. They work in the command line and in the calculator, but when they are called for the calculation of design variables, I get this error (even if I try to define them again in the lines above the line where they are called):

ERROR (SFE-1996): "input.scs" 11: Parameter `phi': Function `mlinc2phi' is undefined.

In the analysis I want to execute, a variable "vin" is swept and two other variables should be recalculated for every value of "vin". I thought this would be possible by:

A. In .cdsinit:

procedure( mlinc2phi( vin vinref)
if( vin>vinref
      then
            acos(vin)*(180/acos(-1))
      else
            acos(vin/vinref)*(180/acos(-1))
      )
) ; procedure

procedure( MySpecialFunctionCBPhi()
calSpecialFunctionInput( 'mlinc2phi nil )
)

calRegisterSpecialFunction(
list( "mlinc2phi" 'MySpecialFunctionCBPhi )
)

procedure( mlinc2vdc( vin vinref vdc_orig)
if( vin>vinref
      then
            vdc_orig
      else
            vdc_orig*vinref
      )
) ; procedure

procedure( MySpecialFunctionCBVdc()
calSpecialFunctionInput( 'mlinc2vdc nil )
)

calRegisterSpecialFunction(
list( "mlinc2vdc" 'MySpecialFunctionCBVdc )
)

B. And then input.scs:

simulator lang=spectre
global 0
parameters vdcorig=1 vinref=0.7 vin=0.65 rl=50 vgsmin=0.4 dt=0.35 mult=300 \
    fc=1.5e+10 vgsmax=1.2 phi=mlinc2phi(vin,vinref) \
    vdc=mlinc2vdc(vin,vinref,vdcorig)

I tried to do this in a .ocn-script as well, but without success.

Even if the functions were found, would the values of the variables phi and vdc be recalculated for every sweep value of "vin" ?

Thank you,

Greetings,

Joris

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

    Joris,

    This won't work, because you're defining a SKILL function which can be used in the calculator or in ADE, but you are then calling it in spectre, not ADE. Spectre won't understand the SKILL function.

    You can define an equivalent function in spectre using a spectre user defined function. Create a file called (say) myfunctions.scs containing:

    //
    real mlinc2phi(real vin,real vinref) {
       return vin>vinref ? acos(vin)*(180/M_PI) : acos(vin/vinref)*(180/M_PI)
    }
    real mlinc2vdc(real vin,real vinref,real vdc_orig) {
       return vin>vinref ? vdc_orig : vdc_orig*vinref
    }

    Note that I used 180/M_PI rather than 180/acos(-1) - spectre has built-in constants (see "spectre -h constants"), but you could use acos(-1) if you prefer.

    Then include this file by Setup->Model Libraries in ADE. You can then reference these functions in your variables in ADE, and spectre will know how to resolve them.

    Defined this way, if vin is swept, the results of the functions will be re-calculated per point in the sweep.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Joris,

    This won't work, because you're defining a SKILL function which can be used in the calculator or in ADE, but you are then calling it in spectre, not ADE. Spectre won't understand the SKILL function.

    You can define an equivalent function in spectre using a spectre user defined function. Create a file called (say) myfunctions.scs containing:

    //
    real mlinc2phi(real vin,real vinref) {
       return vin>vinref ? acos(vin)*(180/M_PI) : acos(vin/vinref)*(180/M_PI)
    }
    real mlinc2vdc(real vin,real vinref,real vdc_orig) {
       return vin>vinref ? vdc_orig : vdc_orig*vinref
    }

    Note that I used 180/M_PI rather than 180/acos(-1) - spectre has built-in constants (see "spectre -h constants"), but you could use acos(-1) if you prefer.

    Then include this file by Setup->Model Libraries in ADE. You can then reference these functions in your variables in ADE, and spectre will know how to resolve them.

    Defined this way, if vin is swept, the results of the functions will be re-calculated per point in the sweep.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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