• 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. Cadence SKILL/Ocean loading and saving dc operating point...

Stats

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

Cadence SKILL/Ocean loading and saving dc operating point in dc sweep simulation

MatthewT
MatthewT over 10 years ago

Hi,

I looked into web and cadence manuals, but I cannot find the answer to my question. I think I saw it some time ago on our forum here, but I cannot find it right now.

I'm running dc simulation:

analysis('dc ?dev "/voltage_dc_source"  ?param "dc"  ?start "value_low" ?stop "value_high"  ?step "1m" )
envOption(
          'analysisOrder  list("dc")
); envOption
run()


I would like to have faster convergence. I found following commands:
- write
- writefinal
- readns

I can run .tran simulation with "?writefinal" attribute pointing to the file where .op of the circuit will be saved and then load it for dc simulation:

analysis('tran ?stop "500n" ?writefinal "tran.fc")
envOption(
    'analysisOrder  list("tran")
); envOption
run()

(...)

analysis('dc ?dev "/voltage_dc_source"  ?param "dc"  ?start "value_low" ?stop "value_high"  ?step "1m" ?readns "tran.fc" )
envOption(
    'analysisOrder  list("dc")
); envOption
run()    


however in such a case, every dc simulation uses the same input tran.fc file. The question is, is it possible to:
1. run 1st dc sweep
2. save calculated dc operating point
3. start 2nd sweep
4. load dc operating point from the 1st sweep
5. run 2nd sweep
6. save dc operating point of 2nd sweep
7. and so on ...

?

  • Cancel
  • skillUser
    skillUser over 10 years ago

    Hi,

    It looks as though you want to run a certain number of DC operating point analyses (I'm not sure if this is fixed or could be variable) but you might want to run your steps in a loop (for, foreach, while) something like the following:

    ;; initial DC op run first, before this loop
    for(i 1 3
      analysis('tran ?stop "500n" ?writefinal sprintf(nil "tran%d.fc" i))
      envOption('analysisOrder  list("tran")); envOption
      run()
    
      (...)
    
      analysis('dc ?dev "/voltage_dc_source"  ?param "dc"  ?start "value_low" ?stop "value_high"  ?step "1m"
        ?readns sprintf(nil "tran%d.fc" i))
      envOption('analysisOrder  list("dc")); envOption
      run()
    ); end of for loop
    

    The file name is generated depending on which iteration you are on.

    Hopefully this is helpful to you.

    Regards,

    Lawrence.

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

    I wasn't sure if what Lawrence has suggested was quite what you were after, but maybe all you need is to add ?write "tran.fc" to the dc analysis? It's fine to have the same filename for both readns and write (whether it is write or writefinal for the dc analysis depends on whether you want to re-use the initial dc or the final dc operating point from the dc sweep).

    Note you can also just use delete('analysis 'tran) to remove the tran analysis after running it the first time, rather than having to set the analysisOrder.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MatthewT
    MatthewT over 10 years ago

    Hi,

    Thank you both for your suggestions. However, I think I was not clear in my first post. Want I would like to achieve is to save dc operating point for every step of dc simulation, where a voltage source is swept from one value to another with a given step. Not for every dc sweep.

    For example, if we have a dc simulation where voltage_dc_source is swept from 0 V to 1 V with step of 1m:

    analysis('dc ?dev "/voltage_dc_source"  ?param "dc"  ?start "0" ?stop "1"  ?step "1m" )


    is it possible to save a dc operating point for 0 V, then load it for 0.01 V, save dc op point for 0.01 V and load it for 0.02 V and so on?

    I did simulations and I see that when dc operating point is saved for tran simulation (using "writefinal") and then is read by "readns" in dc simulation it helps to run the analysis faster. However, the same dc operating point is used for every dc step. While we calculate new dc operating point for every dc step we could use them one after another for following dc steps as in the example above. DC operating point for one step is closer to the ideal for following dc step, while initial tran operating point may not. Hence, the simulation should run even faster.

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

    In general a dc sweep will re-use previous information as a starting point - you can't save a "nodeset" for each point and re-use a the next point. Perhaps all you need to do is add ?restart "no" to the analysis function?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MatthewT
    MatthewT over 10 years ago

    Hi Andrew,


    I looked into manuals for "?restart" attribute, but I am not sure what it does. To quote "Virtuoso Spectre Circuit Simulator Reference October 2014" manual:

    "restart=yes        Restart from scratch if any condition has changed. If not, use the previous solution as initial guess. Possible values are no and yes."

    "any condition" refers also to dc step?

    I tried following cases:

    1. analysis('dc ?dev "/voltage_dc_source"  ?param "dc"  ?start "low" ?stop "high"  ?step "1m" )

    2. analysis('dc ?dev "/voltage_dc_source"  ?param "dc"  ?start "low" ?stop "high"  ?step "1m"  ?readns "tran.fc")

    3. analysis('dc ?dev "/voltage_dc_source"  ?param "dc"  ?start "low" ?stop "high"  ?step "1m"  ?restart "no"  )

    4. analysis('dc ?dev "/voltage_dc_source"  ?param "dc"  ?start "low" ?stop "high"  ?step "1m"  ?readns "tran.fc"  ?restart "no" )

    And case 2 seems to be equal to 4, while case 1 seems to be equal to case 3.

    1 and 3 are much slower than 2 and 4.

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

    I don't think in general that restart is going to make much difference in this case. The operating conditions would always be changing here, and so it's always going to start from the previous initial guess.

    The difference you're seeing is purely down to the initial DC operating point - the ?readns is allowing it to compute the initial operating point based on the transient solution. After that, each point in the DC sweep is probably close to the previous one and hence it converges quickly. That's what I would have expected - so there's going to be no benefit of using a nodeset between points in the sweep (not that you can do it anyway).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MatthewT
    MatthewT over 10 years ago

    The difference is not only in the first dc step calculations. It is clearly visible that the simulation in case 2 is faster than in case 1 for next steps. Especially, when the simulator meets convergence problems and switches homotopy methods. It does not look like the next dc step uses an operating point calculated in a previous dc step, what most probably would be ideal. If it was so, there would be no difference between cases 1 and 2 except the first dc step operating point calculations.

    • 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