• 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 22277
  • 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
  • yeong
    yeong over 12 years ago

    Andrew,

    Everything works fine. Thanks.

    Another question: 

    In ocean, how can i save the all corners simualtion results in a directory and retrieveit later? I tried to plot the from result brower, but it only save the last run.   

    y 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • yeong
    yeong over 12 years ago
    i used this to group model corners togther, but what should i do for the variable, such as temp, iled, etc for model corners i use: myResultsDir=strcat("/xxx" corner) resultsDir(myResultsDir) y
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Why not just use something like:

    sprintf(myResultsDir "/xxx%s_%d%g" corner temp iled)

    Regards,

    Andrew.

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

    Andrew,

    This works, however the file name doesnt match the variables used. 

    sprintf(myResultsDir "/xxx%s_%d%g" corner temp iled) 

     I have to use  sprintf(myResultsDir "/xxx%s_%d%g" corner y1 y2) instead. In this case the file name matches the variable.

     Any reason why? 

     

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

    Andrew,

    I want to print my output as follows:

    corner temp iled i differential_psrr etc etc
    tt_lib    -40   1m 1u 60.34  xx xx  

    I tried to use fprintf instead of ocnPrint. Simulation completed without error, however there is no data in the output file. There is no problem using ocnPrint, just need to organise it a bit in excel.

    This is what i use:

    fprintf(out "corner\ttemp\tiled\ti\tdifferential_psrr\n")

    fprintf(out "%s\t%d\t%g\t%g\t%g\%g\n") 

    Also, I have quite a bit of expressions, how can i output the data in a more efficient manner?

    y 

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

    yeong said:

     I have to use  sprintf(myResultsDir "/xxx%s_%d%g" corner y1 y2) instead. In this case the file name matches the variable.

     Any reason why? 

     

    This is because the SKILL variables in your script are called y1 and y2. I wasn't looking at your previous code when I replied - I assumed you had SKILL variables (not design variables, which correspond to spectre parameters) called iled and temp etc.

    Regards,

    Andrew.

     

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

    yeong said:
    fprintf(out "%s\t%d\t%g\t%g\t%g\%g\n") 

    If this is what you are using, it ought to fail with an error, because there are no arguments corresponding to each % keyword in the formatting string. 

    Andrew.

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

    sorry, i forgot to include the arguments in the post.

    fprintf(out "%s\t%d\t%g\t%g\t%g\%g\n" corner temp y1 y2 differential_psrr ) 

    the arguments as declared in the script previously.

     

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

    this is the script. simulation runs fine, but no data in test.txt

    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)

    sprintf(myResultsDir "/xxx%s_%d%g" corner y1 y2) 
    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")

    fprintf(out "corner\ttemp\tiled\ti\tdifferential_psrr\n")
    fprintf(out "%s\t%d\t%g\t%g\t%g\%g\n" corner temp iled y3 differential_psrr )

    ))))

     

    y 

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

    Probably this is because you're not closing the file. In SKILL (as in many other languages), writing ASCII files is buffered (for efficiency reasons) so that it doesn't flush to disk until the buffer is full (or when the file is closed).

    So two choices:

    1. Call close(out) at the end (in fact you should do this anyway to avoid having lots of open file handles lying around)
    2. If you want the output to update more frequently (for example, so that you can see the file contents during a loop where running the simulations takes some time), you can flush the buffers by calling drain(out)

    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