• 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 Design
  3. analysis

Stats

  • Locked Locked
  • Replies 29
  • Subscribers 125
  • Views 22270
  • 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

analysis

yeong
yeong over 12 years ago
hello
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    You seem to have removed the contents of your post. Was that intentional?

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • yeong
    yeong over 12 years ago

    Hello,

    I dont know what happened then.

    I want to ask about oceanscript to run corner.

    Setup to run for -40, 27 150degC separately. There is no problem when I run 27deg and 150, however in -40deg, it is not able to run.

    error mgs: is unbound variable - temp

    error while loading file - "xxx.ocn"

    problem resolve if i remove temp in ocnPrint and use temp instead of foreach loop?

    How can I run -40degC and print the result?

     

    Here is my part of my script; 

    myCors=list("ff_lib" "ss_lib")

    for each(corner myCors

    modelFile(

    list("/xxxxx" corner)

    foreach(y1 '(-40)

    temp(y1)

    run()

    vgs=OP("/I212/M12' "vgs") 

    ocnPrint("corner" corner "temp" y1 "vgs" vgs)

    ) 

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 12 years ago

    Dear Yen,

     Have you tried defining y1 as a double prior to the foreach() statement? Specifically, prior to your foreach() statement, use a statement such as:

     

    y1 = -40.0

    foreach(y1 '(27.0 150.0 -40.0)

    ... 

    In this fashion, y1 is declared as a double. I have experienced similar errors if y1 is not defined prior to its use in temp().

     

    Shawn 

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • yeong
    yeong over 12 years ago

    Hello Shawn,

     I have used the same script for 27 and 150 deg. Both works fine. 

    I have define temp previous which is not included in the scipt in my first post. 

    this is my full script. 

    ocnWaveformTool( 'wavescan )
    simulator( 'spectre )
    out=outfile("test.txt" "w")
    design(     "/xxx/spectre/schematic/netlist/netlist")
    resultsDir( "/xxx/spectre/schematic" )
    analysis('ac ?start "1"  ?stop "1G"  ?dec "50"  )
    analysis('dc ?saveOppoint t  )
    desVar(       "cap_factor" 1  )
    desVar(       "iled" 16m      )
    desVar(       "i" 848u  )
    option(     'temp  "150.0"
    )
    saveOption( 'subcktprobelvl "5" )
    temp( 150.0 )
    myCors=list("ff_lib" "tt_lib" "ss_lib")
    foreach(corner myCors
    modelFile(
    list("/xxx.scs" corner)
    )
    foreach(y1 '(150)
    temp(y1)
    foreach(y2 '(1m 10m)
    desVar("iled" y2)
    foreach(y3 '(1u 5u)
    desVar("i" y3)
    run()

    differnetial_psrr = dB20((VF("/psrr") - VF("/ref")))
    plot( differnetial_psrr ?expr '( "differnetial psrr" ) )
    differential_psrr_3dB_BW = cross(dB20(VF("/psrr")) (value(dB20(VF("/psrr")) 1) + 3) 1 "either" nil nil)
    ;plot( differential_psrr_3dB_BW ?expr '( "differential_psrr_3dB BW" ) )
    differential_psrr_dB_DC = value(dB20((VF("/psrr") - VF("/ref"))) 1)
    ;plot( differential_psrr_dB_DC ?expr '( "differential_psrr_dB_DC" ) )
    differential_psrr_dB_max = ymax(dB20((VF("/psrr") - VF("/ref"))))
    ctr = VAR("ctr")
    iled = VAR("iled")

    ocnPrint("corner" corner "temp" y1 "iled" iled "ctr" ctr "differnetial_psrr_dc" differential_psrr_dB_DC "differential_psrr_dB_MIN" differential_psrr_dB_max ?output out)

    )

     

     y 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    smlogan said:

    y1 = -40.0

    foreach(y1 '(27.0 150.0 -40.0)

     

     

    Shawn - this is absolutely unnecessary. SKILL doesn't require you to "declare" variables - and the type of a variable may change over time. In fact the foreach will cause a local variable y1 to be defined for the duration of the foreach - when the foreach completes, the previous value will become visible again (or if it was not defined, it will be unbound). That's fine...

    I looked at the latest code posted by Yen, and it works OK (I had to adjust it to reflect signal names in my own testcase ,but apart from that it worked fine).

    The most likely issue was that you may have accidentally had:

     temp (y1)

    rather than

     temp(y1)

    i.e. a space between the temp and the open parenthesis. This would have caused temp to be seen as a variable, followed by a function call to a function called y1. And that would result in:

    *Error* eval: unbound variable - temp
    *Error* load: error while loading file - "forum.ocn" at line 43

    Regards,

    Andrew.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • yeong
    yeong over 12 years ago

    Hello Andrew,

    There is no space btw temp and the open parenthesis.

    Does it work for you if you set the temp to -40, ie

    .....
    foreach(y1 '(-40)
    temp(y1)
    ....

    I see the following:

    *Error* for each: second argument must be a list -40
    *Error* load: error while loading file - "ps.ocn"

     

    No problem if i run the following:

     .....
    foreach(y1 '(-40 150)
    temp(y1)
    ....

    or  

     .....
    foreach(y1 '(150)
    temp(y1)
    ... 

    I'm running each temp as it as because for each temp has different i variable.

    y 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Ah, I see. This seems to be an odd quirk of the parser. I don't really see a good reason for this - it seems peculiar to me.

    Replace '(-40) with list(-40) and it will then work fine.

    You can see this directly if you do:

    '(-40) => -40
    '(40) => (40)

    I'll have a chat with R&D about this. I think it's been this way forever though!

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    I checked, and it's to allow removal of (potential) ambiguity between a binary and unary minus. So you can then use 1+(-40). Not sure it's strictly essential, but that's the way it is. It will only affect a quoted list of a single negative number - and using list() is a reasonable workaround.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 12 years ago

     Hi Andrew,

     

    This is exactly the issue I have encountered numerous times. It was my motivation for suggesting declaring the variable. I fully realize that declaring a variable is  not necssary - but this is how I workaround the issue you note.

     

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Shawn,

    But your workaround cannot possibly make a difference. Sorry!

    I'm not sure which issue you're referring to - but it won't help...

    Regards,

    Andrew.

    • 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