• 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. Stop Simulation by Itself

Stats

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

Stop Simulation by Itself

gilberts
gilberts over 15 years ago

Is there a way to stop a simulation after a certain condition have been met? - ( VerilogA maybe? )

 

Example:

I setup a transient simulation to run for 50m secons.

The circuit oscillates for an unknown frequency, can be too high or too low.

In an alter, when the frequency is too high, the simulation time gets too long

and the results are not anymore necessary.

I only need to complete 20 cycles to analyze the results,

so I want to force stop/kill the simulation after completing 20 cycles on the output.

 

Thanks.

Gilbert

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

    Hi Gilbert,

    This is the kind of thing that can be done with Spectre MDL, but a VerilogA based solution is quite reasonable too. You could use $finish or $finish_current_analysis for this.

    See SourceLink Solutions 11556554 and 11488490.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • drdanmc
    drdanmc over 4 years ago in reply to Andrew Beckett

    In the first of those links it says:

    "1. $finish_current_analysis should only be used with transient and pss analysis. It should not be used during ac analysis."

    could you expand on that?  I've only ever used this trick (Verilog-A to stop a simulation early) with transient analysis but since $finish is like a hard stop (including additional analysis) I avoid it.  But then again I'm not sure what event could be triggered in an AC analysis anyway.

    Adding this onto this thread in case others get here searching for $finish/$finish_current_analysis.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to drdanmc
    drdanmc said:
    could you expand on that?

    The reason is that when you do a small-signal analysis, it's not really executing the code in the model during the analysis. Instead, the circuit is linearised using the equations in the model at the beginning of the analysis (although that may happen at other points during the sweep too if something other than frequency is swept in the ac analysis which results in a different operating point), and then it simulates the linear model. So the sequential code in the model doesn't get run and hence there wouldn't be an opportunity to trigger something to $finish/$finish_current_analysis.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to drdanmc
    drdanmc said:
    could you expand on that?

    The reason is that when you do a small-signal analysis, it's not really executing the code in the model during the analysis. Instead, the circuit is linearised using the equations in the model at the beginning of the analysis (although that may happen at other points during the sweep too if something other than frequency is swept in the ac analysis which results in a different operating point), and then it simulates the linear model. So the sequential code in the model doesn't get run and hence there wouldn't be an opportunity to trigger something to $finish/$finish_current_analysis.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Frank Wiedmann
    Frank Wiedmann over 4 years ago in reply to Andrew Beckett

    So maybe the article should rather say "It will not be effective during ac analysis."

    • 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