• 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. Verilog-A, one time execution function

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 125
  • Views 20194
  • 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

Verilog-A, one time execution function

samer1
samer1 over 8 years ago

Hi, 

I am developing a verilog-A model for a device. I want to write a function that is executed only one time in the simulation during the device first transition from high resistive state to a low resistive state. I looked at analog events but did not find a function that provides this functionality I want. I tried to do it using an if..else statement but it gave me convergence error. 

Can someone help me with that?

Thanks

  • Cancel
Parents
  • samer1
    samer1 over 8 years ago
    OK. I write here a simple code describing my code structure:
    ///////////////////////////////////////////////////////////////////begin code:
    some initialization:
    ....
    .... parameter real form = 0; // I initialize it as 0 or 1
    .....
    ..... real f; // f is a flag
    analog begin
    @ ( initial_step or initial_step("dc") ) begin
    ....some dc initialization;
    f=form;
    end // end dc initialization

    //////////////// here is the one time execution function
    if (f==0)begin
    .......... some code;
    if (function is executed successfully)begin
    f=1;
    end
    end
    //////////////// end the one time execution function
    if (f==1)begin
    .... Run this part for the rest of the simulation time;
    end

    end // end analog

    ////////////////////////// End code
    Note that I only run into DC convergence error when I start the simulation with f=0. if I start with f=1, the simulation runs normally. Do you think there is something wrong with the code structure?

    Thanks!
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • samer1
    samer1 over 8 years ago
    OK. I write here a simple code describing my code structure:
    ///////////////////////////////////////////////////////////////////begin code:
    some initialization:
    ....
    .... parameter real form = 0; // I initialize it as 0 or 1
    .....
    ..... real f; // f is a flag
    analog begin
    @ ( initial_step or initial_step("dc") ) begin
    ....some dc initialization;
    f=form;
    end // end dc initialization

    //////////////// here is the one time execution function
    if (f==0)begin
    .......... some code;
    if (function is executed successfully)begin
    f=1;
    end
    end
    //////////////// end the one time execution function
    if (f==1)begin
    .... Run this part for the rest of the simulation time;
    end

    end // end analog

    ////////////////////////// End code
    Note that I only run into DC convergence error when I start the simulation with f=0. if I start with f=1, the simulation runs normally. Do you think there is something wrong with the code structure?

    Thanks!
    • 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